forked from pex-tool/pex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
230 lines (212 loc) · 6.67 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[tox]
isolated_build = true
skip_missing_interpreters = True
minversion = 3.25.1
requires =
# Ensure tox and virtualenv compatible back through Python 2.7.
tox<4
virtualenv<20.16
[tox:.package]
# N.B.: tox will use the same python version as under what tox is installed to package, so unless
# this is python 3 you can require a given python version for the packaging environment via the
# basepython key. We need this for flit which only runs under python3 but works for python2
# projects.
basepython = python3
[testenv]
# N.B.: We need modern setuptools downloaded out of band by virtualenv to work with the Python 3.12
# case. Trying to upgrade via Pip is too late and Pip blows up.
download = true
commands =
python testing/bin/run_tests.py {posargs:-vvs}
deps =
ansicolors==1.1.8
coloredlogs==15.0.1
# The more-itertools project is an indirect requirement of pytest and its broken for
# Python < 3.6 in newer releases so we force low here.
more-itertools<=8.10.0; python_version < "3.6"
pytest==4.6.11; python_version < "3.6"
pytest==6.2.5; python_version == "3.6"
pytest==7.4.0; python_version >= "3.7"
py{27,py27}: mock==3.0.5
subprocess: subprocess32
passenv =
# This allows working around broken xcode Python SDKs.
ARCHFLAGS
# This allows re-locating the various test caches for CI.
_PEX_TEST_DEV_ROOT
# These are to support directing test environments to the correct headers on OSX.
CPATH
CPPFLAGS
LDFLAGS
PEX_VERBOSE
# Windows needs these.
PATHEXT
USER
USERNAME
# Needed for tests of git+ssh://...
SSH_AUTH_SOCK
setenv =
pip20: _PEX_PIP_VERSION=20.3.4-patched
pip22_2: _PEX_PIP_VERSION=22.2.2
pip22_3: _PEX_PIP_VERSION=22.3
pip22_3_1: _PEX_PIP_VERSION=22.3.1
pip23_0: _PEX_PIP_VERSION=23.0
pip23_0_1: _PEX_PIP_VERSION=23.0.1
pip23_1: _PEX_PIP_VERSION=23.1
pip23_1_1: _PEX_PIP_VERSION=23.1.1
pip23_1_2: _PEX_PIP_VERSION=23.1.2
pip23_2: _PEX_PIP_VERSION=23.2
# Python 3 (until a fix here in 3.9: https://bugs.python.org/issue13601) switched from stderr
# being unbuffered to stderr being buffered by default. This can lead to tests checking stderr
# failing to see what they expect if the stderr buffer block has not been flushed. Force stderr
# line buffering (which is what setting PYTHONUNBUFFERED nets you) so that tests can rely on
# stderr lines being observable.
py{py35,py36,py37,py38,py39,35,36,37,38}: PYTHONUNBUFFERED=1
whitelist_externals =
open
bash
git
[testenv:py{py27-subprocess,py27,py35,py36,py37,py38,py39,py310,27,35,36,37,38,39,310,311,312}-{,pip20-,pip22_2-,pip22_3-,pip22_3_1-,pip23_0-,pip23_0_1-,pip23_1-,pip23_1_1-,pip23_1_2-,pip23_2-}integration]
deps =
pytest-xdist==1.34.0
{[testenv]deps}
commands =
python testing/bin/run_tests.py --it {posargs:-vvs}
[testenv:format-run]
skip_install = true
deps =
black==21.12b0
# The 8.1.0 release of click breaks black; so we pin.
click==8.0.1
isort==5.10.1
commands =
python scripts/format.py
[testenv:format-check]
skip_install = true
deps =
{[testenv:format-run]deps}
commands =
python scripts/format.py --check
[testenv:typecheck]
deps =
# This version should track the version in pex/vendor/__init__.py.
attrs @ git+https://github.com/python-attrs/attrs@947bfb542104209a587280701d8cb389c813459d
packaging==20.9 # This version should track the lowest version in pex/vendor/__init__.py.
toml==0.10.2 # This version should track the version in pex/vendor/__init__.py.
pip==20.3.4 # This version should track the version in pex/vendor/__init__.py.
setuptools==44.0.0 # This version should track the version in pex/vendor/__init__.py.
mypy[python2]==0.931
typing-extensions
types-mock
types-PyYAML
types-toml==0.10.5
httpx==0.23.0
commands =
python scripts/typecheck.py
[testenv:vendor]
# The vendored dist may contain references to the python version it was built on
# (e.g., pex/vendor/_vendored/pip/pip-20.0.dev0.dist-info/entry_points.txt).
# So this test restricts the python version, to prevent spurious diffs that will cause it to fail.
basepython = python3.8
skip_install = true
deps =
ansicolors==1.1.8
pip==20.2.4
redbaron==0.9.2
setuptools==50.3.2
wheel==0.35.1
{[testenv:format-run]deps}
commands =
python -m pex.vendor {posargs}
{[testenv:format-run]commands}
[testenv:vendor-check]
basepython = {[testenv:vendor]basepython}
skip_install = true
deps =
tox
httpx==0.23.0
commands =
tox -e vendor -- --no-update
python scripts/embed_virtualenv.py
git diff --exit-code
[testenv:docs]
changedir = docs
deps =
sphinx
sphinx-rtd-theme
commands =
sphinx-build -b html -d {envtmpdir}/doctrees . _build/html
open _build/html/index.html
[_flit]
basepython = python3
deps =
flit
# This is only here to pin the transitive dependency low to work around
# https://github.com/pypa/flit/issues/530
flit_core<3.7.0
pygments
[_package]
basepython = {[_flit]basepython}
deps =
{[_flit]deps}
toml
[testenv:package]
skip_install = true
basepython = {[_package]basepython}
deps =
{[_package]deps}
commands =
python scripts/package.py {posargs}
[testenv:serve]
skip_install = true
basepython = {[_package]basepython}
deps =
{[_package]deps}
commands =
python scripts/package.py --additional-format wheel --local --serve {posargs}
[testenv:pip]
description = Run Pex's vendored pip.
skip_install = true
setenv =
__PEX_UNVENDORED__ = 1
PYTHONPATH = {env:PYTHONPATH:}{:}{toxinidir}/pex/vendor/_vendored/pip
SETUPTOOLS_USE_DISTUTILS = stdlib
commands =
python -s -mpip {posargs}
[testenv:setuptools]
description = Run Python with Pex's vendored setuptools on the sys.path.
skip_install = true
setenv =
__PEX_UNVENDORED__ = 1
PYTHONPATH = {env:PYTHONPATH:}{:}{toxinidir}/pex/vendor/_vendored/setuptools
SETUPTOOLS_USE_DISTUTILS = stdlib
commands =
python {posargs}
[testenv:wheel]
description = Run Pex's vendored wheel
skip_install = true
setenv =
PYTHONPATH = {env:PYTHONPATH:}{:}{toxinidir}/pex/vendor/_vendored/wheel
commands =
python -s -mwheel {posargs}
[testenv:devpi-lock]
description = Re-create the devpi-server lock.
skip_install = true
commands =
python -mpex.cli lock create \
--style universal \
--pip-version latest \
--resolver-version pip-2020-resolver \
--interpreter-constraint >=3.8,<3.13 \
devpi-server \
--indent 2 \
-o testing/devpi-server.lock
[testenv:build-cache-image]
description = Build the CI cache data image.
skip_install = true
basepython = python3
deps =
coloredlogs==15.0.1
PyYAML==6.0.1
commands =
python scripts/build_cache_image.py {posargs}