Skip to content

Derive __version__ from installed package metadata#155

Merged
odesenfans merged 1 commit into
mainfrom
od/version-from-metadata
Apr 22, 2026
Merged

Derive __version__ from installed package metadata#155
odesenfans merged 1 commit into
mainfrom
od/version-from-metadata

Conversation

@odesenfans
Copy link
Copy Markdown
Contributor

Summary

  • Replace the hardcoded __version__ literal in aleph_message/__init__.py with an importlib.metadata.version("aleph-message") lookup.
  • Makes the git tag the single source of truth for the package version (the wheel version is already dynamic via hatch-vcs); no more manual bump step during releases.
  • Falls back to "0.0.0+unknown" if the package isn't installed (e.g. running from a raw source tree without pip install -e .).

Test plan

  • pip install -e . && python -c "import aleph_message; print(aleph_message.__version__)" prints the hatch-vcs-derived version
  • CI passes
  • After merge, tag v1.1.1 on main and confirm the published wheel reports 1.1.1

Removes the hardcoded version literal so the package version has a single
source of truth (the git tag, via hatch-vcs). __version__ is now resolved
at import time through importlib.metadata.
@odesenfans odesenfans merged commit 09d6f7c into main Apr 22, 2026
10 checks passed
@odesenfans odesenfans deleted the od/version-from-metadata branch April 22, 2026 08:53
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