diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index a240b091e30..c7dbc3fb5dd 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -1,23 +1,23 @@ # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sagemath-categories && tox -v -v -v -e sagepython)' +# make SAGE_WHEELS=yes sagemath_categories-build-deps sagemath_repl && ./sage -sh -c '(cd pkgs/sagemath-categories && SAGE_NUM_THREADS=8 tox -v -v -v -e sagepython-sagewheels-nopypi-norequirements)' # -# To test interactively: +# After this, to test interactively: # -# pkgs/sagemath-categories/.tox/sagepython/bin/python +# pkgs/sagemath-categories/.tox/sagepython-sagewheels-nopypi-norequirements/bin/sage # [tox] envlist = - sagepython-norequirements + sagepython-sagewheels-nopypi-norequirements -[testenv] -deps = - !norequirements: -rrequirements.txt - # tox 3.x does not handle extras when using --installpkg. https://github.com/tox-dev/tox/issues/1576 - sagemath-repl - -extras = test +requires = + # Auto-provision a modern tox. + # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance + tox>=4.2 +[pkgenv] +# Environment in which to build the sdist. +# https://tox.wiki/en/latest/upgrading.html#packaging-environments passenv = # Variables set by .homebrew-build-env CPATH @@ -32,36 +32,73 @@ passenv = sagewheels: SAGE_SPKG_WHEELS setenv = - # Sage scripts such as sage-runtests like to use $HOME/.sage - HOME={envdir} # We supply pip options by environment variables so that they # apply both to the installation of the dependencies and of the package sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} nopypi: PIP_NO_INDEX=true +[testenv] +deps = + !norequirements: -rrequirements.txt + +extras = test + +passenv = {[pkgenv]passenv} + +setenv = {[pkgenv]setenv} + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + allowlist_externals = bash commands = - # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package. + # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. {envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.cpython.builtin_types, sage.cpython.cython_metaclass, sage.cpython.debug, sage.structure.all, sage.categories.all' # Test that importing sage.categories.all initializes categories {envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()' - bash -c 'cd {temp_dir} && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --initial --environment=sage.all__sagemath_categories --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' + bash -c 'cd $(python -c "import sys; \"\" in sys.path and sys.path.remove(\"\"); from sage.env import SAGE_LIB; print(SAGE_LIB)") \ + && sage-runtests -p --initial --environment=sage.all__sagemath_categories --optional=sage sage/structure || echo "(lots of doctest failures are expected)"' + +[testenv:.tox] +# Allow access to PyPI for auto-provisioning a suitable tox version +passenv = +setenv = PIP_NO_INDEX=false + +[testenv:.pkg-sagepython] +# Environment in which to build the sdist. +# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi] +passenv = {[pkgenv]passenv} + SAGE_VENV + SAGE_SPKG_WHEELS + +setenv = {[pkgenv]setenv} + PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + PIP_NO_INDEX=true + +basepython = {env:SAGE_VENV}/bin/python3 [testenv:sagepython] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-nopypi] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels-nopypi-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels] -basepython = {env:SAGE_VENV}/bin/python3 +basepython = {env:SAGE_VENV}/bin/python +package_env = .pkg-sagepython [testenv:sagepython-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython diff --git a/pkgs/sagemath-environment/tox.ini b/pkgs/sagemath-environment/tox.ini index 46077bd8e27..65bcdc902e0 100644 --- a/pkgs/sagemath-environment/tox.ini +++ b/pkgs/sagemath-environment/tox.ini @@ -1,22 +1,28 @@ # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sagemath-environment && tox -v -v -e sagepython)' +# ./sage -sh -c '(cd pkgs/sagemath-environment && tox -v -v -e sagepython-norequirements)' # # To test interactively: # -# pkgs/sagemath-environment/.tox/sagepython/bin/python +# pkgs/sagemath-environment/.tox/sagepython-norequirements/bin/python # [tox] envlist = sagepython-norequirements -isolated_build = True - -[testenv] -deps = - !norequirements: -rrequirements.txt +requires = + # Auto-provision a modern tox. + # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance + tox>=4.2 +[pkgenv] +# Environment in which to build the sdist. +# https://tox.wiki/en/latest/upgrading.html#packaging-environments passenv = + # Variables set by .homebrew-build-env + CPATH + LIBRARY_PATH + PKG_CONFIG_PATH # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL @@ -26,13 +32,23 @@ passenv = sagewheels: SAGE_SPKG_WHEELS setenv = - # Sage scripts such as sage-runtests like to use $HOME/.sage - HOME={envdir} # We supply pip options by environment variables so that they # apply both to the installation of the dependencies and of the package sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} nopypi: PIP_NO_INDEX=true +[testenv] +deps = + !norequirements: -rrequirements.txt + +extras = test + +passenv = {[pkgenv]passenv} + +setenv = {[pkgenv]setenv} + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + allowlist_externals = bash @@ -40,17 +56,43 @@ commands = # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. {envpython} -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:.tox] +# Allow access to PyPI for auto-provisioning a suitable tox version +passenv = +setenv = PIP_NO_INDEX=false + +[testenv:.pkg-sagepython] +# Environment in which to build the sdist. +# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi] +passenv = {[pkgenv]passenv} + SAGE_VENV + SAGE_SPKG_WHEELS + +setenv = {[pkgenv]setenv} + PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + PIP_NO_INDEX=true + +basepython = {env:SAGE_VENV}/bin/python3 + [testenv:sagepython] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-nopypi] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels-nopypi-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels] -basepython = {env:SAGE_VENV}/bin/python3 +basepython = {env:SAGE_VENV}/bin/python +package_env = .pkg-sagepython [testenv:sagepython-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index e34531467e5..e5bf1e6dac7 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -1,21 +1,23 @@ # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sagemath-objects && tox -v -v -e sagepython)' +# ./sage -sh -c '(cd pkgs/sagemath-objects && SAGE_NUM_THREADS=8 tox -v -v -e sagepython-norequirements)' # -# To test interactively: +# After this, to test interactively: # -# pkgs/sagemath-objects/.tox/sagepython/bin/python +# pkgs/sagemath-objects/.tox/sagepython-norequirements/bin/python # [tox] envlist = sagepython-norequirements -[testenv] -deps = - !norequirements: -rrequirements.txt - -extras = test +requires = + # Auto-provision a modern tox. + # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance + tox>=4.2 +[pkgenv] +# Environment in which to build the sdist. +# https://tox.wiki/en/latest/upgrading.html#packaging-environments passenv = # Variables set by .homebrew-build-env CPATH @@ -30,13 +32,23 @@ passenv = sagewheels: SAGE_SPKG_WHEELS setenv = - # Sage scripts such as sage-runtests like to use $HOME/.sage - HOME={envdir} # We supply pip options by environment variables so that they # apply both to the installation of the dependencies and of the package sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} nopypi: PIP_NO_INDEX=true +[testenv] +deps = + !norequirements: -rrequirements.txt + +extras = test + +passenv = {[pkgenv]passenv} + +setenv = {[pkgenv]setenv} + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + allowlist_externals = bash @@ -48,17 +60,43 @@ commands = #bash -c 'cd {temp_dir} && SAGE_SRC=$(python -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_objects --initial --optional=sage $SAGE_SRC/sage/structure || echo "(lots of doctest failures are expected)"' +[testenv:.tox] +# Allow access to PyPI for auto-provisioning a suitable tox version +passenv = +setenv = PIP_NO_INDEX=false + +[testenv:.pkg-sagepython] +# Environment in which to build the sdist. +# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi] +passenv = {[pkgenv]passenv} + SAGE_VENV + SAGE_SPKG_WHEELS + +setenv = {[pkgenv]setenv} + PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + PIP_NO_INDEX=true + +basepython = {env:SAGE_VENV}/bin/python3 + [testenv:sagepython] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-nopypi] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels-nopypi-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels] -basepython = {env:SAGE_VENV}/bin/python3 +basepython = {env:SAGE_VENV}/bin/python +package_env = .pkg-sagepython [testenv:sagepython-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython diff --git a/pkgs/sagemath-repl/tox.ini b/pkgs/sagemath-repl/tox.ini index 084016ce768..1637788be39 100644 --- a/pkgs/sagemath-repl/tox.ini +++ b/pkgs/sagemath-repl/tox.ini @@ -1,21 +1,23 @@ # To build and test in the tox environment: # -# ./sage -sh -c '(cd pkgs/sagemath-repl && tox -v -v -e sagepython)' +# make SAGE_WHEELS=yes sagemath_repl-build-deps && ./sage -sh -c '(cd pkgs/sagemath-repl && SAGE_NUM_THREADS=8 tox -v -v -e sagepython-sagewheels-nopypi-norequirements)' # -# To test interactively: +# After this, to test interactively: # -# pkgs/sagemath-repl/.tox/sagepython/bin/python +# pkgs/sagemath-repl/.tox/sagepython-sagewheels-nopypi-norequirements/bin/python # [tox] envlist = - sagepython-norequirements + sagepython-sagewheels-nopypi-norequirements -isolated_build = True - -[testenv] -deps = - !norequirements: -rrequirements.txt +requires = + # Auto-provision a modern tox. + # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance + tox>=4.2 +[pkgenv] +# Environment in which to build the sdist. +# https://tox.wiki/en/latest/upgrading.html#packaging-environments passenv = # Variables set by .homebrew-build-env CPATH @@ -30,13 +32,23 @@ passenv = sagewheels: SAGE_SPKG_WHEELS setenv = - # Sage scripts such as sage-runtests like to use $HOME/.sage - HOME={envdir} # We supply pip options by environment variables so that they # apply both to the installation of the dependencies and of the package sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} nopypi: PIP_NO_INDEX=true +[testenv] +deps = + !norequirements: -rrequirements.txt + +extras = test + +passenv = {[pkgenv]passenv} + +setenv = {[pkgenv]setenv} + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + allowlist_externals = bash @@ -44,19 +56,45 @@ commands = # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. {envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); import sage.repl.all; import sage.doctest.all' - bash -c 'cd bin && SAGE_SRC=$({envpython} -c "from sage.env import SAGE_SRC; print(SAGE_SRC)") && sage-runtests --environment=sage.all__sagemath_repl --initial --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)"' + bash -c 'cd $({envpython} -c "import sys; \"\" in sys.path and sys.path.remove(\"\"); from sage.env import SAGE_LIB; print(SAGE_LIB)") && sage-runtests -p --environment=sage.all__sagemath_repl --initial --optional=sage sage/repl sage/doctest sage/misc/sage_input.py sage/misc/sage_eval.py || echo "(lots of doctest failures are expected)"' + +[testenv:.tox] +# Allow access to PyPI for auto-provisioning a suitable tox version +passenv = +setenv = PIP_NO_INDEX=false + +[testenv:.pkg-sagepython] +# Environment in which to build the sdist. +# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi] +passenv = {[pkgenv]passenv} + SAGE_VENV + SAGE_SPKG_WHEELS + +setenv = {[pkgenv]setenv} + PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + PIP_NO_INDEX=true + +basepython = {env:SAGE_VENV}/bin/python3 [testenv:sagepython] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-nopypi] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels-nopypi-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels] -basepython = {env:SAGE_VENV}/bin/python3 +basepython = {env:SAGE_VENV}/bin/python +package_env = .pkg-sagepython [testenv:sagepython-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython diff --git a/pkgs/sagemath-standard/tox.ini b/pkgs/sagemath-standard/tox.ini index 305eddd7586..0430bcda5cc 100644 --- a/pkgs/sagemath-standard/tox.ini +++ b/pkgs/sagemath-standard/tox.ini @@ -1,7 +1,3 @@ -# First install tox: -# -# ./sage -i tox -# # All tests require an installation of the non-Python components of the Sage distribution # in SAGE_LOCAL. # @@ -67,14 +63,14 @@ envlist = # sagepython-sagewheels-pipenv -[testenv] -deps = - pipenv: pipenv - !pipenv-!norequirements: -rrequirements.txt - ## Needed for fpylll - norequirements: Cython - norequirements: cysignals +requires = + # Auto-provision a modern tox. + # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance + tox>=4.2 +[pkgenv] +# Environment in which to build the sdist. +# https://tox.wiki/en/latest/upgrading.html#packaging-environments passenv = # Variables set by .homebrew-build-env CPATH @@ -82,14 +78,13 @@ passenv = PKG_CONFIG_PATH # Parallel build SAGE_NUM_THREADS + SAGE_NUM_THREADS_PARALLEL # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels sagewheels: SAGE_SPKG_WHEELS setenv = - # Sage scripts such as sage-runtests like to use $HOME/.sage - HOME={envdir} # We supply pip options by environment variables so that they # apply both to the installation of the dependencies and of the package sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} @@ -103,50 +98,86 @@ setenv = # so we cannot isolate it in the tox environment. pipenv: PIPENV_SKIP_LOCK=true +[testenv] +deps = + pipenv: pipenv + !pipenv-!norequirements: -rrequirements.txt + ## Needed for fpylll + norequirements: Cython + norequirements: cysignals + sitepackages = sitepackages: True !sitepackages: False +extras = test + +passenv = {[pkgenv]passenv} + +setenv = {[pkgenv]setenv} + # Sage scripts such as sage-runtests like to use $HOME/.sage + HOME={envdir} + allowlist_externals = bash -skip_install = - pipenv: True - !pipenv: False - -commands_pre = - # Use Pipenv to install according to Pipfile into the virtual environment created by tox. - # https://pipenv-searchable.readthedocs.io/advanced.html#tox-automation-project - pipenv-!dist: pipenv install -v -v -v - # Same, but use $SAGE_ROOT/Pipfile - pipenv-dist: bash -c '(cd ../../../.. && pipenv install -v -v -v)' +# Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. +# So we change to another directory when running commands. +change_dir = {env_tmp_dir} 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(""); import sage.all; print(sage.all.__file__)' + python -c 'import sage.all; print(sage.all.__file__)' # We check that the "sage" script invokes the correct Python. sage -c 'import sys; print("sys.path =", sys.path); import sage.all; print(sage.all.__file__)' sage -t -p --all +[testenv:.tox] +# Allow access to PyPI for auto-provisioning a suitable tox version +passenv = +setenv = PIP_NO_INDEX=false + +[testenv:.pkg-sagepython] +# Environment in which to build the sdist. +# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments +basepython = {env:SAGE_VENV}/bin/python3 + +[testenv:.pkg-sagepython-sagewheels-nopypi] +passenv = {[pkgenv]passenv} + SAGE_VENV + SAGE_SPKG_WHEELS + +setenv = {[pkgenv]setenv} + PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels} + PIP_NO_INDEX=true + +basepython = {env:SAGE_VENV}/bin/python3 + [testenv:sagepython] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-nopypi] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels-nopypi-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython-sagewheels-nopypi [testenv:sagepython-sagewheels] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-pipenv-dist] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-norequirements] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython [testenv:sagepython-sagewheels-pipenv] basepython = {env:SAGE_VENV}/bin/python3 +package_env = .pkg-sagepython diff --git a/src/doc/en/developer/packaging_sage_library.rst b/src/doc/en/developer/packaging_sage_library.rst index f854a4f3eff..83f883dd53e 100644 --- a/src/doc/en/developer/packaging_sage_library.rst +++ b/src/doc/en/developer/packaging_sage_library.rst @@ -591,16 +591,14 @@ distribution to be tested (and its Python dependencies). Let's try it out first with the entire Sage library, represented by the distribution **sagemath-standard**. Note that after Sage has been -built normally, a set of wheels for all installed Python packages is -available in ``SAGE_VENV/var/lib/sage/wheels/``:: +built normally, a set of wheels for most installed Python distribution +packages is available in ``SAGE_VENV/var/lib/sage/wheels/``:: $ ls venv/var/lib/sage/wheels Babel-2.9.1-py2.py3-none-any.whl Cython-0.29.24-cp39-cp39-macosx_11_0_x86_64.whl Jinja2-2.11.2-py2.py3-none-any.whl ... - sage_conf-9.5b6-py3-none-any.whl - ... scipy-1.7.2-cp39-cp39-macosx_11_0_x86_64.whl setuptools-58.2.0-py3-none-any.whl ... @@ -608,6 +606,22 @@ available in ``SAGE_VENV/var/lib/sage/wheels/``:: widgetsnbextension-3.5.1-py2.py3-none-any.whl zipp-3.5.0-py3-none-any.whl +However, in a build of Sage with the default configuration +``configure --enable-editable``, there will be no wheels for the +distributions ``sage_*`` and ``sagemath-*``. + +To create these wheels, use the command ``make wheels``:: + + $ make wheels + ... + $ ls venv/var/lib/sage/wheels/sage* + ... + sage_conf-10.0b2-py3-none-any.whl + ... + +(You can also use ``./configure --enable-wheels`` to ensure that +these wheels are always available and up to date.) + Note in particular the wheel for **sage-conf**, which provides configuration variable settings and the connection to the non-Python packages installed in ``SAGE_LOCAL``. @@ -648,7 +662,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 sagepython-sagewheels-nopypi)' + $ ./bootstrap && make wheels && ./sage -sh -c '(cd pkgs/sagemath-standard-no-symbolics && SAGE_NUM_THREADS=16 tox -v -v -v -e sagepython-sagewheels-nopypi-norequirements)' Some small distributions, for example the ones providing the two lowest levels, `sagemath-objects `_ diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py index 772007c6910..d0b5808e215 100644 --- a/src/sage/misc/package.py +++ b/src/sage/misc/package.py @@ -384,12 +384,19 @@ def installed_packages(exclude_pip=True): - ``exclude_pip`` -- (optional, default: ``True``) whether "pip" packages are excluded from the list - EXAMPLES:: + EXAMPLES: + + Below we test for a standard package without ``spkg-configure.m4`` script + that should be installed in ``SAGE_LOCAL``. When Sage is installed by + the Sage distribution (indicated by feature ``sage_spkg``), we should have + the installation record for this package. (We do not test for installation + records of Python packages. Our ``SAGE_VENV`` is not necessarily the + main Sage venv; it could be a user-created venv or a venv created by tox.):: - sage: sorted(installed_packages().keys()) # optional - sage_spkg - [...'gmpy2', ...'sage_conf', ...] - sage: installed_packages()['gmpy2'] # optional - sage_spkg, random - '2.1.0b5' + sage: sorted(installed_packages().keys()) # optional - sage_spkg + [...'conway_polynomials', ...] + sage: installed_packages()['conway_polynomials'] # optional - sage_spkg, random + '0.5' .. SEEALSO:: @@ -424,12 +431,12 @@ def is_package_installed(package, exclude_pip=True): EXAMPLES:: - sage: is_package_installed('gap') # optional - sage_spkg + sage: is_package_installed('conway_polynomials') # optional - sage_spkg True Giving just the beginning of the package name is not good enough:: - sage: is_package_installed('matplotli') # optional - sage_spkg + sage: is_package_installed('conway_poly') # optional - sage_spkg False Otherwise, installing "pillow" would cause this function to think @@ -621,15 +628,15 @@ def package_manifest(package): EXAMPLES:: sage: from sage.misc.package import package_manifest - sage: sagetex_manifest = package_manifest('sagetex') # optional - sage_spkg - sage: sagetex_manifest['package_name'] == 'sagetex' # optional - sage_spkg + sage: manifest = package_manifest('conway_polynomials') # optional - sage_spkg + sage: manifest['package_name'] == 'conway_polynomials' # optional - sage_spkg True - sage: 'files' in sagetex_manifest # optional - sage_spkg + sage: 'files' in manifest # optional - sage_spkg True Test a nonexistent package:: - sage: package_manifest('dummy-package') # optional - sage_spkg + sage: package_manifest('dummy-package') # optional - sage_spkg Traceback (most recent call last): ... KeyError: 'dummy-package'