This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
/
tox.ini
131 lines (121 loc) · 5.26 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
# First install tox:
#
# ./sage -i tox
#
# 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' 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 =
#
# 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 python-sagewheels-nopypi)'
#
python-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)'
#
python-sagewheels-nopypi-norequirements,
#
# 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 python-sagewheels)'
#
python-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,
#
# 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.
#
python-sagewheels-norequirements,
#
# Likewise, but using pipenv
#
python-sagewheels-pipenv
[testenv]
deps =
pipenv: pipenv
!pipenv-!norequirements: -rrequirements.txt
## Needed for fpylll
norequirements: Cython
norequirements: cysignals
passenv =
# Variables set by .homebrew-build-env
CPATH
LIBRARY_PATH
PKG_CONFIG_PATH
# Parallel build
SAGE_NUM_THREADS
# SAGE_VENV only for finding the wheels
sagewheels: SAGE_VENV
# Location of the wheels (needs to include a PEP 503 compliant
# Simple Repository index, i.e., a subdirectory "simple")
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
# 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
sitepackages =
sitepackages: True
!sitepackages: False
whitelist_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)'
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__)'
# 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