Skip to content

Commit 85d5137

Browse files
site-shellclaude
andcommitted
fix: derive kirby_sheet.__version__ instead of restating it
It said "0.1.0" while pyproject said 0.2.0, so 0.2.0 shipped to PyPI with a module attribute reporting the previous release. The distribution metadata was right; only the literal was wrong, which is the worst shape -- pip reports one number and the code reports another. kirby-cost and kirby-combat already derive it from the installed distribution, kirby-combat's comment noting the same drift bit it at 0.3.28. This is the third instance, so it is the pattern rather than an accident. 229 passed, 0 skipped, oracle configured. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xof4ZUS5n6A5ibX3PXNYbs
1 parent 733eb60 commit 85d5137

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

kirby_sheet/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,15 @@
88
It ships no Hero Games content. Point it at a template you already have.
99
"""
1010

11-
__version__ = "0.1.0"
11+
from importlib.metadata import PackageNotFoundError, version as _version
12+
13+
try:
14+
#: Read from the installed distribution rather than restated here.
15+
#: A hardcoded literal drifts, and this one did: it still said "0.1.0"
16+
#: when pyproject said 0.2.0 and the wheel published to PyPI as 0.2.0, so
17+
#: anything reading kirby_sheet.__version__ got the wrong answer off a
18+
#: correctly-built package. kirby-cost and kirby-combat already derive it
19+
#: for exactly this reason.
20+
__version__ = _version("kirby-sheet")
21+
except PackageNotFoundError: # not installed (e.g. a source checkout on sys.path)
22+
__version__ = "0.0.0+unknown"

0 commit comments

Comments
 (0)