Repository navigation
Fix --version drift; release 0.5.2 - #87
Merged
Merged
Conversation
0.5.1 shipped an entrypoint that printed 0.5.0. The version lived in two
places — pyproject.toml and a hardcoded __version__ literal — and the bump
moved only the first. Derive __version__ from the installed distribution's
metadata so there is a single source of truth that cannot drift.
Enforce it: the CI install-time check now asserts the entrypoint's reported
version equals the packaged version rather than only that it runs, and the
unit test asserts __version__ equals importlib.metadata.version("samplerdisc")
instead of pinning a literal (the literal-mirrors-literal test is what masked
the drift). Bump to 0.5.2.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What this fixes
The published 0.5.1 prints
0.5.0forsamplerdisc --version. The install test against PyPI caught it.Root cause
The version had two sources of truth:
pyproject.tomland a hardcoded__version__ = "0.5.0"literal insrc/samplerdisc/__init__.py.uv version --bumpmoves only the former, so the runtime string was left behind. 0.5.0 was self-consistent by luck; the first bump exposed the split.It went unnoticed because the guards were weak in matching ways: the release workflow's tag-vs-version guard checks
pyproject(not the runtime value), CI's entrypoint step ransamplerdisc --versionwithout asserting what it printed, and the unit test pinned the literal"0.5.0"— a literal mirroring a literal, which passed while both sat still.The fix — one source of truth
__version__is now read from the installed distribution's metadata (importlib.metadata.version("samplerdisc")), with a0.0.0+unknownfallback for an uninstalled source tree. It cannot drift from the packaged version because it is the packaged version.samplerdisc --versionagainstuv version --shortand fails on a mismatch — this exact bug would now break the build.__version__ == importlib.metadata.version("samplerdisc").Verified locally
ruff check/ruff format --checkclean, fullpytestgreen (real-disc tests skip as designed), and the entrypoint check mimicked locally reports0.5.2on both sides.Consequence
0.5.1 can't be re-uploaded, so this ships as 0.5.2. The package contents were otherwise identical to 0.5.1 — only the self-reported version was wrong — so upgrading is the fix for anyone who installed 0.5.1.
After merge
git tag v0.5.2 && git push origin v0.5.2cuts the release through the same Trusted Publishing workflow.🤖 Generated with Claude Code