Skip to content

Commit

Permalink
Use hatchling as build backend (#12269)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoechenberger committed Dec 8, 2023
1 parent 06c90a7 commit d00cbb1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 139 deletions.
86 changes: 0 additions & 86 deletions MANIFEST.in

This file was deleted.

5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ clean-cache:
clean: clean-build clean-pyc clean-so clean-ctags clean-cache

wheel:
$(PYTHON) -m build
$(PYTHON) -m build -w

sample_data:
@python -c "import mne; mne.datasets.sample.data_path(verbose=True);"
Expand Down Expand Up @@ -54,9 +54,6 @@ pep: pre-commit
codespell: # running manually
@codespell --builtin clear,rare,informal,names,usage -w -i 3 -q 3 -S $(CODESPELL_SKIPS) --ignore-words=ignore_words.txt --uri-ignore-words-list=bu $(CODESPELL_DIRS)

check-manifest:
check-manifest -q --ignore .circleci/config.yml,doc,logo,mne/io/*/tests/data*,mne/io/tests/data,mne/preprocessing/tests/data,.DS_Store,.git_archival.txt

check-readme: clean wheel
twine check dist/*

Expand Down
4 changes: 0 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ stages:
make nesting
displayName: make nesting
condition: always()
- bash: |
make check-manifest
displayName: make check-manifest
condition: always()
- bash: |
make check-readme
displayName: make check-readme
Expand Down
1 change: 1 addition & 0 deletions doc/changes/devel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Enhancements
- Inform the user about channel discrepancy between provided info, forward operator, and/or covariance matrices in :func:`mne.beamformer.make_lcmv` (:gh:`12238` by :newcontrib:`Nikolai Kapralov`)
- We added type hints for the return values of :func:`mne.read_evokeds` and :func:`mne.io.read_raw`. Development environments like VS Code or PyCharm will now provide more help when using these functions in your code. (:gh:`12250` by `Richard Höchenberger`_ and `Eric Larson`_)
- Add ``method="polyphase"`` to :meth:`mne.io.Raw.resample` and related functions to allow resampling using :func:`scipy.signal.upfirdn` (:gh:`12268` by `Eric Larson`_)
- The package build backend was switched from ``setuptools`` to ``hatchling``. This will only affect users who build and install MNE-Python from source. (:gh:`12269` by `Richard Höchenberger`_)

Bugs
~~~~
Expand Down
71 changes: 26 additions & 45 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "mne"
description = "MNE-Python project for MEG and EEG data analysis."
Expand Down Expand Up @@ -112,7 +116,6 @@ test = [
"ruff",
"numpydoc",
"codespell",
"check-manifest",
"tomli; python_version<'3.11'",
"twine",
"wheel",
Expand Down Expand Up @@ -168,52 +171,30 @@ Documentation = "https://mne.tools/"
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"

[tool.setuptools.packages.find]
where = ["."]
include = ["mne*"]
namespaces = false

[tool.setuptools_scm]
version_scheme = "release-branch-semver"

[tool.setuptools]
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.build]
exclude = [
"/.*",
"/*.yml",
"/*.yaml",
"/*.toml",
"/*.txt",
"/mne/**/tests",
"/logo",
"/doc",
"/tools",
"/tutorials",
"/examples",
"/CITATION.cff",
"/codemeta.json",
"/ignore_words.txt",
"/Makefile",
"/CONTRIBUTING.md",
]

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

[tool.codespell]
ignore-words = "ignore_words.txt"
builtin = "clear,rare,informal,names,usage"
Expand Down

0 comments on commit d00cbb1

Please sign in to comment.