Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
216 lines (192 loc) · 4.51 KB
/
Copy pathtox.ini
File metadata and controls
216 lines (192 loc) · 4.51 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
# 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{11-13}-none
py3{14-15}{,t}-none
# Minimum Python with minimum deps
py311-min
# Run full and pre dependencies against all archs
py3{11-13}-{full,pre}-{x86,x64,arm64}
py3{14-15}{,t}-{full,pre}-{x86,x64,arm64}
# Python development versions
py316{,t}-pre-{x64,arm64}
# Run multithreaded tests against free-threaded Pythons
# Note: Slow and resource intensive, best left to CI
py3{14-16}t-threaded
install
doctest
style
typecheck
skip_missing_interpreters = true
# Configuration that allows us to split tests across GitHub runners effectively
[gh-actions]
python =
3.10: py310
3.11: py311
3.12: py312
3.13: py313
3.13t: py313t
3.14: py314
3.14t: py314t
3.15: py315
3.15t: py315t
[gh-actions:env]
DEPENDS =
none: none
pre: pre
full: full
min: min
MODE =
threaded: threaded
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
set_env =
pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
pre: UV_INDEX=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
pre: UV_INDEX_STRATEGY=unsafe-best-match
py3{13-15}t: PYTHONGIL={env:PYTHONGIL:0}
extras =
test
!none: dicomfs
!none: zstd
# Minimum dependencies
min: minc2
min: spm
min: viewers
# Indexed gzip wheels are not available for 3.15 yet
py3{11-14}{,t}: indexed_gzip
# Matplotlib/scipy have wheels for everything except win32 (x86)
py3{11-15}{,t}-{full,pre}-{x,arm}64: viewers
py3{11-15}{,t}-{full,pre}-{x,arm}64: spm
# No free-threaded or 3.15 wheels for: h5py
py3{11-14}-{full,pre}-{x,arm}64: minc2
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:py3{10-15}{,t}-{full,none}-{x,arm}64]
runner = uv-venv-lock-runner
[testenv:py3{13-15}t-threaded]
description = Pytest with coverage with free threaded python
set_env =
PYTHONGIL={env:PYTHONGIL:0}
PYTEST_RUN_PARALLEL_VERBOSE=1
extras =
all
test
commands =
pytest -ra --strict-config --strict-markers --showlocals --capture=no --parallel-threads 16 nibabel
[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
dependency_groups = doc
commands =
make -C doc html
[testenv:doctest]
description = Run doctests in documentation site
labels = docs
runner = uv-venv-lock-runner
allowlist_externals = make
extras =
test
dependency_groups =
doc
commands =
make -C doc doctest
# The following checks are pinned in .pre-commit-config.yaml
# The preferred way to run these is `pre-commit run -a`, but they are left here
# for now on the off chance that someone is using these regularly.
[testenv:style{,-fix}]
description = Check our style guide
labels = check
skip_install = true
dependency_groups =
dev
commands =
pre-commit run ruff-check --all
pre-commit run ruff-format --all
[testenv:spellcheck]
description = Check spelling
labels = check
skip_install = true
dependency_groups =
dev
commands =
pre-commit run codespell --all
[testenv:typecheck]
description = Check type consistency
labels = check
runner = uv-venv-lock-runner
dependency_groups =
typecheck
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]
labels = pre-release
skip_install = true
allowlist_externals = uv
commands =
uv run tools/prep_citation_cff.py