Skip to content

Commit

Permalink
MNT: Switch to hatch build system
Browse files Browse the repository at this point in the history
Hatch has a hatch-vcs plugin that wraps around setuptools_scm while
remaining flexible.

In contrast, setuptools_scm hijacks setuptools' file finding, making
package data management cumbersome. And flit handles dynamic version
metadata by importing, turning install-time dependencies into build-time
dependencies.
  • Loading branch information
effigies committed Jan 6, 2023
1 parent 1ae3193 commit e4429de
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "fmriprep"
Expand Down Expand Up @@ -87,11 +87,30 @@ all = ["fmriprep[doc,maint,telemetry,test]"]
[project.scripts]
fmriprep = "fmriprep.cli.run:main"

[tool.setuptools]
#
# Hatch configurations
#

[tool.hatch.build.targets.sdist]
exclude = [".git_archival.txt"] # No longer needed in sdist

[tool.hatch.build.targets.wheel]
packages = ["fmriprep"]
exclude = [
"fmriprep/data/tests", # Large test data directory
]

## The following two sections configure setuptools_scm in the hatch way

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "fmriprep/_version.py"

[tool.setuptools_scm]
write_to = "fmriprep/_version.py"
#
# Developer tool configurations
#

[tool.black]
line-length = 99
Expand Down

0 comments on commit e4429de

Please sign in to comment.