Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intersphinx_registry and toml-sort #1314

Merged
merged 9 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ repos:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
files: pyproject.toml
25 changes: 14 additions & 11 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import sys
from datetime import date

from intersphinx_registry import get_intersphinx_mapping
from sphinx.config import is_serializable

import mne_bids
Expand Down Expand Up @@ -162,17 +163,19 @@
html_sidebars = {}

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"mne": ("https://mne.tools/dev", None),
"mne-gui-addons": ("https://mne.tools/mne-gui-addons", None),
"numpy": ("https://numpy.org/devdocs", None),
"scipy": ("https://scipy.github.io/devdocs", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"nilearn": ("http://nilearn.github.io/stable", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/dev", None),
"nibabel": ("https://nipy.org/nibabel", None),
}
intersphinx_mapping = get_intersphinx_mapping(
packages={
"matplotlib",
"mne",
"nibabel",
"nilearn",
"numpy",
"pandas",
"python",
"scipy",
}
)
intersphinx_mapping["mne-gui-addons"] = ("https://mne.tools/mne-gui-addons", None)
intersphinx_timeout = 5

sphinx_gallery_conf = {
Expand Down
237 changes: 119 additions & 118 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,155 +1,156 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
requires = ["hatch-vcs", "hatchling"]

[project]
name = "mne-bids"
authors = [{name = "The MNE-BIDS developers"}]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
]
dependencies = ["mne>=1.6", "numpy>=1.21.2", "scipy>=1.7.1"]
description = "MNE-BIDS: Organizing MEG, EEG, and iEEG data according to the BIDS specification and facilitating their analysis with MNE-Python"
dynamic = ["version"]
authors = [{ name = "The MNE-BIDS developers" }]
maintainers = [
{ name = "Stefan Appelhoff", email = "[email protected]" },
]
license = { text = "BSD-3-Clause" }
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10"
keywords = [
"meg",
"eeg",
"ieeg",
"bids",
"brain imaging data structure",
"neuroscience",
"neuroimaging",
"bids",
"brain imaging data structure",
"eeg",
"ieeg",
"meg",
"neuroimaging",
"neuroscience",
]
classifiers = [
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
license = {text = "BSD-3-Clause"}
maintainers = [
{email = "[email protected]", name = "Stefan Appelhoff"},
]
scripts = { mne_bids = "mne_bids.commands.run:main" }
dependencies = ["mne>=1.6", "numpy>=1.21.2", "scipy>=1.7.1"]
name = "mne-bids"
readme = {content-type = "text/markdown", file = "README.md"}
requires-python = ">=3.10"
scripts = {mne_bids = "mne_bids.commands.run:main"}

[project.optional-dependencies]
# Variants with dependencies that will get installed on top of those listed unter
# project.dependencies

# Dependencies for developer installations
dev = ["mne_bids[test,doc,full]", "pre-commit"]
# Dependencies for building the documentation
doc = [
"intersphinx_registry",
"matplotlib",
"mne-nirs",
"nilearn",
"numpydoc",
"openneuro-py",
"pandas",
"pillow",
"pydata-sphinx-theme",
"seaborn",
"sphinx-copybutton",
"sphinx>=7.4.7",
"sphinx_gallery",
]
# Dependencies for using all mne_bids features
full = [
"nibabel >= 3.2.1",
"pybv >= 0.7.5",
"eeglabio >= 0.0.2",
"pymatreader >= 0.0.30",
"matplotlib >= 3.5.0",
"pandas >= 1.3.2",
"EDFlib-Python >= 1.0.6", # XXX: drop once mne <1.7 is no longer supported
"edfio >= 0.2.1",
"defusedxml", # For reading EGI MFF data and BrainVision montages
"defusedxml", # For reading EGI MFF data and BrainVision montages
"edfio >= 0.2.1",
"EDFlib-Python >= 1.0.6", # XXX: drop once mne <1.7 is no longer supported
"eeglabio >= 0.0.2",
"matplotlib >= 3.5.0",
"nibabel >= 3.2.1",
"pandas >= 1.3.2",
"pybv >= 0.7.5",
"pymatreader >= 0.0.30",
]

# Dependencies for running the test infrastructure
test = ["mne_bids[full]", "pytest >= 8", "pytest-cov", "pytest-sugar", "ruff"]

# Dependencies for building the documentation
doc = [
"nilearn",
"sphinx>=7.4.7",
"sphinx_gallery",
"sphinx-copybutton",
"pydata-sphinx-theme",
"numpydoc",
"matplotlib",
"pillow",
"pandas",
"mne-nirs",
"seaborn",
"openneuro-py",
]

# Dependencies for developer installations
dev = ["mne_bids[test,doc,full]", "pre-commit"]

[project.urls]
"Homepage" = "https://mne.tools/mne-bids"
"Download" = "https://pypi.org/project/mne-bids/#files"
"Bug Tracker" = "https://github.com/mne-tools/mne-bids/issues/"
"Documentation" = "https://mne.tools/mne-bids"
"Download" = "https://pypi.org/project/mne-bids/#files"
"Forum" = "https://mne.discourse.group/"
"Homepage" = "https://mne.tools/mne-bids"
"Source Code" = "https://github.com/mne-tools/mne-bids"

[tool.hatch.metadata]
allow-direct-references = true # allow specifying URLs in our dependencies
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = ["if 0:", "if __name__ == .__main__.:", "pragma: no cover"]

[tool.coverage.run]
omit = ["*tests*"]

[tool.hatch.build]
exclude = [
"/.*",
"**/tests",
"/paper",
"/examples",
"/doc",
"/Makefile",
"/CITATION.cff",
"/CONTRIBUTING.md",
"**/tests",
"/.*",
"/CITATION.cff",
"/CONTRIBUTING.md",
"/doc",
"/examples",
"/Makefile",
"/paper",
]

[tool.hatch.metadata]
allow-direct-references = true # allow specifying URLs in our dependencies

[tool.hatch.version]
raw-options = {version_scheme = "release-branch-semver"}
source = "vcs"
raw-options = { version_scheme = "release-branch-semver" }

[tool.pytest.ini_options]
addopts = """--durations=20 -ra --junit-xml=junit-results.xml --tb=short
--ignore=doc --ignore=examples --ignore=mne_bids/tests/data"""
filterwarnings = [
"error",
# Python 3.10+ and NumPy 1.22 (and maybe also newer NumPy versions?)
"ignore:.*distutils\\.sysconfig module is deprecated.*:DeprecationWarning",
# NumPy 2.1 bug (probably)
"ignore:__array__ implementation doesn.*:DeprecationWarning",
# numba with NumPy dev
"ignore:`np.MachAr` is deprecated.*:DeprecationWarning",
"ignore:`product` is deprecated as of NumPy.*:DeprecationWarning",
"ignore:Converting data files to BrainVision format:RuntimeWarning",
"ignore:Converting to BV for anonymization:RuntimeWarning",
"ignore:Converting to FIF for anonymization:RuntimeWarning",
"ignore:datetime\\.datetime\\.utcfromtimestamp.* is deprecated and scheduled for removal in a future version.*:DeprecationWarning",
"ignore:Did not find any coordsystem.json.*:RuntimeWarning",
"ignore:Did not find any electrodes.tsv.*:RuntimeWarning",
"ignore:Did not find any events.tsv.*:RuntimeWarning",
"ignore:Estimation of line frequency only supports.*:RuntimeWarning",
# matplotlib
"ignore:Figure.*is non-interactive.*cannot be shown:UserWarning",
"ignore:MEG ref channel RMSP did not.*:RuntimeWarning",
"ignore:No events found or provided.*:RuntimeWarning",
"ignore:numpy.ufunc size changed.*:RuntimeWarning",
"ignore:Participants file not found for.*:RuntimeWarning",
# old MNE _fake_click
"ignore:The .*_event function was deprecated in Matplotlib.*:",
"ignore:There are channels without locations (n/a)*:RuntimeWarning",
"ignore:tostring\\(\\) is deprecated.*:DeprecationWarning",
"ignore:Writing of electrodes.tsv is not supported for datatype.*:RuntimeWarning",
]

[tool.ruff.lint]
select = ["A", "D", "E", "F", "I", "UP", "W"]
ignore = ["A002"]
exclude = ["__init__.py"]
ignore = ["A002"]
select = ["A", "D", "E", "F", "I", "UP", "W"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.coverage.run]
omit = ["*tests*"]

[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = ["pragma: no cover", "if 0:", "if __name__ == .__main__.:"]

[tool.pytest.ini_options]
addopts = """--durations=20 -ra --junit-xml=junit-results.xml --tb=short
--ignore=doc --ignore=examples --ignore=mne_bids/tests/data"""
filterwarnings = [
"error",
"ignore:Estimation of line frequency only supports.*:RuntimeWarning",
"ignore:There are channels without locations (n/a)*:RuntimeWarning",
"ignore:Did not find any electrodes.tsv.*:RuntimeWarning",
"ignore:Did not find any coordsystem.json.*:RuntimeWarning",
"ignore:Did not find any events.tsv.*:RuntimeWarning",
"ignore:No events found or provided.*:RuntimeWarning",
"ignore:Participants file not found for.*:RuntimeWarning",
"ignore:Converting to FIF for anonymization:RuntimeWarning",
"ignore:Converting to BV for anonymization:RuntimeWarning",
"ignore:Converting data files to BrainVision format:RuntimeWarning",
"ignore:Writing of electrodes.tsv is not supported for datatype.*:RuntimeWarning",
"ignore:numpy.ufunc size changed.*:RuntimeWarning",
"ignore:tostring\\(\\) is deprecated.*:DeprecationWarning",
"ignore:MEG ref channel RMSP did not.*:RuntimeWarning",
"ignore:`product` is deprecated as of NumPy.*:DeprecationWarning",
# Python 3.10+ and NumPy 1.22 (and maybe also newer NumPy versions?)
"ignore:.*distutils\\.sysconfig module is deprecated.*:DeprecationWarning",
# numba with NumPy dev
"ignore:`np.MachAr` is deprecated.*:DeprecationWarning",
# old MNE _fake_click
"ignore:The .*_event function was deprecated in Matplotlib.*:",
"ignore:datetime\\.datetime\\.utcfromtimestamp.* is deprecated and scheduled for removal in a future version.*:DeprecationWarning",
# matplotlib
"ignore:Figure.*is non-interactive.*cannot be shown:UserWarning",
# NumPy 2.1 bug (probably)
"ignore:__array__ implementation doesn.*:DeprecationWarning",
]
[tool.tomlsort]
all = true
ignore_case = true
mscheltienne marked this conversation as resolved.
Show resolved Hide resolved
spaces_before_inline_comment = 2
trailing_comma_inline_array = true