Skip to content

Commit 5e83126

Browse files
georgeh0claude
andauthored
chore: auto-generate _version.py via hatch-vcs (#74)
Configure hatch-vcs build hook to generate _version.py from git tags during build, instead of maintaining a hardcoded placeholder. The file is now gitignored since it is build-generated. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b691137 commit 5e83126

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ htmlcov/
4141
.pytest_cache/
4242
.mypy_cache/
4343

44+
# Generated version file
45+
src/cocoindex_code/_version.py
46+
4447
# CocoIndex
4548
.cocoindex_code/

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Issues = "https://github.com/cocoindex-io/cocoindex-code/issues"
5555

5656
[tool.hatch.version]
5757
source = "vcs"
58+
fallback-version = "999.0.0"
59+
60+
[tool.hatch.build.hooks.vcs]
61+
version-file = "src/cocoindex_code/_version.py"
5862

5963
[tool.hatch.build.targets.wheel]
6064
packages = ["src/cocoindex_code"]

src/cocoindex_code/_version.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)