Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
pkgs/sage-setup, sagemath-{objects,categories,standard}: Add tox envi…
Browse files Browse the repository at this point in the history
…ronment sagepython
  • Loading branch information
Matthias Koeppe committed May 7, 2022
1 parent eb1a786 commit 5ce30b8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
10 changes: 8 additions & 2 deletions pkgs/sage-setup/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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
10 changes: 8 additions & 2 deletions pkgs/sagemath-categories/tox.ini
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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
10 changes: 8 additions & 2 deletions pkgs/sagemath-objects/tox.ini
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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
27 changes: 17 additions & 10 deletions pkgs/sagemath-standard/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
#
Expand All @@ -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,
Expand All @@ -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 =
Expand Down Expand Up @@ -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

0 comments on commit 5ce30b8

Please sign in to comment.