Repository navigation
feat: tag-derived versioning via hatch-vcs - #156
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements docs/superpowers/specs/2026-11-05-hatch-vcs-versioning-design.md (plan: docs/superpowers/plans/2026-11-05-hatch-vcs-versioning.md).
What
The git tag becomes the single source of truth for the version.
pyproject.tomlno longer carriesversion— hatch-vcs derives a PEP 440 version fromgit describeat build time and generatessrc/profiles/_version.py.git tag v0.12.0 && git push origin v0.12.0is the only release act — no version-bump edit0.11.0rc3.dev87+g<hash>,+dirtywhen the tree is dirty)release.ymlguard shrinks to the SemVer-format check (the tag↔pyproject comparison is tautological now)fetch-depth: 0— a shallow checkout would silently build a fallback versionResolution order in
_resolve_version()profiles._version(generated, regenerated on every build/install) →importlib.metadata(legacy installs without the module) →"0.0.0-dev"(git-less source trees).Note: this inverts the spec's original 'metadata stays primary' wording, ruled during implementation — the full suite caught dist-info staleness after a mid-session
uv build(dist-info updates only at install time; the generated module never goes stale relative to the tree). Metadata fallback is retained and tested.Release note
The next release tag must be pushed manually as before — nothing else to edit. PyPI publishing (if ever) needs
local-scheme = "no-local-version"first.Verification
uv build --wheel→profiles_app-0.11.0rc3.dev87+gb82465d25...whl, wheel containsprofiles/_version.py