Skip to content

fix: derive xblocks_core.__version__ from package metadata - #322

Open
kdmccormick wants to merge 1 commit into
mainfrom
kdmccormick/remove-stale-version
Open

kdmccormick wants to merge 1 commit into
mainfrom
kdmccormick/remove-stale-version

Conversation

@kdmccormick

@kdmccormick kdmccormick commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Description

xblocks_core.__version__ was a hard-coded "1.0.0", left over from before the package version became dynamic (dynamic = ["version"] in pyproject.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.py already does the same.

Testing instructions

With xblocks-core installed from this branch:

python -c 'import xblocks_core; print(xblocks_core.__version__)'

should print the setuptools_scm version (the tag, or X.Y.Z.devN on an untagged checkout), not 1.0.0.

AI disclosure

Spotted by @kdmccormick; change written by Claude (Fable 5.1) and reviewed by @kdmccormick.

🤖 Generated with Claude Code

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
kdmccormick force-pushed the kdmccormick/remove-stale-version branch from d9eaf44 to 2918431 Compare November 9, 2026 20:35
@kdmccormick kdmccormick changed the title chore: remove stale __version__ from xblocks_core fix: derive xblocks_core.__version__ from package metadata Nov 9, 2026
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.

1 participant