forked from HypothesisWorks/hypothesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
257 lines (231 loc) · 7.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
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
[tox]
envlist = py{38,py38,39,py39,310,py310,311,312,313}-{brief,full,cover,nocover,niche,custom}
toxworkdir={env:TOX_WORK_DIR:.tox}
[testenv]
deps =
-r../requirements/test.txt
allowlist_externals =
bash
passenv=
HOME
LC_ALL
COVERAGE_FILE
TOXENV
# Allow CI builds (or user builds) to force coloured terminal output.
PY_COLORS
setenv=
PYTHONWARNDEFAULTENCODING=1
brief: HYPOTHESIS_PROFILE=speedy
commands =
full: bash scripts/basic-test.sh
brief: python -bb -X dev -m pytest -n auto tests/cover/test_testdecorators.py {posargs}
cover: python -bb -X dev -m pytest -n auto tests/cover/ tests/pytest/ tests/conjecture/test_inquisitor.py {posargs}
nocover: python -bb -X dev -m pytest -n auto tests/nocover/ {posargs}
niche: bash scripts/other-tests.sh
custom: python -bb -X dev -m pytest {posargs}
[testenv:py310-pyjion]
deps =
-r../requirements/test.txt
# We'd like to pin this, but pip-compile has to run under Python 3.10 (+)
# to do so and that's painful because other tools aren't compatible yet.
# If it's mid-2022, try again, starting by updating ci_version to 3.10
pyjion
commands =
# TODO: restore `-n auto` https://github.com/tonybaloney/Pyjion/issues/456
# TODO: re-enable in Actions main.yml once this actually works
pyjion -m pytest tests/cover tests/pytest tests/nocover
[testenv:quality]
deps=
-r../requirements/test.txt
commands=
python -bb -X dev -m pytest tests/quality/ -n auto
# This test job runs on the oldest version of CPython we support, against the minimum
# version specified in our runtime dependencies. For now, that's the oldest version
# with a wheel for non-EOL Python. In future we might deprecate faster per NEP-29.
[testenv:py38-oldestnumpy]
deps=
-r../requirements/test.txt
allowlist_externals =
bash
commands=
bash -c "pip install --only-binary=:all: numpy==$(grep 'numpy>=' setup.py | grep -oE '[0-9.]+')"
python -bb -X dev -m pytest tests/numpy/ -n auto
# This test job runs against the nightly version of `numpy`
[testenv:numpy-nightly]
deps=
-r../requirements/test.txt
pandas
black
click
allowlist_externals =
bash
commands=
bash -c "pip install --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy"
python -bb -X dev -m pytest tests/numpy/ tests/array_api/ tests/pandas/ tests/ghostwriter/ tests/conjecture/ tests/cover -n auto
# Note: when adding or removing tested Pandas versions, make sure to update the
# docs in numpy.rst too. To see current download rates of each minor version:
# https://pepy.tech/project/pandas?versions=1.1.*&versions=1.2.*&versions=1.3.*&versions=1.4.*&versions=1.5.*&versions=2.0.*&versions=2.1.*&versions=2.2.*
[testenv:py39-pandas11]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=1.1.5
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:py39-pandas12]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=1.2.5
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:pandas13]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=1.3.5
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:pandas14]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=1.4.4
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:pandas15]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=1.5.3
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:pandas20]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=2.0.3
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:pandas21]
deps =
-r../requirements/test.txt
numpy~=1.26.4
pandas~=2.1.4
setenv=
PYTHONWARNDEFAULTENCODING=1
commands =
python -bb -X dev -m pytest tests/pandas -n auto
[testenv:pandas22]
deps =
-r../requirements/test.txt
pandas~=2.2.2
# https://pandas.pydata.org/docs/whatsnew/v2.2.2.html#pandas-2-2-2-is-now-compatible-with-numpy-2-0
setenv=
PYTHONWARNDEFAULTENCODING=1
commands =
python -bb -X dev -m pytest tests/pandas -n auto
# Adding a new pandas? See comment above!
[testenv:crosshair-{cover,nocover,niche,custom}]
deps =
-r../requirements/test.txt
-e .[crosshair]
allowlist_externals =
bash
setenv=
HYPOTHESIS_PROFILE=crosshair
commands =
# invoke with `./build.sh check-crosshair-cover -- -x -Wignore`
cover: python -bb -X dev -m pytest -n auto tests/cover/ tests/pytest/ {posargs}
nocover: python -bb -X dev -m pytest -n auto tests/nocover/ {posargs}
niche: bash scripts/other-tests.sh
custom: python -bb -X dev -m pytest {posargs}
[testenv:django42]
setenv=
PYTHONWARNDEFAULTENCODING=1
commands =
pip install django~=4.2.0
python -bb -X dev -m tests.django.manage test tests.django {posargs}
[testenv:django50]
setenv=
PYTHONWARNDEFAULTENCODING=1
commands =
pip install django~=5.0.0
python -bb -X dev -m tests.django.manage test tests.django {posargs}
[testenv:py{37,38,39}-nose]
deps =
nose
commands=
nosetests tests/cover/test_testdecorators.py
[testenv:py{37,38,39}-pytest46]
deps =
-r../requirements/test.txt
commands=
pip install pytest==4.6.11 pytest-xdist==1.34
python -bb -X dev -W'ignore:the imp module:DeprecationWarning' -m pytest tests/pytest tests/cover/test_testdecorators.py
[testenv:py{37,38,39}-pytest54]
deps =
-r../requirements/test.txt
commands=
pip install pytest==5.4.3 pytest-xdist
python -bb -X dev -m pytest tests/pytest tests/cover/test_testdecorators.py
[testenv:pytest62]
deps =
-r../requirements/test.txt
setenv=
PYTHONWARNDEFAULTENCODING=
commands=
pip install pytest==6.2.5 pytest-xdist
python -bb -X dev -m pytest tests/pytest tests/cover/test_testdecorators.py
[testenv:pytest7]
deps =
-r../requirements/test.txt
commands=
pip install pytest==7.* pytest-xdist
python -bb -X dev -m pytest tests/pytest tests/cover/test_testdecorators.py
[testenv:coverage]
deps =
-r../requirements/coverage.txt
allowlist_externals =
rm
setenv=
PYTHONWARNDEFAULTENCODING=1
HYPOTHESIS_INTERNAL_COVERAGE=true
COVERAGE_PROCESS_START=.coveragerc
commands_pre =
rm -f branch-check*
pip install .[zoneinfo]
pip install coverage_enable_subprocess
commands_post =
pip uninstall -y coverage_enable_subprocess
# Produce a coverage report even if the test suite fails.
# (The tox task will still count as failed.)
ignore_errors = true
# We've had problems correctly measuring coverage using pytest-cov when running
# in parallel, so instead we start coverage implicitly on all (sub-)processes by
# way of the coverage_enable_subprocesses installation. This requires all options
# to be set in .coveragerc (including source), but that's ok as it is overridden
# by --cov=... in conjecture-coverage.
commands =
python -bb -X dev -m pytest -n auto --ff {posargs} \
tests/cover tests/conjecture tests/datetime tests/numpy tests/pandas tests/lark \
tests/redis tests/dpcontracts tests/codemods tests/typing_extensions tests/patching tests/test_annotated_types.py
python -m coverage combine
python -m coverage report
python scripts/validate_branch_check.py
[testenv:conjecture-coverage]
deps =
-r../requirements/coverage.txt
setenv=
PYTHONWARNDEFAULTENCODING=1
HYPOTHESIS_INTERNAL_COVERAGE=true
commands =
python -bb -X dev \
-m pytest -n auto tests/conjecture/ \
--cov=hypothesis.internal.conjecture --cov-config=.coveragerc
[testenv:examples3]
deps=
-r../requirements/test.txt
commands=
python -m pip install --editable examples/example_hypothesis_entrypoint
python -bb -X dev -m pytest examples