1
1
# To build and test in the tox environment:
2
2
#
3
- # ./sage -sh -c '(cd pkgs/sagemath-categories && tox -v -v -v -e sagepython)'
3
+ # 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 )'
4
4
#
5
- # To test interactively:
5
+ # After this, to test interactively:
6
6
#
7
- # pkgs/sagemath-categories/.tox/sagepython/bin/python
7
+ # pkgs/sagemath-categories/.tox/sagepython-sagewheels-nopypi-norequirements /bin/sage
8
8
#
9
9
[tox]
10
10
envlist =
11
- sagepython-norequirements
11
+ sagepython-sagewheels-nopypi- norequirements
12
12
13
- [testenv]
14
- deps =
15
- !norequirements: -rrequirements.txt
16
- # tox 3.x does not handle extras when using --installpkg. https://github.com/tox-dev/tox/issues/1576
17
- sagemath-repl
18
-
19
- extras = test
13
+ requires =
14
+ # Auto-provision a modern tox.
15
+ # [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance
16
+ tox>=4.2
20
17
18
+ [pkgenv]
19
+ # Environment in which to build the sdist.
20
+ # https://tox.wiki/en/latest/upgrading.html#packaging-environments
21
21
passenv =
22
22
# Variables set by .homebrew-build-env
23
23
CPATH
@@ -32,36 +32,73 @@ passenv =
32
32
sagewheels: SAGE_SPKG_WHEELS
33
33
34
34
setenv =
35
- # Sage scripts such as sage-runtests like to use $HOME/.sage
36
- HOME ={envdir}
37
35
# We supply pip options by environment variables so that they
38
36
# apply both to the installation of the dependencies and of the package
39
37
sagewheels: PIP_FIND_LINKS =file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels}
40
38
nopypi: PIP_NO_INDEX =true
41
39
40
+ [testenv]
41
+ deps =
42
+ !norequirements: -rrequirements.txt
43
+
44
+ extras = test
45
+
46
+ passenv = {[pkgenv]passenv}
47
+
48
+ setenv = {[pkgenv]setenv}
49
+ # Sage scripts such as sage-runtests like to use $HOME/.sage
50
+ HOME ={envdir}
51
+
42
52
allowlist_externals =
43
53
bash
44
54
45
55
commands =
46
- # Beware of the treacherous non-src layout. "./sage/" shadows the install sage package.
56
+ # Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package.
47
57
{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'
48
58
49
59
# Test that importing sage.categories.all initializes categories
50
60
{envpython} -c ' import sys; "" in sys.path and sys.path.remove(""); from sage.categories.all import *; SimplicialComplexes(); FunctionFields()'
51
61
52
- 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)"'
62
+ bash -c ' cd $(python -c "import sys; \"\" in sys.path and sys.path.remove(\"\" ); from sage.env import SAGE_LIB; print(SAGE_LIB)") \
63
+ && sage-runtests -p --initial --environment=sage.all__sagemath_categories --optional=sage sage/structure || echo "(lots of doctest failures are expected)"'
64
+
65
+ [testenv:.tox]
66
+ # Allow access to PyPI for auto-provisioning a suitable tox version
67
+ passenv =
68
+ setenv = PIP_NO_INDEX =false
69
+
70
+ [testenv:.pkg-sagepython]
71
+ # Environment in which to build the sdist.
72
+ # inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments
73
+ basepython = {env:SAGE_VENV}/bin/python3
74
+
75
+ [testenv:.pkg-sagepython-sagewheels-nopypi]
76
+ passenv = {[pkgenv]passenv}
77
+ SAGE_VENV
78
+ SAGE_SPKG_WHEELS
79
+
80
+ setenv = {[pkgenv]setenv}
81
+ PIP_FIND_LINKS =file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels}
82
+ PIP_NO_INDEX =true
83
+
84
+ basepython = {env:SAGE_VENV}/bin/python3
53
85
54
86
[testenv:sagepython]
55
87
basepython = {env:SAGE_VENV}/bin/python3
88
+ package_env = .pkg-sagepython
56
89
57
90
[testenv:sagepython-sagewheels-nopypi]
58
91
basepython = {env:SAGE_VENV}/bin/python3
92
+ package_env = .pkg-sagepython-sagewheels-nopypi
59
93
60
94
[testenv:sagepython-sagewheels-nopypi-norequirements]
61
95
basepython = {env:SAGE_VENV}/bin/python3
96
+ package_env = .pkg-sagepython-sagewheels-nopypi
62
97
63
98
[testenv:sagepython-sagewheels]
64
- basepython = {env:SAGE_VENV}/bin/python3
99
+ basepython = {env:SAGE_VENV}/bin/python
100
+ package_env = .pkg-sagepython
65
101
66
102
[testenv:sagepython-norequirements]
67
103
basepython = {env:SAGE_VENV}/bin/python3
104
+ package_env = .pkg-sagepython
0 commit comments