-
-
Notifications
You must be signed in to change notification settings - Fork 404
/
tox.ini
183 lines (157 loc) · 7.13 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# All tests require an installation of the non-Python components of the Sage distribution
# in SAGE_LOCAL.
#
# See envlist below for different environments.
#
# 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' 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:
#
# pkgs/sagemath-standard/.tox/ENVIRONMENT/bin/python
# pkgs/sagemath-standard/.tox/ENVIRONMENT/bin/sage
#
[tox]
envlist =
# 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 sagepython-sagewheels-nopypi-norequirements)'
#
sagepython-sagewheels-nopypi-norequirements
#
# OTHER SUPPORTED ENVIRONMENTS:
#
# 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 sagepython-sagewheels-nopypi)'
#
# EXPERIMENTAL ENVIRONMENTS:
#
# Build dependencies according to requirements.txt (all versions fixed).
# Use the wheels built and stored by the Sage distribution,
# 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 sagepython-sagewheels)'
#
# Likewise, but using pipenv using Pipfile-dist (= SAGE_ROOT/Pipfile).
# This also fixes the concrete dependencies (at least for some packages).
#
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e 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,
# and additionally allow packages from PyPI.
#
# 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.
#
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-norequirements)'
#
# Likewise, but using pipenv
#
# ./sage -sh -c '(cd pkgs/sagemath-standard && tox -v -v -v -e sagepython-sagewheels-pipenv)'
#
requires =
# Auto-provision a modern tox.
# [pkgenv] added in 4.2 - https://tox.wiki/en/latest/upgrading.html#packaging-configuration-and-inheritance
# Because of https://github.com/tox-dev/tox/issues/3238, need <4.14.1
tox>=4.2
tox<4.14.1
[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
MAKEFLAGS
# 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 =
# 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
# No build isolation for PEP 517 packages - use what is already in the environment
# Note that this pip env "NO" variable uses inverted logic:
# PIP_NO_BUILD_ISOLATION=False means don't use build isolation.
# See https://github.com/conda/conda-build/blob/8f1b3517fd0c816ec78b6dadf4a912b849ecd58a/conda_build/build.py#L2574
nobuildisolation: PIP_NO_BUILD_ISOLATION=false
# Do not write or use Pipfile.lock -- we cannot seem to set its location,
# 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
# 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 =
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]
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
[testenv:sagepython-sagewheels-nopypi-norequirements]
basepython = {env:SAGE_VENV}/bin/python3
package_env = .pkg-sagepython-sagewheels-nopypi