Skip to content

Commit d3af3cc

Browse files
committed
chore(tox): Adapt tox from fmriprep, use uv_resolution
1 parent e18b18a commit d3af3cc

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

tox.ini

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
[tox]
2+
requires =
3+
tox>=4
4+
envlist =
5+
py3{9,10,11,12}-latest
6+
py39-min
7+
py3{10,11,12}-pre
8+
skip_missing_interpreters = true
9+
10+
# Configuration that allows us to split tests across GitHub runners effectively
11+
[gh-actions]
12+
python =
13+
3.9: py39
14+
3.10: py310
15+
3.11: py311
16+
3.12: py312
17+
18+
[gh-actions:env]
19+
DEPENDS =
20+
min: min
21+
latest: latest
22+
pre: pre
23+
24+
[testenv]
25+
description = Pytest with coverage
26+
labels = test
27+
pip_pre =
28+
pre: true
29+
pass_env =
30+
# getpass.getuser() sources for Windows:
31+
LOGNAME
32+
USER
33+
LNAME
34+
USERNAME
35+
# Pass user color preferences through
36+
PY_COLORS
37+
FORCE_COLOR
38+
NO_COLOR
39+
CLICOLOR
40+
CLICOLOR_FORCE
41+
PYTHON_GIL
42+
extras = tests
43+
setenv =
44+
pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
45+
uv_resolution =
46+
min: lowest-direct
47+
48+
commands =
49+
pytest --cov-report term-missing --pyargs niworkflows --durations=20 --durations-min=1.0 {posargs:-n auto}
50+
51+
[testenv:style]
52+
description = Check our style guide
53+
labels = check
54+
deps =
55+
ruff
56+
skip_install = true
57+
commands =
58+
ruff check --diff
59+
ruff format --diff
60+
61+
[testenv:style-fix]
62+
description = Auto-apply style guide to the extent possible
63+
labels = pre-release
64+
deps =
65+
ruff
66+
skip_install = true
67+
commands =
68+
ruff check --fix
69+
ruff format
70+
ruff check --select ISC001
71+
72+
[testenv:spellcheck]
73+
description = Check spelling
74+
labels = check
75+
deps =
76+
codespell[toml]
77+
skip_install = true
78+
commands =
79+
codespell . {posargs}
80+
81+
[testenv:build{,-strict}]
82+
labels =
83+
check
84+
pre-release
85+
deps =
86+
build
87+
twine
88+
skip_install = true
89+
set_env =
90+
# Ignore specific known warnings:
91+
# https://github.com/pypa/pip/issues/11684
92+
# https://github.com/pypa/pip/issues/12243
93+
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
94+
commands_pre =
95+
commands =
96+
python -m build
97+
python -m twine check dist/*
98+
99+
[testenv:publish]
100+
depends = build
101+
labels = release
102+
deps =
103+
twine
104+
skip_install = true
105+
commands =
106+
python -m twine upload dist/*

0 commit comments

Comments
 (0)