Skip to content

chore: Replace hardcoded version with automatic git tag versioning#17

Merged
jcpitre merged 4 commits into
mainfrom
chore/auto-version-from-git-tags
Jun 15, 2026
Merged

chore: Replace hardcoded version with automatic git tag versioning#17
jcpitre merged 4 commits into
mainfrom
chore/auto-version-from-git-tags

Conversation

@jcpitre

@jcpitre jcpitre commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Switches from manually maintaining version numbers in source files to automatic versioning driven by git tags using hatch-vcs.

Changes

  • Add hatch-vcs as a build dependency in pyproject.toml
  • Remove hardcoded version field; use dynamic = ["version"] instead
  • __init__.py now reads version from package metadata at runtime
  • CI release workflow uses fetch-depth: 0 so hatch-vcs can resolve tags during build
  • Update version test to check program name instead of a hardcoded version string

How to release going forward

Create a GitHub Release with a tag like v0.2.0 — the workflow picks it up and publishes that version to PyPI automatically. No more manual version bumps.

Testing

This will be tested once merged and a release is done.

@jcpitre jcpitre changed the title Derive version automatically from git tags using hatch-vcs chore: Replace hardcoded version with automatic git tag versioning Jun 12, 2026

@cka-y cka-y left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] does this require updating the readme documentation on how to release a new version?

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@jcpitre

jcpitre commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

[question] does this require updating the readme documentation on how to release a new version?

Modified the README.md

@jcpitre jcpitre merged commit 2680217 into main Jun 15, 2026
6 checks 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.

3 participants