Skip to content

Commit 53b09e2

Browse files
committed
chore(tox): Copy and adapt niworkflows tox.ini
1 parent a1375fd commit 53b09e2

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed

tox.ini

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
[tox]
2+
requires =
3+
tox>=4
4+
tox-uv
5+
envlist =
6+
py3{10,11,12,13}-latest
7+
py310-min
8+
py3{11,12,13}-pre
9+
skip_missing_interpreters = true
10+
11+
# Configuration that allows us to split tests across GitHub runners effectively
12+
[gh-actions]
13+
python =
14+
3.10: py310
15+
3.11: py311
16+
3.12: py312
17+
3.13: py313
18+
19+
[gh-actions:env]
20+
DEPENDS =
21+
min: min
22+
latest: latest
23+
pre: pre
24+
25+
[testenv]
26+
description = Pytest with coverage
27+
labels = test
28+
pip_pre =
29+
pre: true
30+
pass_env =
31+
TEMPLATEFLOW_HOME
32+
NO_ET
33+
# Freesurfer variables searched for
34+
FREESURFER_HOME
35+
SUBJECTS_DIR
36+
FS_LICENSE
37+
# CI variables
38+
TEST_DATA_HOME
39+
TEST_OUTPUT_DIR
40+
TEST_WORK_DIR
41+
FMRIPREP_REGRESSION_SOURCE
42+
CACHED_WORK_DIRECTORY
43+
# CircleCI-specific
44+
CIRCLE_NPROCS
45+
SAVE_CIRCLE_ARTIFACTS
46+
# getpass.getuser() sources for Windows:
47+
LOGNAME
48+
USER
49+
LNAME
50+
USERNAME
51+
# Pass user color preferences through
52+
PY_COLORS
53+
FORCE_COLOR
54+
NO_COLOR
55+
CLICOLOR
56+
CLICOLOR_FORCE
57+
PYTHON_GIL
58+
deps =
59+
py313: traits @ git+https://github.com/enthought/traits.git@10954eb
60+
extras = tests
61+
setenv =
62+
pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
63+
pre: UV_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
64+
uv_resolution =
65+
min: lowest-direct
66+
67+
commands =
68+
pytest --durations=20 --durations-min=1.0 --cov-report term-missing {posargs:-n auto}
69+
70+
[testenv:style]
71+
description = Check our style guide
72+
labels = check
73+
deps =
74+
ruff
75+
skip_install = true
76+
commands =
77+
ruff check --diff
78+
ruff format --diff
79+
80+
[testenv:style-fix]
81+
description = Auto-apply style guide to the extent possible
82+
labels = pre-release
83+
deps =
84+
ruff
85+
skip_install = true
86+
commands =
87+
ruff check --fix
88+
ruff format
89+
ruff check --select ISC001
90+
91+
[testenv:spellcheck]
92+
description = Check spelling
93+
labels = check
94+
deps =
95+
codespell[toml]
96+
skip_install = true
97+
commands =
98+
codespell . {posargs}
99+
100+
[testenv:build{,-strict}]
101+
labels =
102+
check
103+
pre-release
104+
deps =
105+
build
106+
twine
107+
skip_install = true
108+
set_env =
109+
# Ignore specific known warnings:
110+
# https://github.com/pypa/pip/issues/11684
111+
# https://github.com/pypa/pip/issues/12243
112+
strict: PYTHONWARNINGS=error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:Unimplemented abstract methods {'locate_file'}:DeprecationWarning:pip._internal.metadata.importlib._dists
113+
commands =
114+
python -m build
115+
python -m twine check dist/*
116+
117+
[testenv:publish]
118+
depends = build
119+
labels = release
120+
deps =
121+
twine
122+
skip_install = true
123+
commands =
124+
python -m twine upload dist/*

0 commit comments

Comments
 (0)