Skip to content

maint: single source of truth for the version#37

Merged
fruwe merged 1 commit into
mainfrom
maint-single-version
Jul 1, 2026
Merged

maint: single source of truth for the version#37
fruwe merged 1 commit into
mainfrom
maint-single-version

Conversation

@fruwe

@fruwe fruwe commented Jul 1, 2026

Copy link
Copy Markdown
Member

Closes #36.

The version was duplicated in pyproject.toml and src/harel/__init__.py; every bump was a two-place edit (I just hit this bumping to 0.0.2).

What

  • New src/harel/__about__.py holds __version__ — the one place to bump.
  • pyproject.toml uses dynamic = ["version"] + [tool.hatch.version] path = "src/harel/__about__.py", so the build reads the same file.
  • __init__ imports __version__ from __about__.
  • CONTRIBUTING gains a Releasing (lockstep) checklist.

Why not importlib.metadata

Tried 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 buildharel_python-0.0.2; conformance still pins v0.0.2. ruff + mypy clean; 129 unit + 57 conformance.

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.
@fruwe fruwe merged commit a40682e into main Jul 1, 2026
2 checks passed
@fruwe fruwe deleted the maint-single-version branch July 1, 2026 12:07
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.

maint: single source of truth for the version

1 participant