Skip to content

Derive the version from git tags with hatch-vcs - #142

Merged
PythonFZ merged 2 commits into
mainfrom
migrate-hatch-vcs
Aug 26, 2026
Merged

Derive the version from git tags with hatch-vcs#142
PythonFZ merged 2 commits into
mainfrom
migrate-hatch-vcs

Conversation

@PythonFZ

@PythonFZ PythonFZ commented Aug 26, 2026

Copy link
Copy Markdown
Member

Migrates versioning to hatch-vcs, following zincware/molify#106.

Changes

  • pyproject.toml: version = "0.2.7" becomes dynamic = ["version"], build requires hatch-vcs, with version-file = "znflow/_version.py".
  • .gitignore: ignores the generated znflow/_version.py.
  • publish.yaml: checkout with fetch-depth: 0, so the build backend sees the tags.
  • pytest.yaml: actions/checkout@v5 with fetch-depth: 0, so uv sync resolves a real version.
  • uv.lock: znflow entry is now dynamic.

Verification

  • uv build produces znflow-0.2.8.dev1+gae5387570 from the v0.2.7 tag, and the wheel ships znflow/_version.py.
  • uv run pytest: 429 passed.

Releasing

Publishing now takes the version from the tag, so a release tagged v0.2.8 ships 0.2.8.

🤖 Generated with Claude Code

Replace the hardcoded project version with hatch-vcs, generating
znflow/_version.py at build time. CI checkouts fetch the full history so
the tags are available to the build backend.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PythonFZ PythonFZ added p-1 High priority effort-2 Small effort labels Aug 26, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PythonFZ
PythonFZ merged commit 4cf4778 into main Aug 26, 2026
5 checks passed
@PythonFZ
PythonFZ deleted the migrate-hatch-vcs branch August 26, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort-2 Small effort p-1 High priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant