From 5ce30b8415cc104723c2a4850ca3c33064259959 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 7 May 2022 16:02:26 -0700 Subject: [PATCH 1/8] pkgs/sage-setup, sagemath-{objects,categories,standard}: Add tox environment sagepython --- pkgs/sage-setup/tox.ini | 10 ++++++++-- pkgs/sagemath-categories/tox.ini | 10 ++++++++-- pkgs/sagemath-objects/tox.ini | 10 ++++++++-- pkgs/sagemath-standard/tox.ini | 27 +++++++++++++++++---------- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/pkgs/sage-setup/tox.ini b/pkgs/sage-setup/tox.ini index 1923239ce6b..84cf5dab3e0 100644 --- a/pkgs/sage-setup/tox.ini +++ b/pkgs/sage-setup/tox.ini @@ -4,11 +4,11 @@ # # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sage-setup && tox)' +# ./sage -sh -c '(cd pkgs/sage-setup && tox -e sagepython)' # # To test interactively: # -# pkgs/sage-setup/.tox/python/bin/python +# pkgs/sage-setup/.tox/sagepython/bin/python # [tox] @@ -28,3 +28,9 @@ commands = # TODO: Test importing sage_setup.library_order -- when that can handle missing pkgconfig libraries... # TODO: Test more modules -- when the dependency on sage.env has been removed... + +[testenv:sagepython] +passenv = + SAGE_VENV + +basepython = {env:SAGE_VENV}/bin/python3 diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index 831b361256a..74475d61031 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -1,10 +1,10 @@ # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sagemath-categories/src && tox -v -v -v)' +# ./sage -sh -c '(cd pkgs/sagemath-categories/src && tox -v -v -v -e sagepython)' # # To test interactively: # -# pkgs/sagemath-categories/.tox/python/bin/python +# pkgs/sagemath-categories/.tox/sagepython/bin/python # [tox] @@ -31,3 +31,9 @@ commands = python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_categories --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' + +[testenv:sagepython] +passenv = + SAGE_VENV + +basepython = {env:SAGE_VENV}/bin/python3 diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index a1244f7aa8c..9be3fc7605d 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -1,10 +1,10 @@ # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sagemath-objects && tox -v -v)' +# ./sage -sh -c '(cd pkgs/sagemath-objects && tox -v -v -e sagepython)' # # To test interactively: # -# pkgs/sagemath-objects/.tox/python/bin/python +# pkgs/sagemath-objects/.tox/sagepython/bin/python # [tox] @@ -29,3 +29,9 @@ commands = python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.all__sagemath_objects import *' bash -c 'cd bin && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_objects --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' + +[testenv:sagepython] +passenv = + SAGE_VENV + +basepython = {env:SAGE_VENV}/bin/python3 diff --git a/pkgs/sagemath-standard/tox.ini b/pkgs/sagemath-standard/tox.ini index 5fa331ae3c8..dc7c5186dd2 100644 --- a/pkgs/sagemath-standard/tox.ini +++ b/pkgs/sagemath-standard/tox.ini @@ -9,7 +9,8 @@ # # To build and test in the tox environment using the concrete Python dependencies specified # by requirements.txt, using the wheels built and stored by the Sage distribution: -# (Using 'sage -sh' ensures that we use the same Python as the one that we built the wheels +# (Using 'sage -sh' in combination with 'sagepython-...' tox environments +# ensures that we use the same Python as the one that we built the wheels # for. This can also be done ensured manually by using the tox environment py38-sagewheels etc.) # # Afterwards, to test interactively: @@ -25,17 +26,17 @@ envlist = # Build dependencies according to requirements.txt (all versions fixed). # Use ONLY the wheels built and stored by the Sage distribution (no PyPI): # - # ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e python-sagewheels-nopypi)' + # ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-nopypi)' # - python-sagewheels-nopypi, + sagepython-sagewheels-nopypi, # # Build and test without using the concrete dependencies specified by requirements.txt, # using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only: # Still use ONLY the wheels built and stored by the Sage distribution (no PyPI). # - # ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e python-sagewheels-nopypi-norequirements)' + # ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-nopypi-norequirements)' # - python-sagewheels-nopypi-norequirements, + sagepython-sagewheels-nopypi-norequirements, # # EXPERIMENTAL ENVIRONMENTS: # @@ -44,14 +45,14 @@ envlist = # and additionally allow packages from PyPI. # Because all versions are fixed, we "should" end up using the prebuilt wheels. # - # ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e python-sagewheels)' + # ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels)' # - python-sagewheels, + sagepython-sagewheels, # # Likewise, but using pipenv using Pipfile-dist (= SAGE_ROOT/Pipfile). # This also fixes the concrete dependencies (at least for some packages). # - python-sagewheels-pipenv-dist, + sagepython-sagewheels-pipenv-dist, # # Build using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only. # Use the wheels built and stored by the Sage distribution, @@ -60,11 +61,11 @@ envlist = # Because the version ranges will allow for packages to come in from PyPI (in source or wheel form), # this is likely to fail because we do not have control over the configuration of these packages. # - python-sagewheels-norequirements, + sagepython-sagewheels-norequirements, # # Likewise, but using pipenv # - python-sagewheels-pipenv + sagepython-sagewheels-pipenv [testenv] deps = @@ -129,3 +130,9 @@ commands = sage -c 'import sys; print("sys.path =", sys.path); import sage.all; print(sage.all.__file__)' sage -t -p --all + +[testenv:sagepython] +passenv = + SAGE_VENV + +basepython = {env:SAGE_VENV}/bin/python3 From 9db6b2f9dfc496edfcf955b3b66bf62919587ddb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 7 May 2022 16:04:07 -0700 Subject: [PATCH 2/8] src/doc/en/developer/packaging_sage_library.rst: Use sagepython instead of hardcoded py39 --- src/doc/en/developer/packaging_sage_library.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/en/developer/packaging_sage_library.rst b/src/doc/en/developer/packaging_sage_library.rst index a8ea6c8bd40..b2af8da05c7 100644 --- a/src/doc/en/developer/packaging_sage_library.rst +++ b/src/doc/en/developer/packaging_sage_library.rst @@ -545,7 +545,7 @@ Following the comments in the file ``SAGE_ROOT/pkgs/sagemath-standard/tox.ini``, we can try the following command:: - $ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-standard && SAGE_NUM_THREADS=16 tox -v -v -v -e py39-sagewheels-nopypi)' + $ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-standard && SAGE_NUM_THREADS=16 tox -v -v -v -e sagepython-sagewheels-nopypi)' This command does not make any changes to the normal installation of Sage. The virtual environment is created in a subdirectory of @@ -553,11 +553,11 @@ Sage. The virtual environment is created in a subdirectory of finishes, we can start the separate installation of the Sage library in its virtual environment:: - $ pkgs/sagemath-standard/.tox/py39-sagewheels-nopypi/bin/sage + $ pkgs/sagemath-standard/.tox/sagepython-sagewheels-nopypi/bin/sage We can also run parts of the testsuite:: - $ pkgs/sagemath-standard/.tox/py39-sagewheels-nopypi/bin/sage -tp 4 src/sage/graphs/ + $ pkgs/sagemath-standard/.tox/sagepython-sagewheels-nopypi/bin/sage -tp 4 src/sage/graphs/ The whole ``.tox`` directory can be safely deleted at any time. @@ -570,7 +570,7 @@ without depending on optional packages, but without the packages Again we can run the test with ``tox`` in a separate virtual environment:: - $ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-standard-no-symbolics && SAGE_NUM_THREADS=16 tox -v -v -v -e py39-sagewheels-nopypi)' + $ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-standard-no-symbolics && SAGE_NUM_THREADS=16 tox -v -v -v -e sagepython-sagewheels-nopypi)' Some small distributions, for example the ones providing the two lowest levels, `sagemath-objects `_ @@ -578,7 +578,7 @@ and `sagemath-categories `_ (from :trac:`29865`), can be installed and tested without relying on the wheels from the Sage build:: - $ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-objects && SAGE_NUM_THREADS=16 tox -v -v -v -e py39)' + $ ./bootstrap && ./sage -sh -c '(cd pkgs/sagemath-objects && SAGE_NUM_THREADS=16 tox -v -v -v -e sagepython)' This command finds the declared build-time and run-time dependencies on PyPI, either as source tarballs or as prebuilt wheels, and builds From c9ca4e4f0d7c76c41c8afb3a882c92abc0cac85b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 17 Jun 2022 17:33:16 -0700 Subject: [PATCH 3/8] pkgs/sagemath-standard/tox.ini: Set basepython correctly for all supported sagepython-* environments --- pkgs/sagemath-standard/tox.ini | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pkgs/sagemath-standard/tox.ini b/pkgs/sagemath-standard/tox.ini index dc7c5186dd2..b80af350be4 100644 --- a/pkgs/sagemath-standard/tox.ini +++ b/pkgs/sagemath-standard/tox.ini @@ -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 @@ -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 From 01bd09cc6a6f276941975c8fb163b70fa1c04cec Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 17 Jun 2022 17:46:27 -0700 Subject: [PATCH 4/8] pkgs/sagemath-{environment,repl}/tox.ini: Add sagepython toxenv --- pkgs/sagemath-environment/tox.ini | 6 ++++++ pkgs/sagemath-repl/tox.ini | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/pkgs/sagemath-environment/tox.ini b/pkgs/sagemath-environment/tox.ini index f28e260b196..8af948f4676 100644 --- a/pkgs/sagemath-environment/tox.ini +++ b/pkgs/sagemath-environment/tox.ini @@ -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 diff --git a/pkgs/sagemath-repl/tox.ini b/pkgs/sagemath-repl/tox.ini index 0405938001f..ff2e8e826f1 100644 --- a/pkgs/sagemath-repl/tox.ini +++ b/pkgs/sagemath-repl/tox.ini @@ -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 From fe510ef42ceb7f9c25c838d8bb952019a246ac5a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 29 Jun 2022 17:38:18 -0700 Subject: [PATCH 5/8] build/pkgs/sage_{conf,setup}/install-requires: Use ~= 9.7.b3 --- build/pkgs/sage_conf/install-requires.txt | 2 +- build/pkgs/sage_setup/install-requires.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pkgs/sage_conf/install-requires.txt b/build/pkgs/sage_conf/install-requires.txt index 83ad7e641fa..2d13b49ef28 100644 --- a/build/pkgs/sage_conf/install-requires.txt +++ b/build/pkgs/sage_conf/install-requires.txt @@ -1 +1 @@ -sage-conf ~= 9.5.b6 +sage-conf ~= 9.7.b3 diff --git a/build/pkgs/sage_setup/install-requires.txt b/build/pkgs/sage_setup/install-requires.txt index 01a931f5eb5..17adea02d63 100644 --- a/build/pkgs/sage_setup/install-requires.txt +++ b/build/pkgs/sage_setup/install-requires.txt @@ -1 +1 @@ -sage-setup ~= 9.5.b6 +sage-setup ~= 9.7.b3 From b5fedffa3d46f099109a75368f2a18151c31980a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 30 Jun 2022 17:50:39 -0700 Subject: [PATCH 6/8] build/pkgs/giac/spkg-configure.m4: Pop what was pushed --- build/pkgs/giac/spkg-configure.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4 index 8c04d25e90e..d6c1d094198 100644 --- a/build/pkgs/giac/spkg-configure.m4 +++ b/build/pkgs/giac/spkg-configure.m4 @@ -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]) ]) ]) From 74f1e102a3c7c50ab00fba8f9e823f30b54bf3a2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 1 Jul 2022 13:19:01 -0700 Subject: [PATCH 7/8] src/requirements.txt.m4, src/setup.cfg.m4 (install_requires): Add primecountpy --- src/requirements.txt.m4 | 1 + src/setup.cfg.m4 | 1 + 2 files changed, 2 insertions(+) diff --git a/src/requirements.txt.m4 b/src/requirements.txt.m4 index 20642c514c3..b790a5f4d29 100644 --- a/src/requirements.txt.m4 +++ b/src/requirements.txt.m4 @@ -28,6 +28,7 @@ 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)') diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 8f4cdd8ab0d..9571aa3358d 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -43,6 +43,7 @@ dnl From build/pkgs/sagelib/dependencies numpy \ pkgconfig \ pplpy \ + primecountpy \ memory_allocator \ requests \ | sed "2,\$s/^/ /;"')dnl' From 5ea0035cdc9e46939d1d06cdc9b192273d6ff0b4 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 2 Jul 2022 12:57:57 -0700 Subject: [PATCH 8/8] src/requirements.txt.m4, src/setup.cfg.m4 (install_requires): Add lrcalc_python --- src/requirements.txt.m4 | 1 + src/setup.cfg.m4 | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/requirements.txt.m4 b/src/requirements.txt.m4 index b790a5f4d29..a6cba21cc7e 100644 --- a/src/requirements.txt.m4 +++ b/src/requirements.txt.m4 @@ -23,6 +23,7 @@ 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 diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 9571aa3358d..68056007ed0 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -40,11 +40,12 @@ dnl From build/pkgs/sagelib/dependencies gmpy2 \ jinja2 \ jupyter_core \ + lrcalc_python \ + memory_allocator \ numpy \ pkgconfig \ pplpy \ primecountpy \ - memory_allocator \ requests \ | sed "2,\$s/^/ /;"')dnl' dnl From Makefile.in: SAGERUNTIME