fix: derive __version__ from package metadata#25
Merged
Conversation
The hardcoded "0.1.0" had been stale through every bump since 0.1.0. Read it from importlib.metadata so the runtime value tracks the installed wheel's pyproject.toml version automatically. Tests now assert __version__ matches importlib metadata + a PEP 440 shape regex, instead of a brittle string equality that quietly silenced the drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for your first pull request! We appreciate the contribution. Before review, please make sure tests pass: |
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.
Summary
opendecree.__version__was hardcoded to"0.1.0"since the very first release and never updated. Verified at this morning's v0.3.0a1 publish: PyPI shows 0.3.0a1, butpython -c "import opendecree; print(opendecree.__version__)"printed0.1.0.importlib.metadata.version("opendecree")so it always tracks the installed wheel.== "0.1.0", which is why drift went unnoticed.Test plan
make test— 171 passed, 97.37% coveragepython -c "import opendecree; print(opendecree.__version__)"matches the published PyPI version🤖 Generated with Claude Code