forked from akrieger/pex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
248 lines (225 loc) · 7.42 KB
/
tox.ini
File metadata and controls
248 lines (225 loc) · 7.42 KB
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
[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
[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
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"
pexpect==4.9.0
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
# This allows increasing pexpect read timeouts in CI.
_PEX_PEXPECT_TIMEOUT
# This allows experimenting with Requires-Python metadata adjustment.
_PEX_REQUIRES_PYTHON
# 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
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
# This Pip and custom Requires-Python are just here to support un-released Python 3.13 testing.
pip24_0_patched: _PEX_PIP_VERSION=24.0.dev0-patched
pip24_0_patched: _PEX_REQUIRES_PYTHON=>=2.7,<3.14,!=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:py{py27-subprocess,py27,py35,py36,py37,py38,py39,py310,27,35,36,37,38,39,310,311,312,313}-{,pip20-,pip22_2-,pip22_3-,pip22_3_1-,pip23_0-,pip23_0_1-,pip23_1-,pip23_1_1-,pip23_1_2-,pip23_2-,pip23_3_1-,pip23_3_2-,pip24_0-,pip24_0_patched-}integration]
deps =
pytest-xdist==1.34.0
{[testenv]deps}
commands =
python testing/bin/run_tests.py --it {posargs:-vvs}
[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 =
# This version should track the version in pex/vendor/__init__.py.
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
toml==0.10.2 # This version should track the version in pex/vendor/__init__.py.
# 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-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.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]
basepython = python3
deps =
-r docs-requirements.txt
commands =
python scripts/build_docs.py {posargs}
[_package]
basepython = python3
deps =
build
[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: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}