-
-
Notifications
You must be signed in to change notification settings - Fork 258
/
tox.ini
305 lines (274 loc) · 9.65 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
[tox]
# N.B.: We handle installing Pex in the envs that need it with a custom testenv install_command
# below.
skipsdist = 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
[testenv]
# N.B.: We need modern setuptools downloaded out of band by virtualenv to work with Python>=3.12.
# Trying to upgrade via Pip is too late and Pip blows up.
download = true
# N.B.: We configure tox to disable its build sdist, then install sdist in venv scheme for all envs
# with `skip_install = false` (the default). As such, we use a custom `install_command` for all
# envs that need Pex installed. The install command is tox's default, with the one addition of
# `{toxinidir}`, which adds `-e .` to the requirement list handed to Pip to install.
install_command =
# N.B.: The latest Pip supported by Python 2.7 and 3.5 can't install pyproject.toml projects in
# editable mode.
# TODO(John Sirois): Consider moving back to the setuptools.build_meta backend and using a
# minimal setup.py since hatchling is buying us less and less and getting in the way more and
# more.
py{py27,py35,27,35}: python -m pip install {opts} {toxinidir} {packages}
!py{py27,py35,27,35}: python -m pip install {opts} -e {toxinidir} {packages}
commands =
!integration: python testing/bin/run_tests.py {posargs:-vvs}
integration: python testing/bin/run_tests.py --it {posargs:-vvs}
deps =
pytest-retry==1.6.3; python_version >= "3.9"
pytest-xdist==1.34.0; python_version == "2.7"
pytest-xdist==2.2.1; python_version == "3.5"
pytest-xdist==2.5.0; python_version >= "3.6" and python_version < "3.8"
pytest-xdist==3.6.1; python_version >= "3.8"
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"
pexpect==4.9.0
psutil
pytest==4.6.11; python_version < "3.6"
pytest==6.2.5; python_version == "3.6"
pytest==7.4.4; python_version == "3.7"
pytest==8.3.3; python_version >= "3.8"
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
# This allows increasing pexpect read timeouts in CI.
_PEX_PEXPECT_TIMEOUT
# This allows experimenting with Requires-Python metadata adjustment.
_PEX_REQUIRES_PYTHON
# This allows tests to detect they are running in CI.
CI
# These are to support directing test environments to the correct headers on OSX.
CPATH
CPPFLAGS
LDFLAGS
PEX_VERBOSE
# Mac (Homebrew) needs these.
HOME
# Windows needs these.
PATHEXT
USER
USERNAME
# Needed for tests of git+ssh://...
SSH_AUTH_SOCK
# Needed for pexpect tests.
TERM
# Needed to prevent hitting rate limits on GitHub Releases APIs in `--scie` integration tests.
SCIENCE_AUTH_API_GITHUB_COM_BEARER
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
pip23_3_1: _PEX_PIP_VERSION=23.3.1
pip23_3_2: _PEX_PIP_VERSION=23.3.2
pip24_0: _PEX_PIP_VERSION=24.0
pip24_1: _PEX_PIP_VERSION=24.1
pip24_1_1: _PEX_PIP_VERSION=24.1.1
pip24_1_2: _PEX_PIP_VERSION=24.1.2
pip24_2: _PEX_PIP_VERSION=24.2
pip24_3: _PEX_PIP_VERSION=24.3
pip24_3_1: _PEX_PIP_VERSION=24.3.1
py314: _PEX_REQUIRES_PYTHON=>=2.7,<3.15,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
# 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
allowlist_externals =
bash
git
[testenv:{format-run,fmt}]
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:lint]
skip_install = true
deps =
# The last version to support pyflakes 2.4.0 (see below).
autoflake==1.7.8
# The last version to support Python 2.7 comment type hints.
pyflakes==2.4.0
commands =
python scripts/lint.py
[testenv:lint-check]
skip_install = true
deps =
{[testenv:lint]deps}
commands =
python scripts/lint.py --check
[testenv:{typecheck,check}]
deps =
# We keep this compatible with Python 2.7 for the 2.7 type check.
pytest==4.6.11
# These versions should track the version in pex/vendor/__init__.py.
ansicolors==1.1.8
appdirs==1.4.4
attrs @ git+https://github.com/python-attrs/attrs@947bfb542104209a587280701d8cb389c813459d
httpx==0.23.0
# We pin at 0.971 since this is the last version of mypy that supports `--python-version 2.7`.
mypy[python2]==0.971
packaging==20.9 # This version should track the lowest 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.
sphinx
# This is just used as a constraint - the dep is via:
# spinx 5.1.1 -> jinja2>=2.3 -> MarkupSafe>=2.0
# This works around a mypy bug handling positional-only arguments for `--python-version` >=3.8
# that was not fixed until 0.981 (we're stuck on 0.971). MarkupSafe>=3 uses positional argument
# only notation.
MarkupSafe<3
toml==0.10.2 # This version should track the version in pex/vendor/__init__.py.
PyGithub==2.4.0
# The following stubs are pinned at the last version that does not use positional-only parameter
# syntax (/) not available to `--python-version 2.7` type checks.
types-PyYAML==6.0.12.12
types-appdirs==1.4.3.5
types-docutils==0.20.0.20240310
types-mock==5.1.0.20240106
types-pexpect==4.9.0.20240207
types-setuptools==69.1.0.20240302
# 0.10.6 stubs are not compatible with Python 2.7
types-toml==0.10.5
typing-extensions
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.9
skip_install = true
deps =
ansicolors==1.1.8
pip==24.0
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]
basepython = python3
deps =
-r docs-requirements.txt
commands =
python scripts/build-docs.py {posargs}
[testenv:gen-scie-platform]
basepython = python3
skip_install = true
deps =
httpx==0.23.0
toml==0.10.2
PyGithub==2.4.0
commands =
python scripts/gen-scie-platform.py {posargs}
[_package]
basepython = python3
deps =
build
# The `pyproject-hooks` project is an indirect dep via `build` and the 1.1.0 release breaks us
# through either improved or broken isolation + backend-path integration; so we pin low.
# See: https://github.com/pypa/pyproject-hooks/pull/165
pyproject-hooks<1.1.0
toml==0.10.2
[testenv:package]
skip_install = true
basepython = {[_package]basepython}
deps =
{[_package]deps}
commands =
python scripts/create-packages.py {posargs}
[testenv:serve]
skip_install = true
basepython = {[_package]basepython}
deps =
{[_package]deps}
commands =
python scripts/create-packages.py --additional-format wheel --local --serve {posargs}
[testenv:pip]
description = Run Pex's vendored pip.
skip_install = true
setenv =
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__ = setuptools
PYTHONPATH = {env:PYTHONPATH:}{:}{toxinidir}/pex/vendor/_vendored/setuptools
SETUPTOOLS_USE_DISTUTILS = stdlib
commands =
python {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}