Skip to content

fix: derive __version__ from package metadata#25

Merged
zeevdr merged 1 commit intomainfrom
fix/version-from-metadata
Apr 27, 2026
Merged

fix: derive __version__ from package metadata#25
zeevdr merged 1 commit intomainfrom
fix/version-from-metadata

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented Apr 27, 2026

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, but python -c "import opendecree; print(opendecree.__version__)" printed 0.1.0.
  • Read the version from importlib.metadata.version("opendecree") so it always tracks the installed wheel.
  • Tighten the tests so they would have caught this — they previously asserted == "0.1.0", which is why drift went unnoticed.

Test plan

  • make test — 171 passed, 97.37% coverage
  • After merge + next release, verify python -c "import opendecree; print(opendecree.__version__)" matches the published PyPI version

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown

Thanks for your first pull request! We appreciate the contribution.

Before review, please make sure tests pass: cd sdk && pytest

@zeevdr zeevdr merged commit de36ee2 into main Apr 27, 2026
12 checks passed
@zeevdr zeevdr deleted the fix/version-from-metadata branch April 27, 2026 18:51
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