-
Notifications
You must be signed in to change notification settings - Fork 260
/
Copy pathtox.ini
210 lines (187 loc) · 4.03 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
# 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
tox-uv
envlist =
# No preinstallations
py3{9,10,11,12,13,13t}-none
# Minimum Python with minimum deps
py39-min
# Run full and pre dependencies against all archs
py3{9,10,11,12,13,13t}-{full,pre}-{x86,x64,arm64}
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
3.13t: py313t
[gh-actions:env]
DEPENDS =
none: none
pre: pre
full: full, install
min: min
ARCH =
x64: x64
x86: x86
arm64: arm64
[testenv]
description = Pytest with coverage
labels = test
pip_pre =
pre: 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
# uv needs help in this case
py313t-x86: UV_PYTHON
set_env =
pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
pre: UV_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
py313t: PYTHONGIL={env:PYTHONGIL:0}
extras =
test
# Simple, thanks Hugo and Paul
!none: dicomfs
!none: indexed_gzip
# Minimum dependencies
min: minc2
min: spm
min: viewers
min: zstd
# Matplotlib has wheels for everything except win32 (x86)
{full,pre}-{x,arm}64: viewers
# Nightly, but not released cp313t wheels for: scipy
# When released, remove the py3* line and add full to the pre line
py3{9,10,11,12,13}-full-{x,arm}64: spm
pre-{x,arm}64: spm
# No cp313t wheels for: h5py, pyzstd
py3{9,10,11,12,13}-{full,pre}-{x,arm}64: minc2
py3{9,10,11,12,13}-{full,pre}-{x,arm}64: zstd
# win32 (x86) wheels still exist for scipy+py39
py39-full-x86: spm
deps =
pre: pydicom @ git+https://github.com/pydicom/pydicom.git@main
uv_resolution =
min: lowest-direct
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 =
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