Skip to content

Commit

Permalink
packaging: switch to hatch
Browse files Browse the repository at this point in the history
Start using hatch [1] for the project management.

Due to hatch defaults, we'll need to add explicit include/exclude rules
for some files, e.g. include setup.py and exclude Makefiles.

Due to setuptools defaults [2], we've included some files from test/ as
well as the generated hawkmoth.egg-info in the source tarball. Drop
them.

[1] https://hatch.pypa.io/latest/
[2] https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html
  • Loading branch information
jnikula committed May 1, 2024
1 parent fb4c946 commit 78bf0c6
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "hawkmoth"
Expand Down Expand Up @@ -53,8 +50,23 @@ hawkmoth = "hawkmoth.__main__:main"
Homepage = "https://github.com/jnikula/hawkmoth"
Documentation = "https://jnikula.github.io/hawkmoth/stable/"

[tool.setuptools.dynamic]
version = {file = ["src/hawkmoth/VERSION"]}
[tool.hatch.version]
path = "src/hawkmoth/VERSION"
pattern = "(?P<version>[a-zA-Z0-9._-]*)"

[tool.hatch.build.targets.sdist]
include = [
"/setup.py",
"/src",
]
exclude = [
"**/Makefile*",
]

[tool.hatch.build.targets.wheel]
exclude = [
"**/Makefile*",
]

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down

0 comments on commit 78bf0c6

Please sign in to comment.