Repository navigation
fix: derive xblocks_core.__version__ from package metadata - #322
Open
kdmccormick wants to merge 1 commit into
Open
kdmccormick wants to merge 1 commit into
kdmccormick wants to merge 1 commit into
Conversation
The package version comes from git tags via setuptools_scm (dynamic version in pyproject.toml), but xblocks_core.__version__ was a hard-coded "1.0.0" left over from before that switch, and so was wrong once 2.0.0 shipped. Read it from importlib.metadata instead, as super-csv does, so there is one source of truth. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
kdmccormick
force-pushed
the
kdmccormick/remove-stale-version
branch
from
November 9, 2026 20:35
d9eaf44 to
2918431
Compare
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.
Description
xblocks_core.__version__was a hard-coded"1.0.0", left over from before the package version became dynamic (dynamic = ["version"]inpyproject.toml, computed by setuptools_scm from git tags). It was wrong once 2.0.0 shipped, and would drift again with every release.This reads it from
importlib.metadata.version("xblocks-core")instead, following the pattern in super-csv, so the git tag is the one source of truth.docs/conf.pyalready does the same.Testing instructions
With xblocks-core installed from this branch:
should print the setuptools_scm version (the tag, or
X.Y.Z.devNon an untagged checkout), not1.0.0.AI disclosure
Spotted by @kdmccormick; change written by Claude (Fable 5.1) and reviewed by @kdmccormick.
🤖 Generated with Claude Code