gifn-apply: switch to hatchling for the PEP517 build
Also, let hatch obtain the version from the defs.py file by itself.
Change-Id: Ieb308873a4f63bea794fce15ce02fa1b8bf56b41
diff --git a/tools/git-if-needed/python/pyproject.toml b/tools/git-if-needed/python/pyproject.toml
index 1c0dd26..cbd0c1f 100644
--- a/tools/git-if-needed/python/pyproject.toml
+++ b/tools/git-if-needed/python/pyproject.toml
@@ -2,15 +2,18 @@
# SPDX-License-Identifier: BSD-2-Clause
[build-system]
-requires = ["setuptools >= 61", "wheel"]
-build-backend = "setuptools.build_meta"
+requires = [
+ "hatchling >= 1.8, < 2",
+ "hatch-requirements-txt >= 0.3, < 0.5",
+]
+build-backend = "hatchling.build"
[project]
name = "gifn_apply"
-version = "0.1.0"
description = "Functional tests for the git-if-needed tool"
readme = "README.md"
requires-python = ">= 3.8"
+dynamic = ["version"]
[[project.authors]]
name = "StorPool"
@@ -19,10 +22,11 @@
[project.scripts]
gifn_apply = "gifn_apply.__main__:main"
-[tool.setuptools]
-zip-safe = true
-package-dir = {"" = "src"}
-packages = ["gifn_apply"]
+[tool.hatch.build.targets.wheel]
+packages = ["src/gifn_apply"]
+
+[tool.hatch.version]
+path = "src/gifn_apply/defs.py"
[tool.mypy]
strict = true