Skip to content

Commit 4fb5442

Browse files
hoechenbergerautofix-ci[bot]drammocklarsoner
authored
Move development dependencies into a dependency group (no more extra) (#13452)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: Eric Larson <[email protected]>
1 parent e6db33a commit 4fb5442

File tree

11 files changed

+141
-94
lines changed

11 files changed

+141
-94
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ repos:
5454
rev: v6.0.0
5555
hooks:
5656
- id: file-contents-sorter
57-
files: ^doc/changes/names.inc|^.mailmap
57+
files: ^doc/changes/names.inc|^.mailmap|^doc/sphinxext/related_software.txt
5858
args: ["--ignore-case"]
5959

6060
- repo: https://github.com/pappasam/toml-sort

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ stages:
5252
- bash: |
5353
set -eo pipefail
5454
python -m pip install --progress-bar off --upgrade pip build
55-
python -m pip install --progress-bar off -ve .[hdf5,test]
55+
python -m pip install --progress-bar off -ve .[hdf5] --group=test
5656
python -m pip uninstall -yq pytest-qt # don't want to set up display, etc. for this
5757
pre-commit install --install-hooks
5858
displayName: Install dependencies
@@ -116,7 +116,7 @@ stages:
116116
python -m pip install --progress-bar off --upgrade pip
117117
python -m pip install --progress-bar off "mne-qt-browser[opengl] @ git+https://github.com/mne-tools/mne-qt-browser.git" pyvista scikit-learn python-picard qtpy nibabel sphinx-gallery "PySide6!=6.8.0,!=6.8.0.1,!=6.8.1.1,!=6.9.1" pandas neo pymatreader antio defusedxml
118118
python -m pip uninstall -yq mne
119-
python -m pip install --progress-bar off --upgrade -e .[test]
119+
python -m pip install --progress-bar off --upgrade -e . --group=test
120120
displayName: 'Install dependencies with pip'
121121
- bash: |
122122
set -e
@@ -173,7 +173,7 @@ stages:
173173
python -m pip install --progress-bar off --upgrade pip
174174
python -m pip install --progress-bar off --upgrade --pre --only-binary=\"numpy,scipy,matplotlib,vtk\" numpy scipy matplotlib vtk
175175
python -c "import vtk"
176-
python -m pip install --progress-bar off --upgrade -ve .[full,test_extra]
176+
python -m pip install --progress-bar off --upgrade -ve .[full] --group=test_extra
177177
displayName: 'Install dependencies with pip'
178178
- bash: |
179179
set -e

doc/changes/dev/13452.other.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Removed development dependencies from user-visible "extras"; they're now dependency
2+
groups only visible to developers (and can be installed for example via
3+
``pip install --group dev`` with pip version 25.1 or later), by `Richard Höchenberger`_

doc/development/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ be reflected the next time you open a Python interpreter and ``import mne``
304304
Finally, we'll add a few dependencies that are not needed for running
305305
MNE-Python, but are needed for locally running our test suite::
306306

307-
$ pip install -e ".[test]"
307+
$ pip install --group=test
308308

309309
And for building our documentation::
310310

311-
$ pip install -e ".[doc]"
311+
$ pip install --group=doc
312312
$ conda install graphviz
313313

314314
.. note::

doc/sphinxext/related_software.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# cross-domain-saliency-maps requirements are onerous (torch and tensorflow)
2+
# so we don't add it here, and install it separately in circleci_dependencies.sh
3+
alphaCSC
4+
autoreject
5+
bycycle
6+
conpy
7+
curryreader
8+
eeg_positions
9+
emd
10+
fooof
11+
meegkit
12+
meggie
13+
mne-ari
14+
mne-bids-pipeline
15+
mne-faster
16+
mne-features
17+
mne-icalabel
18+
mne-lsl
19+
mne-microstates
20+
mne-nirs
21+
mne-rsa
22+
mnelab
23+
neurodsp
24+
neurokit2
25+
niseq
26+
nitime
27+
pactools
28+
plotly
29+
pycrostates
30+
pyprep
31+
pyriemann
32+
python-picard
33+
sesameeg
34+
sleepecg
35+
tensorpac
36+
wfdb
37+
yasa

mne/utils/tests/test_config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ def test_sys_info_complete():
132132
sys_info(fid=out, check_version=False, dependencies="developer")
133133
out = out.getvalue()
134134
pyproject = tomllib.loads(pyproject.read_text("utf-8"))
135-
deps = pyproject["project"]["optional-dependencies"]["test_extra"]
135+
deps = [
136+
dep
137+
for dep in pyproject["dependency-groups"]["test_extra"]
138+
if not isinstance(dep, dict)
139+
]
136140
for dep in deps:
137141
dep = dep.split("[")[0].split(">")[0].strip()
138142
assert f" {dep}" in out, f"Missing in dev config: {dep}"

pyproject.toml

Lines changed: 68 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,74 @@
22
build-backend = "hatchling.build"
33
requires = ["hatch-vcs", "hatchling"]
44

5+
[dependency-groups]
6+
dev = ["pip >= 25.1", "rcssmin", {include-group = "doc"}, {include-group = "test_extra"}]
7+
# Dependencies for building the documentation
8+
doc = [
9+
"graphviz",
10+
"intersphinx_registry >= 0.2405.27",
11+
"ipython != 8.7.0", # also in "full-no-qt" and "test"
12+
"memory_profiler",
13+
"mne-bids",
14+
"mne-connectivity",
15+
"mne-gui-addons",
16+
"neo",
17+
"numpydoc",
18+
"openneuro-py",
19+
"psutil",
20+
"pydata_sphinx_theme >= 0.15.2",
21+
"pygments >= 2.13",
22+
"pytest",
23+
"pyxdf",
24+
"pyzmq != 24.0.0",
25+
"seaborn != 0.11.2",
26+
"selenium >= 4.27.1",
27+
"sphinx >= 6",
28+
"sphinx-design",
29+
"sphinx-gallery >= 0.16",
30+
"sphinx_copybutton",
31+
"sphinxcontrib-bibtex >= 2.5",
32+
"sphinxcontrib-towncrier >=0.5.0a0",
33+
"sphinxcontrib-youtube",
34+
]
35+
test = [
36+
"codespell",
37+
"flaky",
38+
"ipython != 8.7.0", # for testing notebook backend; also in "full-no-qt" and "doc"
39+
"mypy",
40+
"numpydoc",
41+
"pre-commit",
42+
"pytest >= 8.0",
43+
"pytest-cov",
44+
"pytest-qt",
45+
"pytest-timeout",
46+
"ruff",
47+
"toml-sort",
48+
"tomli; python_version<'3.11'",
49+
"twine",
50+
"vulture",
51+
"wheel",
52+
]
53+
# Dependencies for being able to run additional tests (rare/CIs/advanced devs)
54+
# Changes here should be reflected in the mne/utils/config.py dev dependencies section
55+
test_extra = [
56+
"edfio >= 0.4.10",
57+
"eeglabio",
58+
"imageio >= 2.6.1",
59+
"imageio-ffmpeg >= 0.4.1",
60+
"jupyter_client",
61+
"mne-bids",
62+
"nbclient",
63+
"nbformat",
64+
"neo",
65+
"nitime",
66+
"pybv",
67+
"snirf",
68+
"sphinx-gallery",
69+
"statsmodels",
70+
{include-group = "test"},
71+
]
72+
573
[project]
674
authors = [
775
{email = "[email protected]", name = "Alexandre Gramfort"},
@@ -52,35 +120,6 @@ scripts = {mne = "mne.commands.utils:main"}
52120
[project.optional-dependencies]
53121
# Leave this one here for backward-compat
54122
data = []
55-
dev = ["mne[doc,test]", "rcssmin"]
56-
# Dependencies for building the documentation
57-
doc = [
58-
"graphviz",
59-
"intersphinx_registry >= 0.2405.27",
60-
"ipython != 8.7.0", # also in "full-no-qt" and "test"
61-
"memory_profiler",
62-
"mne-bids",
63-
"mne-connectivity",
64-
"mne-gui-addons",
65-
"neo",
66-
"numpydoc",
67-
"openneuro-py",
68-
"psutil",
69-
"pydata_sphinx_theme >= 0.15.2",
70-
"pygments >= 2.13",
71-
"pytest",
72-
"pyxdf",
73-
"pyzmq != 24.0.0",
74-
"seaborn != 0.11.2",
75-
"selenium >= 4.27.1",
76-
"sphinx >= 6",
77-
"sphinx-design",
78-
"sphinx-gallery >= 0.16",
79-
"sphinx_copybutton",
80-
"sphinxcontrib-bibtex >= 2.5",
81-
"sphinxcontrib-towncrier >= 0.5.0a0",
82-
"sphinxcontrib-youtube",
83-
]
84123
full = ["mne[full-no-qt]", "PyQt6 != 6.6.0", "PyQt6-Qt6 != 6.6.0, != 6.7.0"]
85124
# Dependencies for full MNE-Python functionality (other than raw/epochs export)
86125
# We first define a variant without any Qt bindings. The "complete" variant, mne[full],
@@ -138,44 +177,6 @@ full-pyqt6 = ["mne[full]"]
138177
full-pyside6 = ["mne[full-no-qt]", "PySide6 != 6.7.0, != 6.8.0, != 6.8.0.1, != 6.9.1"]
139178
# Dependencies for MNE-Python functions that use HDF5 I/O
140179
hdf5 = ["h5io >= 0.2.4", "pymatreader"]
141-
# Dependencies for running the test infrastructure
142-
test = [
143-
"codespell",
144-
"flaky",
145-
"ipython != 8.7.0", # for testing notebook backend; also in "full-no-qt" and "doc"
146-
"mypy",
147-
"numpydoc",
148-
"pre-commit",
149-
"pytest >= 8.0",
150-
"pytest-cov",
151-
"pytest-qt",
152-
"pytest-timeout",
153-
"ruff",
154-
"toml-sort",
155-
"tomli; python_version < '3.11'",
156-
"twine",
157-
"vulture",
158-
"wheel",
159-
]
160-
# Dependencies for being able to run additional tests (rare/CIs/advanced devs)
161-
# Changes here should be reflected in the mne/utils/config.py dev dependencies section
162-
test_extra = [
163-
"edfio >= 0.4.10",
164-
"eeglabio",
165-
"imageio >= 2.6.1",
166-
"imageio-ffmpeg >= 0.4.1",
167-
"jupyter_client",
168-
"mne-bids",
169-
"mne[test]",
170-
"nbclient",
171-
"nbformat",
172-
"neo",
173-
"nitime",
174-
"pybv",
175-
"snirf",
176-
"sphinx-gallery",
177-
"statsmodels",
178-
]
179180

180181
[project.urls]
181182
"Bug Tracker" = "https://github.com/mne-tools/mne-python/issues/"

tools/azure_dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
55
STD_ARGS="--progress-bar off --upgrade"
66
python -m pip install $STD_ARGS pip setuptools wheel
77
if [ "${TEST_MODE}" == "pip" ]; then
8-
python -m pip install $STD_ARGS --only-binary="numba,llvmlite,numpy,scipy,vtk,dipy,openmeeg" -e .[test,full]
8+
python -m pip install $STD_ARGS --only-binary="numba,llvmlite,numpy,scipy,vtk,dipy,openmeeg" -e .[full] --group=test
99
elif [ "${TEST_MODE}" == "pip-pre" ]; then
1010
${SCRIPT_DIR}/install_pre_requirements.sh
11-
python -m pip install $STD_ARGS --pre -e .[test_extra]
11+
python -m pip install $STD_ARGS --pre -e . --group=test_extra
1212
echo "##vso[task.setvariable variable=MNE_TEST_ALLOW_SKIP].*(Requires (spm|brainstorm) dataset|Requires MNE-C|CUDA not|Numba not| on Windows|MNE_FORCE_SERIAL|PySide6 causes segfaults).*"
1313
else
1414
echo "Unknown run type ${TEST_MODE}"

tools/circleci_dependencies.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#!/bin/bash -ef
22

3-
python -m pip install --upgrade "pip!=20.3.0" build
3+
python -m pip install --upgrade "pip>=25.1" build
44
python -m pip install --upgrade --progress-bar off \
5+
-ve .[full] \
6+
--group=test \
7+
--group=doc \
8+
-r doc/sphinxext/related_software.txt \
59
--only-binary "numpy,dipy,scipy,matplotlib,pandas,statsmodels" \
6-
-ve .[full,test,doc] "numpy>=2" \
7-
"git+https://github.com/pyvista/pyvista.git" \
8-
"git+https://github.com/sphinx-gallery/sphinx-gallery.git" \
910
"git+https://github.com/mne-tools/mne-bids.git" \
1011
"git+https://github.com/mne-tools/mne-qt-browser.git" \
11-
\
12-
alphaCSC autoreject bycycle conpy emd fooof meggie \
13-
mne-ari mne-bids-pipeline mne-faster mne-features \
14-
mne-icalabel mne-lsl mne-microstates mne-nirs mne-rsa \
15-
neurodsp neurokit2 niseq nitime pactools mnelab \
16-
plotly pycrostates pyprep pyriemann python-picard sesameeg \
17-
sleepecg tensorpac yasa meegkit eeg_positions wfdb \
18-
curryreader
12+
"git+https://github.com/pyvista/pyvista.git" \
13+
"git+https://github.com/sphinx-gallery/sphinx-gallery.git"
1914
python -m pip install --upgrade --progress-bar off --no-deps cross-domain-saliency-maps

tools/github_actions_dependencies.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set -eo pipefail
55
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
66
STD_ARGS="--progress-bar off --upgrade"
77
INSTALL_ARGS="-e"
8-
INSTALL_KIND="test_extra,hdf5"
98
if [ ! -z "$CONDA_ENV" ]; then
109
echo "Uninstalling MNE for CONDA_ENV=${CONDA_ENV}"
1110
# This will fail if mne-base is not in the env (like in our minimial/old envs, so ||true them):
@@ -21,19 +20,27 @@ if [ ! -z "$CONDA_ENV" ]; then
2120
STD_ARGS="$STD_ARGS https://github.com/pyvista/pyvista/archive/refs/heads/main.zip"
2221
# If on minimal or old, just install testing deps
2322
if [[ "${CONDA_ENV}" == "environment_"* ]]; then
24-
INSTALL_KIND="test"
23+
GROUP="test"
24+
EXTRAS=""
2525
STD_ARGS="--progress-bar off"
26+
else
27+
GROUP="test_extra"
28+
EXTRAS="[hdf5]"
2629
fi
2730
elif [[ "${MNE_CI_KIND}" == "pip" ]]; then
28-
INSTALL_KIND="full-pyside6,$INSTALL_KIND"
31+
GROUP="test_extra"
32+
EXTRAS="[full-pyside6]"
2933
else
3034
test "${MNE_CI_KIND}" == "pip-pre"
3135
STD_ARGS="$STD_ARGS --pre"
3236
${SCRIPT_DIR}/install_pre_requirements.sh || exit 1
33-
INSTALL_KIND="test_extra"
37+
GROUP="test_extra"
38+
EXTRAS=""
3439
fi
3540
echo ""
3641

3742
echo "::group::Installing test dependencies using pip"
38-
python -m pip install $STD_ARGS $INSTALL_ARGS .[$INSTALL_KIND]
43+
set -x
44+
python -m pip install $STD_ARGS $INSTALL_ARGS .$EXTRAS --group=$GROUP
45+
set +x
3946
echo "::endgroup::"

0 commit comments

Comments
 (0)