Skip to content

Commit

Permalink
Trac #32716: pkgs/sagemath-*/tox.ini: Create environment that uses Sa…
Browse files Browse the repository at this point in the history
…ge's python as the basepython, fix sagemath-standard deps

Newer versions of `tox` seem to provision python 3.10 when the
environment `python` is used, but then our wheels don't necessarily fit.

For this reason, the examples shown in the developer's manual hardcoded
the Python version (`tox -e py39`).

We now define tox environments `sagepython` in `tox.ini`, which takes
Python as `SAGE_VENV/bin/python3` and change the manual to use this
environment in examples, such as:
{{{
./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-standard &&
SAGE_NUM_THREADS=16 tox -v -v -v -e sagepython-sagewheels-nopypi)'
}}}
(to be run after `make build`)

URL: https://trac.sagemath.org/32716
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Jul 9, 2022
2 parents 6294f36 + ca9d6ce commit 720adde
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions build/pkgs/giac/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ SAGE_SPKG_CONFIGURE([giac], [
], [sage_spkg_install_giac=yes])
], [sage_spkg_install_giac=yes])
m4_popdef([GIAC_MIN_VERSION])
m4_popdef([GIAC_MAX_VERSION])
])
])
2 changes: 1 addition & 1 deletion build/pkgs/sage_conf/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sage-conf ~= 9.5.b6
sage-conf ~= 9.7.b3
2 changes: 1 addition & 1 deletion build/pkgs/sage_setup/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sage-setup ~= 9.5.b6
sage-setup ~= 9.7.b3
6 changes: 6 additions & 0 deletions pkgs/sagemath-environment/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ whitelist_externals =
commands =
# Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package.
python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.features.all import all_features; print(sorted(all_features(), key=lambda x: x.name)); import sage.misc.package'

[testenv:sagepython]
passenv =
SAGE_VENV

basepython = {env:SAGE_VENV}/bin/python3
6 changes: 6 additions & 0 deletions pkgs/sagemath-repl/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ commands =
python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.repl.all; import sage.doctest.all'

bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_repl --optional=sage $SAGE_SRC/sage/repl $SAGE_SRC/sage/doctest $SAGE_SRC/sage/misc/sage_input.py $SAGE_SRC/sage/misc/sage_eval.py || echo "(lots of doctest failures are expected)"'

[testenv:sagepython]
passenv =
SAGE_VENV

basepython = {env:SAGE_VENV}/bin/python3
21 changes: 18 additions & 3 deletions pkgs/sagemath-standard/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ passenv =
# Parallel build
SAGE_NUM_THREADS
# SAGE_VENV only for finding the wheels
sagewheels: SAGE_VENV
sagepython, sagewheels: SAGE_VENV
# Location of the wheels (needs to include a PEP 503 compliant
# Simple Repository index, i.e., a subdirectory "simple")
sagewheels: SAGE_SPKG_WHEELS
Expand Down Expand Up @@ -132,7 +132,22 @@ commands =
sage -t -p --all

[testenv:sagepython]
passenv =
SAGE_VENV
basepython = {env:SAGE_VENV}/bin/python3

[testenv:sagepython-sagewheels-nopypi]
basepython = {env:SAGE_VENV}/bin/python3

[testenv:sagepython-sagewheels-nopypi-norequirements]
basepython = {env:SAGE_VENV}/bin/python3

[testenv:sagepython-sagewheels]
basepython = {env:SAGE_VENV}/bin/python3

[testenv:sagepython-sagewheels-pipenv-dist]
basepython = {env:SAGE_VENV}/bin/python3

[testenv:sagepython-sagewheels-norequirements]
basepython = {env:SAGE_VENV}/bin/python3

[testenv:sagepython-sagewheels-pipenv]
basepython = {env:SAGE_VENV}/bin/python3
2 changes: 2 additions & 0 deletions src/requirements.txt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ gmpy2==esyscmd(`printf $(sed "s/[.]p.*//;" ../gmpy2/package-version.txt)')
jinja2==esyscmd(`printf $(sed "s/[.]p.*//;" ../jinja2/package-version.txt)')
dnl ... for sage_setup.autogen.interpreters
jupyter_core==esyscmd(`printf $(sed "s/[.]p.*//;" ../jupyter_core/package-version.txt)')
lrcalc==esyscmd(`printf $(sed "s/[.]p.*//;" ../lrcalc_python/package-version.txt)')
memory_allocator==esyscmd(`printf $(sed "s/[.]p.*//;" ../memory_allocator/package-version.txt)')
numpy==esyscmd(`printf $(sed "s/[.]p.*//;" ../numpy/package-version.txt)')
dnl ... already needed by sage.env
pkgconfig==esyscmd(`printf $(sed "s/[.]p.*//;" ../pkgconfig/package-version.txt)')
pplpy==esyscmd(`printf $(sed "s/[.]p.*//;" ../pplpy/package-version.txt)')
primecountpy==esyscmd(`printf $(sed "s/[.]p.*//;" ../primecountpy/package-version.txt)')
pycygwin==esyscmd(`printf $(sed "s/[.]p.*//;" ../pycygwin/package-version.txt)'); sys_platform == 'cygwin'
requests==esyscmd(`printf $(sed "s/[.]p.*//;" ../requests/package-version.txt)')

Expand Down
4 changes: 3 additions & 1 deletion src/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ dnl From build/pkgs/sagelib/dependencies
gmpy2 \
jinja2 \
jupyter_core \
lrcalc_python \
memory_allocator \
numpy \
pkgconfig \
pplpy \
memory_allocator \
primecountpy \
requests \
| sed "2,\$s/^/ /;"')dnl'
dnl From Makefile.in: SAGERUNTIME
Expand Down

0 comments on commit 720adde

Please sign in to comment.