-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Use hatch and automated releases (#566)
- Loading branch information
Showing
6 changed files
with
132 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Upload a Python Package using Twine when a release is created | ||
|
||
name: Build | ||
on: # yamllint disable-line rule:truthy | ||
release: | ||
types: [published] | ||
push: | ||
branches: ["main", "maint/*"] | ||
pull_request: | ||
branches: ["main", "maint/*"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build twine | ||
- run: python -m build --sdist --wheel | ||
- run: twine check --strict dist/* | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
pypi-upload: | ||
needs: package | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' | ||
permissions: | ||
id-token: write # for trusted publishing | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/mne-nirs | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: github.event_name == 'release' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,74 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "mne-nirs" | ||
description = "An MNE compatible package for processing near-infrared spectroscopy data" | ||
dynamic = ["version"] | ||
maintainers = [{ name = "Robert Luke", email = "[email protected]" }] | ||
license = { text = "BSD-3-Clause" } | ||
readme = { file = "README.rst", content-type = "text/x-rst" } | ||
|
||
requires-python = ">=3.9" | ||
keywords = [ | ||
"neuroscience", | ||
"neuroimaging", | ||
"MEG", | ||
"EEG", | ||
"ECoG", | ||
"fNIRS", | ||
"brain", | ||
] | ||
classifiers = [ | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved", | ||
"Programming Language :: Python", | ||
"Topic :: Software Development", | ||
"Topic :: Scientific/Engineering", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
"Programming Language :: Python :: 3", | ||
] | ||
scripts = { mne = "mne.commands.utils:main" } | ||
dependencies = [ | ||
"numpy>=1.11.3,<3", | ||
"scipy>=0.17.1", | ||
"mne>=1.0", | ||
"h5io>=0.1.7", | ||
"nilearn>=0.9", | ||
"seaborn", | ||
] | ||
|
||
|
||
[project.urls] | ||
Homepage = "https://mne.tools/mne-nirs/" | ||
Download = "https://github.com/mne-tools/mne-nirs" | ||
"Source Code" = "https://github.com/mne-tools/mne-nirs/" | ||
|
||
[project.optional-dependencies] | ||
tests = ["pytest", "pytest-cov"] | ||
docs = ["sphinx", "sphinx-gallery", "sphinx_rtd_theme", "numpydoc", "matplotlib"] | ||
|
||
[tool.hatch.build] | ||
exclude = [ | ||
"/.*", | ||
"/*.yml", | ||
"/*.txt", | ||
"/doc", | ||
"/examples", | ||
"/tools", | ||
"/CONTRIBUTING.md", | ||
"/Dockerfile", | ||
] # tracked by git, but we don't want to ship those files | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
raw-options = { version_scheme = "release-branch-semver" } | ||
|
||
[tool.codespell] | ||
ignore-words = ".github/workflows/ignore_words.txt" | ||
builtin = "clear,rare,informal,names,usage" | ||
|