From e4429de01213f89d1bd2b40744960b03c1028abb Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 5 Jan 2023 12:06:09 -0500 Subject: [PATCH] MNT: Switch to hatch build system 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. --- pyproject.toml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0726c45b3..078e153db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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