maint: single source of truth for the version#37
Merged
Conversation
Move the version to src/harel/__about__.py and have hatchling read it via [tool.hatch.version] (pyproject 'dynamic'); __init__ imports __version__ from there. One place to bump — and unlike importlib.metadata it reflects the current source immediately (no stale editable-install metadata). Document the lockstep release checklist in CONTRIBUTING. Closes #36.
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.
Closes #36.
The version was duplicated in
pyproject.tomlandsrc/harel/__init__.py; every bump was a two-place edit (I just hit this bumping to 0.0.2).What
src/harel/__about__.pyholds__version__— the one place to bump.pyproject.tomlusesdynamic = ["version"]+[tool.hatch.version] path = "src/harel/__about__.py", so the build reads the same file.__init__imports__version__from__about__.Why not
importlib.metadataTried it first — it reads installed dist metadata, which is a stale snapshot for editable installs (returned 0.0.1 after the 0.0.2 bump, which would mis-pin the conformance fetch). The
__about__.py+ hatchling pattern reflects the source immediately.Verify
harel.__version__→ 0.0.2 (no reinstall);python -m build→harel_python-0.0.2; conformance still pinsv0.0.2. ruff + mypy clean; 129 unit + 57 conformance.