forked from nipy/nibabel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
217 lines (202 loc) · 4.73 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
# This file encodes a lot of our intended support range, as well as some
# details about dependency availability.
#
# The majority of the information is contained in tox.envlist and testenv.deps.
[tox]
requires =
tox>=4
envlist =
# No preinstallations
py3{9,10,11,12,13}-none
# Minimum Python
py39-{min,full}
# x86 support range
py3{9,10,11}-{full,pre}-{x86,x64}
py3{9,10,11}-pre-{x86,x64}
# x64-only range
py3{12,13}-{full,pre}-x64
# Special environment for numpy 2.0-dev testing
py313-dev-x64
install
doctest
style
typecheck
skip_missing_interpreters = true
# Configuration that allows us to split tests across GitHub runners effectively
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
[gh-actions:env]
DEPENDS =
none: none, install
pre: pre
dev: dev
full: full, install
min: min
ARCH =
x64: x64
x86: x86
arm64: arm64
[testenv]
description = Pytest with coverage
labels = test
install_command =
python -I -m pip install -v \
dev: --only-binary numpy,scipy,h5py \
!dev: --only-binary numpy,scipy,h5py,pillow,matplotlib \
pre,dev: --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
{opts} {packages}
pip_pre =
pre,dev: true
pass_env =
# getpass.getuser() sources for Windows:
LOGNAME
USER
LNAME
USERNAME
# Environment variables we check for
NIPY_EXTRA_TESTS
# Pass user color preferences through
PY_COLORS
FORCE_COLOR
NO_COLOR
CLICOLOR
CLICOLOR_FORCE
set_env =
py313: PYTHON_GIL=0
extras = test
deps =
# General minimum dependencies: pin based on API usage
# matplotlib 3.5 requires packaging 20
min: packaging ==20
min: importlib_resources ==5.12; python_version < '3.12'
min: typing_extensions ==4.6; python_version < '3.13'
# NEP29/SPEC0 + 1yr: Test on minor release series within the last 3 years
# We're extending this to all optional dependencies
# This only affects the range that we test on; numpy is the only non-optional
# dependency, and will be the only one to affect pip environment resolution.
min: numpy ==1.22
min: h5py ==3.5
min: indexed_gzip ==1.6
min: matplotlib ==3.5
min: pillow ==8.4
min: pydicom ==2.3
min: pyzstd ==0.15.2
min: scipy ==1.8
# Numpy 2.0 is a major breaking release; we cannot put much effort into
# supporting until it's at least RC stable
dev: numpy >=2.1.dev0
# Scipy stopped producing win32 wheels at py310
py39-full-x86,x64,arm64: scipy >=1.8
# Matplotlib depends on scipy, so cannot be built for py310 on x86
py39-full-x86,x64,arm64: matplotlib >=3.5
# h5py stopped producing win32 wheels at py39
{full,pre}-{x64,arm64}: h5py >=3.5
full,pre,dev: pillow >=8.4
full,pre: indexed_gzip >=1.6
full,pre,dev: pyzstd >=0.15.2
full,pre: pydicom >=2.3
dev: pydicom @ git+https://github.com/pydicom/pydicom.git@main
commands =
pytest --doctest-modules --doctest-plus \
--cov nibabel --cov-report xml:cov.xml \
--junitxml test-results.xml \
--durations=20 --durations-min=1.0 \
--pyargs nibabel {posargs:-n auto}
[testenv:install]
description = Install and verify import succeeds
labels = test
deps =
extras =
install_command = python -I -m pip install {opts} {packages}
commands =
python -c "import nibabel; print(nibabel.__version__)"
[testenv:docs]
description = Build documentation site
labels = docs
allowlist_externals = make
extras = doc
commands =
make -C doc html
[testenv:doctest]
description = Run doctests in documentation site
labels = docs
allowlist_externals = make
extras =
doc
test
commands =
make -C doc doctest
[testenv:style]
description = Check our style guide
labels = check
deps =
ruff>=0.3.0
skip_install = true
commands =
ruff check --diff nibabel
ruff format --diff nibabel
[testenv:style-fix]
description = Auto-apply style guide to the extent possible
labels = pre-release
deps =
ruff
skip_install = true
commands =
ruff check --fix nibabel
ruff format nibabel
[testenv:spellcheck]
description = Check spelling
labels = check
deps =
codespell[toml]
skip_install = true
commands =
codespell . {posargs}
[testenv:typecheck]
description = Check type consistency
labels = check
deps =
mypy
pytest
types-setuptools
types-Pillow
pydicom
numpy
pyzstd
importlib_resources
typing_extensions
skip_install = true
commands =
mypy nibabel
[testenv:build{,-strict}]
labels =
check
pre-release
deps =
build
twine
skip_install = true
set_env =
build-strict: PYTHONWARNINGS=error
commands =
python -m build
python -m twine check dist/*
[testenv:publish]
depends = build
labels = release
deps =
twine
skip_install = true
commands =
python -m twine upload dist/*
[testenv:zenodo]
deps = gitpython
labels = pre-release
skip_install = true
commands =
python tools/prep_zenodo.py