diff --git a/.gitignore b/.gitignore index a56c6a674..a041d9958 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ __pycache__ *.egg-info +# Auto-generated version file +toolchain/mfc/_version.py + .DS_Store /tests/*/** diff --git a/toolchain/pyproject.toml b/toolchain/pyproject.toml index f7fffce1c..0155b5ca6 100644 --- a/toolchain/pyproject.toml +++ b/toolchain/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" [project] name = "mfc" -version = "4.9.6" +dynamic = ["version"] dependencies = [ # General "rich", @@ -56,3 +56,14 @@ dependencies = [ [tool.hatch.metadata] allow-direct-references = true + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.version.raw-options] +root = ".." +relative_to = "pyproject.toml" +version_file = "mfc/_version.py" + +[tool.hatch.build.hooks.vcs] +version-file = "mfc/_version.py"