Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sage
Path: blob/develop/pkgs/sagemath-standard/tox.ini
4081 views
1
# All tests require an installation of the non-Python components of the Sage distribution
2
# in SAGE_LOCAL.
3
#
4
# See envlist below for different environments.
5
#
6
# To build and test in the tox environment using the concrete Python dependencies specified
7
# by requirements.txt, using the wheels built and stored by the Sage distribution:
8
# (Using 'sage -sh' in combination with 'sagepython-...' tox environments
9
# ensures that we use the same Python as the one that we built the wheels
10
# for. This can also be done ensured manually by using the tox environment py38-sagewheels etc.)
11
#
12
# Afterwards, to test interactively:
13
#
14
# pkgs/sagemath-standard/.tox/ENVIRONMENT/bin/python
15
# pkgs/sagemath-standard/.tox/ENVIRONMENT/bin/sage
16
#
17
[tox]
18
envlist =
19
# Build and test without using the concrete dependencies specified by requirements.txt,
20
# using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only:
21
# Still use ONLY the wheels built and stored by the Sage distribution (no PyPI).
22
#
23
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-nopypi-norequirements)'
24
#
25
sagepython-sagewheels-nopypi-norequirements
26
#
27
# OTHER SUPPORTED ENVIRONMENTS:
28
#
29
# Build dependencies according to requirements.txt (all versions fixed).
30
# Use ONLY the wheels built and stored by the Sage distribution (no PyPI):
31
#
32
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-nopypi)'
33
#
34
# Build and test without using the concrete dependencies specified by requirements.txt,
35
# using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only:
36
# Install the distribution packages included in the SageMath monorepository only from
37
# their source trees in SAGE_ROOT/pkgs/ (not from PyPI).
38
#
39
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-constraints_pkgs-norequirements)'
40
#
41
# Build dependencies according to requirements.txt (all versions fixed).
42
# Install the distribution packages included in the SageMath monorepository only from
43
# their source trees in SAGE_ROOT/pkgs/ (not from PyPI).
44
#
45
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-constraints_pkgs)'
46
#
47
# EXPERIMENTAL ENVIRONMENTS:
48
#
49
# Build dependencies according to requirements.txt (all versions fixed).
50
# Use the wheels built and stored by the Sage distribution,
51
# and additionally allow packages from PyPI.
52
# Because all versions are fixed, we "should" end up using the prebuilt wheels.
53
#
54
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels)'
55
#
56
# Likewise, but using pipenv using Pipfile-dist (= SAGE_ROOT/Pipfile).
57
# This also fixes the concrete dependencies (at least for some packages).
58
#
59
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-pipenv-dist)'
60
#
61
# Build using the dependencies declared in pyproject.toml and setup.cfg (install-requires) only.
62
# Use the wheels built and stored by the Sage distribution,
63
# and additionally allow packages from PyPI.
64
#
65
# Because the version ranges will allow for packages to come in from PyPI (in source or wheel form),
66
# this is likely to fail because we do not have control over the configuration of these packages.
67
#
68
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-norequirements)'
69
#
70
# Likewise, but using pipenv
71
#
72
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-pipenv)'
73
#
74
75
requires =
76
# Auto-provision a modern tox.
77
# [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance
78
# Because of https://github.com/tox-dev/tox/issues/3238, need <4.14.1
79
tox>=4.2
80
tox<4.14.1
81
82
[pkgenv]
83
# Environment in which to build the sdist.
84
# https://tox.wiki/en/latest/upgrading.html#packaging-environments
85
passenv =
86
# Variables set by .homebrew-build-env
87
CPATH
88
LIBRARY_PATH
89
PKG_CONFIG_PATH
90
# Parallel build
91
SAGE_NUM_THREADS
92
SAGE_NUM_THREADS_PARALLEL
93
MAKEFLAGS
94
# SAGE_VENV only for referring to the basepython or finding the wheels
95
sagepython, sagewheels: SAGE_VENV
96
# Used as an environment variable in constraints_pkgs.txt
97
constraints_pkgs: SAGE_ROOT
98
# Location of the wheels
99
sagewheels: SAGE_SPKG_WHEELS
100
101
setenv =
102
# We supply pip options by environment variables so that they
103
# apply both to the installation of the dependencies and of the package
104
sagewheels: PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels}
105
nopypi: PIP_NO_INDEX=true
106
constraints_pkgs: PIP_CONSTRAINT={toxinidir}/constraints_pkgs.txt
107
# No build isolation for PEP 517 packages - use what is already in the environment
108
# Note that this pip env "NO" variable uses inverted logic:
109
# PIP_NO_BUILD_ISOLATION=False means don't use build isolation.
110
# See https://github.com/conda/conda-build/blob/8f1b3517fd0c816ec78b6dadf4a912b849ecd58a/conda_build/build.py#L2574
111
nobuildisolation: PIP_NO_BUILD_ISOLATION=false
112
# Do not write or use Pipfile.lock -- we cannot seem to set its location,
113
# so we cannot isolate it in the tox environment.
114
pipenv: PIPENV_SKIP_LOCK=true
115
116
[testenv]
117
deps =
118
pipenv: pipenv
119
!pipenv-!norequirements: -rrequirements.txt
120
## Needed for fpylll
121
norequirements: Cython
122
norequirements: cysignals
123
124
sitepackages =
125
sitepackages: True
126
!sitepackages: False
127
128
extras = test
129
130
passenv = {[pkgenv]passenv}
131
132
setenv = {[pkgenv]setenv}
133
# Sage scripts such as sage-runtests like to use $HOME/.sage
134
HOME={envdir}
135
136
allowlist_externals =
137
bash
138
139
# Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package.
140
# So we change to another directory when running commands.
141
change_dir = {env_tmp_dir}
142
143
commands =
144
python -c 'import sage.all; print(sage.all.__file__)'
145
146
# We check that the "sage" script invokes the correct Python.
147
sage -c 'import sys; print("sys.path =", sys.path); import sage.all; print(sage.all.__file__)'
148
149
sage -t -p --all
150
151
[testenv:.tox]
152
# Allow access to PyPI for auto-provisioning a suitable tox version
153
passenv =
154
setenv = PIP_NO_INDEX=false
155
156
[testenv:.pkg-sagepython]
157
# Environment in which to build the sdist.
158
# inherits from [pkgenv] - https://tox.wiki/en/latest/upgrading.html#packaging-environments
159
basepython = {env:SAGE_VENV}/bin/python3
160
161
[testenv:.pkg-sagepython-sagewheels-nopypi]
162
passenv = {[pkgenv]passenv}
163
SAGE_VENV
164
SAGE_SPKG_WHEELS
165
166
setenv = {[pkgenv]setenv}
167
PIP_FIND_LINKS=file://{env:SAGE_SPKG_WHEELS:{env:SAGE_VENV:{toxinidir}/../../../../venv}/var/lib/sage/wheels}
168
PIP_NO_INDEX=true
169
170
basepython = {env:SAGE_VENV}/bin/python3
171
172
[testenv:.pkg-sagepython-constraints_pkgs]
173
passenv = {[pkgenv]passenv}
174
SAGE_VENV
175
# Location of constraints_pkgs.txt
176
SAGE_ROOT
177
178
setenv = {[pkgenv]setenv}
179
PIP_CONSTRAINT={env:SAGE_ROOT}/constraints_pkgs.txt
180
181
basepython = {env:SAGE_VENV}/bin/python3
182
183
[testenv:sagepython]
184
basepython = {env:SAGE_VENV}/bin/python3
185
package_env = .pkg-sagepython
186
187
[testenv:sagepython-sagewheels-nopypi]
188
basepython = {env:SAGE_VENV}/bin/python3
189
package_env = .pkg-sagepython-sagewheels-nopypi
190
191
[testenv:sagepython-sagewheels]
192
basepython = {env:SAGE_VENV}/bin/python3
193
package_env = .pkg-sagepython
194
195
[testenv:sagepython-sagewheels-pipenv-dist]
196
basepython = {env:SAGE_VENV}/bin/python3
197
package_env = .pkg-sagepython
198
199
[testenv:sagepython-sagewheels-norequirements]
200
basepython = {env:SAGE_VENV}/bin/python3
201
package_env = .pkg-sagepython
202
203
[testenv:sagepython-sagewheels-pipenv]
204
basepython = {env:SAGE_VENV}/bin/python3
205
package_env = .pkg-sagepython
206
207
[testenv:sagepython-constraints_pkgs]
208
basepython = {env:SAGE_VENV}/bin/python3
209
package_env = .pkg-sagepython-constraints_pkgs
210
211
[testenv:sagepython-constraints_pkgs-norequirements]
212
basepython = {env:SAGE_VENV}/bin/python3
213
package_env = .pkg-sagepython-constraints_pkgs
214
215
216
[testenv:sagepython-sagewheels-nopypi-norequirements]
217
basepython = {env:SAGE_VENV}/bin/python3
218
package_env = .pkg-sagepython-sagewheels-nopypi
219
220