Skip to content

Commit

Permalink
Switch build backend to hatchling
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger committed Nov 4, 2023
1 parent ec87fd8 commit 067d71b
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
which python
which pip
pip install --upgrade pip setuptools wheel
pip install --upgrade --only-binary "numpy,scipy,dipy,statsmodels" -ve . -r requirements.txt -r requirements_testing.txt -r requirements_testing_extra.txt PyQt6
pip install --upgrade --only-binary "numpy,scipy,dipy,statsmodels" -ve .[full] -r requirements_testing.txt -r requirements_testing_extra.txt PyQt6
# 3D too slow on Apple's software renderer, and numba causes us problems
pip uninstall -y vtk pyvista pyvistaqt numba
mkdir -p test-results
Expand Down
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
92 changes: 0 additions & 92 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ stages:
- bash: |
set -eo pipefail
python -m pip install --progress-bar off --upgrade pip setuptools wheel
python -m pip install --progress-bar off -r requirements_base.txt -r requirements_hdf5.txt -r requirements_testing.txt
python -m pip install --progress-bar off .[hdf5] -r requirements_testing.txt
python -m pip uninstall -yq pytest-qt # don't want to set up display, etc. for this
pre-commit install --install-hooks
displayName: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion doc/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ be reflected the next time you open a Python interpreter and ``import mne``
Finally, we'll add a few dependencies that are not needed for running
MNE-Python, but are needed for locally running our test suite::

$ pip install -r requirements_testing.txt
$ pip install -r requirements_testing.txt -r requirements_testing_extra.txt

And for building our documentation::

Expand Down
156 changes: 108 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[project]
name = "mne"
description = "MNE-Python project for MEG and EEG data analysis."
maintainers = [
authors = [
{ name = "Alexandre Gramfort", email = "[email protected]" },
]
maintainers = [{ name = "Dan McCloy", email = "[email protected]" }]
dynamic = ["version"]
license = { text = "BSD-3-Clause" }
readme = { file = "README.rst", content-type = "text/x-rst" }
Expand All @@ -30,9 +31,70 @@ classifiers = [
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
]
scripts = { mne = "mne.commands.utils:main" }
dependencies = [
"numpy>=1.21.2",
"scipy>=1.7.1",
"matplotlib>=3.5.0",
"tqdm",
"pooch>=1.5",
"decorator",
"packaging",
"jinja2",
"importlib_resources>=5.10.2; python_version<'3.9'",
"lazy_loader>=0.3",
"defusedxml",
]

[project.optional-dependencies]
# requirements for full MNE-Python functionality (other than raw/epochs export)
full = [
"h5io",
"pymatreader",
"qtpy",
"PyQt6",
"pyobjc-framework-Cocoa>=5.2.0; platform_system=='Darwin'",
"sip",
"scikit-learn",
"nibabel",
"openmeeg>=2.5.5",
"numba",
"h5py",
"pandas",
"numexpr",
"jupyter",
"python-picard",
"statsmodels",
"joblib",
"psutil",
"dipy",
"vtk",
"nilearn",
"xlrd",
"imageio>=2.6.1",
"imageio-ffmpeg>=0.4.1",
"traitlets",
"pyvista>=0.32,!=0.35.2,!=0.38.0,!=0.38.1,!=0.38.2,!=0.38.3,!=0.38.4,!=0.38.5,!=0.38.6,!=0.42.0",
"pyvistaqt>=0.4",
"mffpy>=0.5.7",
"ipywidgets",
"ipympl",
"ipyevents",
"trame",
"trame-vtk",
"trame-vuetify",
"mne-qt-browser",
"darkdetect",
"qdarkstyle",
"threadpoolctl",
]

# data is empty, but let's leave it here so that we don't break people's workflows who
# did `pip install mne[data]`
data = [] # here for backward-compat

[project.scripts]
mne = "mne.commands.utils:main"
# requirements for MNE-Python functions that use HDF5 I/O
hdf5 = ["h5io", "pymatreader"]

[project.urls]
Homepage = "https://mne.tools/"
Expand All @@ -43,47 +105,14 @@ Forum = "https://mne.discourse.group/"
"Source Code" = "https://github.com/mne-tools/mne-python/"

[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.setuptools_scm]
write_to = "mne/_version.py"
version_scheme = "release-branch-semver"

[options]
zip_safe = false # the package can run out of an .egg file
include_package_data = true

[tool.setuptools.package-data]
"mne" = [
"data/eegbci_checksums.txt",
"data/*.sel",
"data/icos.fif.gz",
"data/coil_def*.dat",
"data/helmets/*.fif.gz",
"data/FreeSurferColorLUT.txt",
"data/image/*gif",
"data/image/*lout",
"data/fsaverage/*.fif",
"channels/data/layouts/*.lout",
"channels/data/layouts/*.lay",
"channels/data/montages/*.sfp",
"channels/data/montages/*.txt",
"channels/data/montages/*.elc",
"channels/data/neighbors/*.mat",
"datasets/sleep_physionet/SHA1SUMS",
"datasets/_fsaverage/*.txt",
"datasets/_infant/*.txt",
"datasets/_phantom/*.txt",
"html/*.js",
"html/*.css",
"html_templates/repr/*.jinja",
"html_templates/report/*.jinja",
"icons/*.svg",
"icons/*.png",
"io/artemis123/resources/*.csv",
"io/edf/gdf_encodes.txt",
]
[tool.hatch]
version.source = "vcs"
version.raw-options = { version_scheme = "release-branch-semver" }
build.hooks.vcs.version-file = "mne/_version.py"
build.exclude = ["/.*", "/*.yml", "/*.yaml", "/*.toml", "/*.txt"]

[tool.codespell]
ignore-words = "ignore_words.txt"
Expand Down Expand Up @@ -144,13 +173,44 @@ skips = ["*/test_*.py"] # assert statements are good practice with pytest
[tool.rstcheck]
report_level = "WARNING"
ignore_roles = [
"func", "class", "term", "ref", "doc", "gh", "file", "samp", "meth", "mod", "kbd",
"newcontrib", "footcite", "footcite:t", "eq", "py:mod", "attr", "py:class", "exc",
"func",
"class",
"term",
"ref",
"doc",
"gh",
"file",
"samp",
"meth",
"mod",
"kbd",
"newcontrib",
"footcite",
"footcite:t",
"eq",
"py:mod",
"attr",
"py:class",
"exc",
]
ignore_directives = [
"rst-class", "tab-set", "grid", "toctree", "footbibliography", "autosummary",
"currentmodule", "automodule", "cssclass", "tabularcolumns", "minigallery",
"autoclass", "highlight", "dropdown", "graphviz", "glossary", "autofunction",
"rst-class",
"tab-set",
"grid",
"toctree",
"footbibliography",
"autosummary",
"currentmodule",
"automodule",
"cssclass",
"tabularcolumns",
"minigallery",
"autoclass",
"highlight",
"dropdown",
"graphviz",
"glossary",
"autofunction",
"bibliography",
]
ignore_messages = "^.*(Unknown target name|Undefined substitution referenced)[^`]*$"
47 changes: 0 additions & 47 deletions requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements_base.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements_hdf5.txt

This file was deleted.

Loading

0 comments on commit 067d71b

Please sign in to comment.