From 51b4eb5eca7eacab53f49c6656a6aec562fa6d06 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 28 Nov 2025 08:20:59 -0500 Subject: [PATCH 1/2] Enable automatic versioning from Git tags - Use hatch-vcs to automatically derive version from Git tags - Remove hardcoded version number from pyproject.toml - Version will now be automatically extracted from latest Git tag - Eliminates need to manually update version in pyproject.toml --- toolchain/pyproject.toml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/toolchain/pyproject.toml b/toolchain/pyproject.toml index f7fffce1c6..9ded1bda50 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,9 @@ dependencies = [ [tool.hatch.metadata] allow-direct-references = true + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "mfc/_version.py" From 76fbc37dcb65ebee34c4cd42b0814dee268a7ea3 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 28 Nov 2025 08:41:10 -0500 Subject: [PATCH 2/2] fix --- .gitignore | 3 +++ toolchain/pyproject.toml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index a56c6a6749..a041d99587 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 9ded1bda50..0155b5ca67 100644 --- a/toolchain/pyproject.toml +++ b/toolchain/pyproject.toml @@ -60,5 +60,10 @@ 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"