Skip to content

Commit e77199a

Browse files
committed
MNT: Restore doc/test extras
1 parent 366ff8e commit e77199a

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

.github/workflows/stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
run: pip install archive/nibabel-archive.tgz
9696
- run: python -c 'import nibabel; print(nibabel.__version__)'
9797
- name: Install minimum test dependencies
98-
run: pip install pytest pytest-doctestplus pytest-xdist
98+
run: pip install nibabel[test]
9999
- name: Run tests
100100
run: pytest --doctest-modules --doctest-plus -v --pyargs nibabel -n auto
101101

pyproject.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,26 @@ dicomfs = ["nibabel[dicom]", "pillow"]
5656
minc2 = ["h5py"]
5757
spm = ["scipy"]
5858
zstd = ["pyzstd >= 0.14.3"]
59-
# Dev dependencies: Move to tox, keep aliases to avoid breaking workflows
59+
# For doc and test, make easy to use outside of tox
60+
# tox should use these with extras instead of duplicating
61+
doc = [
62+
"sphinx",
63+
"matplotlib>=1.5.3",
64+
"numpydoc",
65+
"texext",
66+
"tomli; python_version < '3.11'",
67+
]
68+
test = [
69+
"pytest",
70+
"pytest-doctestplus",
71+
"pytest-cov",
72+
"pytest-httpserver",
73+
"pytest-xdist",
74+
]
75+
# Remaining: Simpler to centralize in tox
6076
dev = ["tox"]
61-
doc = ["tox"]
6277
doctest = ["tox"]
6378
style = ["tox"]
64-
test = ["tox"]
6579
typing = ["tox"]
6680

6781
[tool.hatch.build.targets.sdist]

tox.ini

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ pass_env =
5050
USER
5151
LNAME
5252
USERNAME
53+
extras = test
5354
deps =
54-
pytest
55-
pytest-doctestplus
56-
pytest-cov
57-
pytest-httpserver
58-
pytest-xdist
5955
# NEP29/SPEC0 + 1yr: Test on minor release series within the last 3 years
6056
# We're extending this to all optional dependencies
6157
# This only affects the range that we test on; numpy is the only non-optional
@@ -98,6 +94,7 @@ commands =
9894
description = "Install and verify imports succeed"
9995
labels = test
10096
deps =
97+
extras =
10198
install_command = python -I -m pip install {opts} {packages}
10299
commands =
103100
python -c "import nibabel; print(nibabel.__version__)"
@@ -106,27 +103,17 @@ commands =
106103
description = Typical pytest invocation with coverage
107104
labels = docs
108105
allowlist_externals = make
109-
deps =
110-
sphinx
111-
matplotlib>=1.5.3
112-
numpydoc
113-
texext
114-
tomli; python_version < "3.11"
106+
extras = doc
115107
commands =
116108
make -C doc html
117109

118110
[testenv:doctest]
119111
description = Typical pytest invocation with coverage
120112
labels = docs
121113
allowlist_externals = make
122-
depends = docs
123-
deps =
124-
sphinx
125-
pytest
126-
matplotlib>=1.5.3
127-
numpydoc
128-
texext
129-
tomli; python_version < "3.11"
114+
extras =
115+
doc
116+
test
130117
commands =
131118
make -C doc doctest
132119

0 commit comments

Comments
 (0)