Skip to content

feat: implement dynamic versioning using git tags and hatch-vcs#6

Merged
aiagate merged 1 commit into
mainfrom
feature/dynamic-versioning
Apr 13, 2026
Merged

feat: implement dynamic versioning using git tags and hatch-vcs#6
aiagate merged 1 commit into
mainfrom
feature/dynamic-versioning

Conversation

@aiagate

@aiagate aiagate commented Apr 13, 2026

Copy link
Copy Markdown
Owner

Description

This PR transitions the project's versioning from a static string in pyproject.toml to a dynamic system based on Git tags. This enables automatic version calculation during build and automated releases via GitHub Actions.

Key Changes

  • Build System: Switched from uv_build to hatchling with hatch-vcs for dynamic versioning.
  • pyproject.toml: Removed static version and added dynamic = ["version"].
  • GitHub Actions:
    • Updated publish-prod.yml to trigger on v* tag pushes.
    • Added fetch-depth: 0 to checkout steps to ensure all tag history is available for version calculation.
    • Corrected the publishing target name in the workflow output.
  • Lockfile: Updated uv.lock to reflect the build system change.

Verification

  • Verified that uv build correctly generates a development version string (e.g., 0.1.dev4+gc4d71f436.d20260413) based on the current Git state.
  • Verified that uv sync works as expected with the new build backend.

How to Release

  1. Tag a commit: git tag v0.1.0
  2. Push the tag: git push origin v0.1.0
    The publish-prod workflow will automatically trigger and release to PyPI.

Transitioned build backend to hatchling/hatch-vcs to enable automatic versioning based on git tags. Updated GitHub Actions to trigger on tag push and fetch full git history for versioning.
@aiagate aiagate merged commit 36c0002 into main Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant