Skip to content

Commit 5bfb9b4

Browse files
Add intersphinx_registry and toml-sort (#1314)
* use intersphinx_registry * add 'intersphinx_registry' dependency * add toml-sort to pre-commit * apply sort to pyproject.toml * fix * add config and let pre-commit push the sort * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update pyproject.toml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 65da1ae commit 5bfb9b4

File tree

3 files changed

+139
-129
lines changed

3 files changed

+139
-129
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ repos:
3131
- id: check-added-large-files
3232
- id: check-case-conflict
3333
- id: check-docstring-first
34+
35+
- repo: https://github.com/pappasam/toml-sort
36+
rev: v0.23.1
37+
hooks:
38+
- id: toml-sort-fix
39+
files: pyproject.toml

doc/conf.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import sys
88
from datetime import date
99

10+
from intersphinx_registry import get_intersphinx_mapping
1011
from sphinx.config import is_serializable
1112

1213
import mne_bids
@@ -162,17 +163,19 @@
162163
html_sidebars = {}
163164

164165
# Example configuration for intersphinx: refer to the Python standard library.
165-
intersphinx_mapping = {
166-
"python": ("https://docs.python.org/3", None),
167-
"mne": ("https://mne.tools/dev", None),
168-
"mne-gui-addons": ("https://mne.tools/mne-gui-addons", None),
169-
"numpy": ("https://numpy.org/devdocs", None),
170-
"scipy": ("https://scipy.github.io/devdocs", None),
171-
"matplotlib": ("https://matplotlib.org/stable", None),
172-
"nilearn": ("http://nilearn.github.io/stable", None),
173-
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
174-
"nibabel": ("https://nipy.org/nibabel", None),
175-
}
166+
intersphinx_mapping = get_intersphinx_mapping(
167+
packages={
168+
"matplotlib",
169+
"mne",
170+
"nibabel",
171+
"nilearn",
172+
"numpy",
173+
"pandas",
174+
"python",
175+
"scipy",
176+
}
177+
)
178+
intersphinx_mapping["mne-gui-addons"] = ("https://mne.tools/mne-gui-addons", None)
176179
intersphinx_timeout = 5
177180

178181
sphinx_gallery_conf = {

pyproject.toml

Lines changed: 119 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,156 @@
11
[build-system]
2-
requires = ["hatchling", "hatch-vcs"]
32
build-backend = "hatchling.build"
3+
requires = ["hatch-vcs", "hatchling"]
44

55
[project]
6-
name = "mne-bids"
6+
authors = [{name = "The MNE-BIDS developers"}]
7+
classifiers = [
8+
"Intended Audience :: Developers",
9+
"Intended Audience :: Science/Research",
10+
"License :: OSI Approved",
11+
"Operating System :: MacOS",
12+
"Operating System :: Microsoft :: Windows",
13+
"Operating System :: POSIX :: Linux",
14+
"Programming Language :: Python :: 3.10",
15+
"Programming Language :: Python :: 3.11",
16+
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python",
18+
"Topic :: Scientific/Engineering",
19+
"Topic :: Scientific/Engineering",
20+
"Topic :: Software Development",
21+
]
22+
dependencies = ["mne>=1.6", "numpy>=1.21.2", "scipy>=1.7.1"]
723
description = "MNE-BIDS: Organizing MEG, EEG, and iEEG data according to the BIDS specification and facilitating their analysis with MNE-Python"
824
dynamic = ["version"]
9-
authors = [{ name = "The MNE-BIDS developers" }]
10-
maintainers = [
11-
{ name = "Stefan Appelhoff", email = "[email protected]" },
12-
]
13-
license = { text = "BSD-3-Clause" }
14-
readme = { file = "README.md", content-type = "text/markdown" }
15-
requires-python = ">=3.10"
1625
keywords = [
17-
"meg",
18-
"eeg",
19-
"ieeg",
20-
"bids",
21-
"brain imaging data structure",
22-
"neuroscience",
23-
"neuroimaging",
26+
"bids",
27+
"brain imaging data structure",
28+
"eeg",
29+
"ieeg",
30+
"meg",
31+
"neuroimaging",
32+
"neuroscience",
2433
]
25-
classifiers = [
26-
"Topic :: Scientific/Engineering",
27-
"Intended Audience :: Science/Research",
28-
"Intended Audience :: Developers",
29-
"License :: OSI Approved",
30-
"Topic :: Software Development",
31-
"Topic :: Scientific/Engineering",
32-
"Operating System :: Microsoft :: Windows",
33-
"Operating System :: POSIX :: Linux",
34-
"Operating System :: MacOS",
35-
"Programming Language :: Python",
36-
"Programming Language :: Python :: 3.10",
37-
"Programming Language :: Python :: 3.11",
38-
"Programming Language :: Python :: 3.12",
34+
license = {text = "BSD-3-Clause"}
35+
maintainers = [
36+
{email = "[email protected]", name = "Stefan Appelhoff"},
3937
]
40-
scripts = { mne_bids = "mne_bids.commands.run:main" }
41-
dependencies = ["mne>=1.6", "numpy>=1.21.2", "scipy>=1.7.1"]
38+
name = "mne-bids"
39+
readme = {content-type = "text/markdown", file = "README.md"}
40+
requires-python = ">=3.10"
41+
scripts = {mne_bids = "mne_bids.commands.run:main"}
4242

4343
[project.optional-dependencies]
44-
# Variants with dependencies that will get installed on top of those listed unter
45-
# project.dependencies
46-
44+
# Dependencies for developer installations
45+
dev = ["mne_bids[test,doc,full]", "pre-commit"]
46+
# Dependencies for building the documentation
47+
doc = [
48+
"intersphinx_registry",
49+
"matplotlib",
50+
"mne-nirs",
51+
"nilearn",
52+
"numpydoc",
53+
"openneuro-py",
54+
"pandas",
55+
"pillow",
56+
"pydata-sphinx-theme",
57+
"seaborn",
58+
"sphinx-copybutton",
59+
"sphinx>=7.4.7",
60+
"sphinx_gallery",
61+
]
4762
# Dependencies for using all mne_bids features
4863
full = [
49-
"nibabel >= 3.2.1",
50-
"pybv >= 0.7.5",
51-
"eeglabio >= 0.0.2",
52-
"pymatreader >= 0.0.30",
53-
"matplotlib >= 3.5.0",
54-
"pandas >= 1.3.2",
55-
"EDFlib-Python >= 1.0.6", # XXX: drop once mne <1.7 is no longer supported
56-
"edfio >= 0.2.1",
57-
"defusedxml", # For reading EGI MFF data and BrainVision montages
64+
"defusedxml", # For reading EGI MFF data and BrainVision montages
65+
"edfio >= 0.2.1",
66+
"EDFlib-Python >= 1.0.6", # XXX: drop once mne <1.7 is no longer supported
67+
"eeglabio >= 0.0.2",
68+
"matplotlib >= 3.5.0",
69+
"nibabel >= 3.2.1",
70+
"pandas >= 1.3.2",
71+
"pybv >= 0.7.5",
72+
"pymatreader >= 0.0.30",
5873
]
59-
6074
# Dependencies for running the test infrastructure
6175
test = ["mne_bids[full]", "pytest >= 8", "pytest-cov", "pytest-sugar", "ruff"]
6276

63-
# Dependencies for building the documentation
64-
doc = [
65-
"nilearn",
66-
"sphinx>=7.4.7",
67-
"sphinx_gallery",
68-
"sphinx-copybutton",
69-
"pydata-sphinx-theme",
70-
"numpydoc",
71-
"matplotlib",
72-
"pillow",
73-
"pandas",
74-
"mne-nirs",
75-
"seaborn",
76-
"openneuro-py",
77-
]
78-
79-
# Dependencies for developer installations
80-
dev = ["mne_bids[test,doc,full]", "pre-commit"]
81-
8277
[project.urls]
83-
"Homepage" = "https://mne.tools/mne-bids"
84-
"Download" = "https://pypi.org/project/mne-bids/#files"
8578
"Bug Tracker" = "https://github.com/mne-tools/mne-bids/issues/"
8679
"Documentation" = "https://mne.tools/mne-bids"
80+
"Download" = "https://pypi.org/project/mne-bids/#files"
8781
"Forum" = "https://mne.discourse.group/"
82+
"Homepage" = "https://mne.tools/mne-bids"
8883
"Source Code" = "https://github.com/mne-tools/mne-bids"
8984

90-
[tool.hatch.metadata]
91-
allow-direct-references = true # allow specifying URLs in our dependencies
85+
[tool.coverage.report]
86+
# Regexes for lines to exclude from consideration
87+
exclude_lines = ["if 0:", "if __name__ == .__main__.:", "pragma: no cover"]
88+
89+
[tool.coverage.run]
90+
omit = ["*tests*"]
9291

9392
[tool.hatch.build]
9493
exclude = [
95-
"/.*",
96-
"**/tests",
97-
"/paper",
98-
"/examples",
99-
"/doc",
100-
"/Makefile",
101-
"/CITATION.cff",
102-
"/CONTRIBUTING.md",
94+
"**/tests",
95+
"/.*",
96+
"/CITATION.cff",
97+
"/CONTRIBUTING.md",
98+
"/doc",
99+
"/examples",
100+
"/Makefile",
101+
"/paper",
103102
]
104103

104+
[tool.hatch.metadata]
105+
allow-direct-references = true # allow specifying URLs in our dependencies
106+
105107
[tool.hatch.version]
108+
raw-options = {version_scheme = "release-branch-semver"}
106109
source = "vcs"
107-
raw-options = { version_scheme = "release-branch-semver" }
110+
111+
[tool.pytest.ini_options]
112+
addopts = """--durations=20 -ra --junit-xml=junit-results.xml --tb=short
113+
--ignore=doc --ignore=examples --ignore=mne_bids/tests/data"""
114+
filterwarnings = [
115+
"error",
116+
# Python 3.10+ and NumPy 1.22 (and maybe also newer NumPy versions?)
117+
"ignore:.*distutils\\.sysconfig module is deprecated.*:DeprecationWarning",
118+
# NumPy 2.1 bug (probably)
119+
"ignore:__array__ implementation doesn.*:DeprecationWarning",
120+
# numba with NumPy dev
121+
"ignore:`np.MachAr` is deprecated.*:DeprecationWarning",
122+
"ignore:`product` is deprecated as of NumPy.*:DeprecationWarning",
123+
"ignore:Converting data files to BrainVision format:RuntimeWarning",
124+
"ignore:Converting to BV for anonymization:RuntimeWarning",
125+
"ignore:Converting to FIF for anonymization:RuntimeWarning",
126+
"ignore:datetime\\.datetime\\.utcfromtimestamp.* is deprecated and scheduled for removal in a future version.*:DeprecationWarning",
127+
"ignore:Did not find any coordsystem.json.*:RuntimeWarning",
128+
"ignore:Did not find any electrodes.tsv.*:RuntimeWarning",
129+
"ignore:Did not find any events.tsv.*:RuntimeWarning",
130+
"ignore:Estimation of line frequency only supports.*:RuntimeWarning",
131+
# matplotlib
132+
"ignore:Figure.*is non-interactive.*cannot be shown:UserWarning",
133+
"ignore:MEG ref channel RMSP did not.*:RuntimeWarning",
134+
"ignore:No events found or provided.*:RuntimeWarning",
135+
"ignore:numpy.ufunc size changed.*:RuntimeWarning",
136+
"ignore:Participants file not found for.*:RuntimeWarning",
137+
# old MNE _fake_click
138+
"ignore:The .*_event function was deprecated in Matplotlib.*:",
139+
"ignore:There are channels without locations (n/a)*:RuntimeWarning",
140+
"ignore:tostring\\(\\) is deprecated.*:DeprecationWarning",
141+
"ignore:Writing of electrodes.tsv is not supported for datatype.*:RuntimeWarning",
142+
]
108143

109144
[tool.ruff.lint]
110-
select = ["A", "D", "E", "F", "I", "UP", "W"]
111-
ignore = ["A002"]
112145
exclude = ["__init__.py"]
146+
ignore = ["A002"]
147+
select = ["A", "D", "E", "F", "I", "UP", "W"]
113148

114149
[tool.ruff.lint.pydocstyle]
115150
convention = "numpy"
116151

117-
[tool.coverage.run]
118-
omit = ["*tests*"]
119-
120-
[tool.coverage.report]
121-
# Regexes for lines to exclude from consideration
122-
exclude_lines = ["pragma: no cover", "if 0:", "if __name__ == .__main__.:"]
123-
124-
[tool.pytest.ini_options]
125-
addopts = """--durations=20 -ra --junit-xml=junit-results.xml --tb=short
126-
--ignore=doc --ignore=examples --ignore=mne_bids/tests/data"""
127-
filterwarnings = [
128-
"error",
129-
"ignore:Estimation of line frequency only supports.*:RuntimeWarning",
130-
"ignore:There are channels without locations (n/a)*:RuntimeWarning",
131-
"ignore:Did not find any electrodes.tsv.*:RuntimeWarning",
132-
"ignore:Did not find any coordsystem.json.*:RuntimeWarning",
133-
"ignore:Did not find any events.tsv.*:RuntimeWarning",
134-
"ignore:No events found or provided.*:RuntimeWarning",
135-
"ignore:Participants file not found for.*:RuntimeWarning",
136-
"ignore:Converting to FIF for anonymization:RuntimeWarning",
137-
"ignore:Converting to BV for anonymization:RuntimeWarning",
138-
"ignore:Converting data files to BrainVision format:RuntimeWarning",
139-
"ignore:Writing of electrodes.tsv is not supported for datatype.*:RuntimeWarning",
140-
"ignore:numpy.ufunc size changed.*:RuntimeWarning",
141-
"ignore:tostring\\(\\) is deprecated.*:DeprecationWarning",
142-
"ignore:MEG ref channel RMSP did not.*:RuntimeWarning",
143-
"ignore:`product` is deprecated as of NumPy.*:DeprecationWarning",
144-
# Python 3.10+ and NumPy 1.22 (and maybe also newer NumPy versions?)
145-
"ignore:.*distutils\\.sysconfig module is deprecated.*:DeprecationWarning",
146-
# numba with NumPy dev
147-
"ignore:`np.MachAr` is deprecated.*:DeprecationWarning",
148-
# old MNE _fake_click
149-
"ignore:The .*_event function was deprecated in Matplotlib.*:",
150-
"ignore:datetime\\.datetime\\.utcfromtimestamp.* is deprecated and scheduled for removal in a future version.*:DeprecationWarning",
151-
# matplotlib
152-
"ignore:Figure.*is non-interactive.*cannot be shown:UserWarning",
153-
# NumPy 2.1 bug (probably)
154-
"ignore:__array__ implementation doesn.*:DeprecationWarning",
155-
]
152+
[tool.tomlsort]
153+
all = true
154+
ignore_case = true
155+
spaces_before_inline_comment = 2
156+
trailing_comma_inline_array = true

0 commit comments

Comments
 (0)