diff --git a/.gitignore b/.gitignore index 477369e..bd36d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,5 @@ target/ .envrc .direnv + +peony/_version.py diff --git a/peony/__init__.py b/peony/__init__.py index e2fea08..f3af6e5 100644 --- a/peony/__init__.py +++ b/peony/__init__.py @@ -8,7 +8,7 @@ """ -__version__ = "3.0.0" +from ._version import __version__, __version_tuple__ # type: ignore import logging diff --git a/pyproject.toml b/pyproject.toml index d5684d4..444c7db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" [project] @@ -69,7 +69,10 @@ Repository = "https://github.com/odrling/peony-twitter.git" Issues = "https://github.com/odrling/peony-twitter/issues" [tool.hatch.version] -path = "peony/__init__.py" +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "_version.py" [tool.hatch.build.targets.sdist] include = [