Opened 3 years ago

Closed 3 years ago

#29367 closed enhancement (fixed)

tox.ini: Add tests for python2

Reported by: Matthias Köppe Owned by:
Priority: major Milestone: sage-9.1
Component: porting Keywords:
Cc: John Palmieri, Dima Pasechnik, Markus Wageringel Merged in:
Authors: Matthias Koeppe Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: a33b72a (Commits, GitHub, GitLab) Commit: a33b72a011c34215aabe4b792dd91c14fb8f09ed
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

These tests can be run by adding -python2 to the tox environment, such as

    tox -e local-homebrew-macos-standard-python2
    tox -e docker-ubuntu-bionic-standard-python2

Additionally, now local environments (introduced in #29104 for homebrew) respect the environment variable EXTRA_CONFIGURE_ARGS that was already available for docker environments.

Change History (18)

comment:1 Changed 3 years ago by Matthias Köppe

Branch: u/mkoeppe/tox_ini__add_tests_for_python2

comment:2 Changed 3 years ago by Matthias Köppe

Authors: Matthias Koeppe
Cc: John Palmieri Dima Pasechnik Markus Wageringel added
Commit: a33b72a011c34215aabe4b792dd91c14fb8f09ed
Dependencies: #29104
Description: modified (diff)
Status: newneeds_review

Last 10 new commits:

14a3dabtox.ini [local]: Disable testsuites for some packages
2553b5atox.ini [local]: Disable linbox testsuite
2f79c76tox.ini: Move homebrew environment settings to script .homebrew-build-env
77d5c11build/pkgs/ntl/distros/homebrew.txt: Remove ntl
4ec80e2Remove use of homebrew packages flint, arb
54c803bbuild/pkgs/patch/distros/homebrew.txt: New
2ce6e6cbuild/pkgs/boost*/distros/homebrew.txt: New
467160c.gitignore: Add prefix
dfce7d4tox.ini [local]: Pass MAKE environment variable, do not default to 'make -j12', change default target to 'build', add doc
a33b72atox.ini: Add configuration factor 'python2'; [local] respect EXTRA_CONFIGURE_ARGS

comment:3 Changed 3 years ago by Matthias Köppe

Branch is on top of #29104.

comment:5 Changed 3 years ago by Matthias Köppe

On debian-jessie-standard-python2 (https://github.com/mkoeppe/sage/runs/525632981):

  [pynac-0.7.26]   checking for a version of Python >= '2.1.0'... sys:1: RuntimeWarning: not adding directory '' to sys.path since it's not owned by a trusted user.
  [pynac-0.7.26]   Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
  [pynac-0.7.26]   yes
  [pynac-0.7.26]   checking for the distutils Python package... no
  [pynac-0.7.26]   configure: error: cannot import Python module "distutils".

comment:6 Changed 3 years ago by Matthias Köppe

Same on debian-buster-standard-python2

comment:7 Changed 3 years ago by Matthias Köppe

And on debian-bullseye-standard-python2 both pynac and pip fail

comment:8 Changed 3 years ago by Matthias Köppe

The pynac error is caused by the warning sys:1: RuntimeWarning: not adding directory '' to sys.path since it's not owned by a trusted user., which is considered an error by pynac's configure.

comment:9 Changed 3 years ago by Matthias Köppe

This might be output because we run as root?

comment:10 Changed 3 years ago by Matthias Köppe

caused by build/pkgs/python2/patches/sys_path_security-issue_16202.patch, of course.

comment:11 Changed 3 years ago by Matthias Köppe

Not a good idea that we output that warning even in noninteractive invocations of PYTHON (python -c)

comment:12 Changed 3 years ago by John Palmieri

Maybe it's finally time to get rid of that patch.

comment:13 Changed 3 years ago by Matthias Köppe

I agree - I have created #29394 for this.

comment:14 Changed 3 years ago by Matthias Köppe

Dependencies: #29104#29104, #29394

comment:15 Changed 3 years ago by Dima Pasechnik

Reviewers: Dima Pasechnik
Status: needs_reviewpositive_review

ok

comment:16 Changed 3 years ago by Matthias Köppe

Thanks!

comment:17 Changed 3 years ago by Matthias Köppe

Dependencies: #29104, #29394

comment:18 Changed 3 years ago by Volker Braun

Branch: u/mkoeppe/tox_ini__add_tests_for_python2a33b72a011c34215aabe4b792dd91c14fb8f09ed
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.