Skip to content

fix(version): derive version from metadata; re-lock on release (fixes red main)#30

Merged
nickroci merged 1 commit into
mainfrom
fix/version-from-metadata
Jun 12, 2026
Merged

fix(version): derive version from metadata; re-lock on release (fixes red main)#30
nickroci merged 1 commit into
mainfrom
fix/version-from-metadata

Conversation

@nickroci

Copy link
Copy Markdown
Owner

Two related fixes

1. ultan --version / doctor reported the wrong version

ultan/__init__.py hardcoded __version__ = "0.2.0", which set-version.sh never touched — so after the v0.3.0 release, doctor said 0.2.0 while the installed dist was 0.3.0. Root cause: a second source of version truth. Fix: derive __version__ from importlib.metadata (single source = pyproject → wheel), lazily (PEP 562) so the ultan hook hot path never pays the lookup (guarded by test_hook_import).

2. The v0.3.0 release left main's CI red

set-version.sh bumped every workspace member in pyproject but never re-locked, so uv.lock kept 0.2.0 and uv sync --locked failed on main — and the self-stamped ci-success on the release PR meant it was never caught. Fixes:

  • set-version.sh now runs uv lock after the edits.
  • release.yml sets up uv and runs uv sync --locked before stamping ci-success, so the stamp reflects the only checks that can change for a version bump (coherence + lockfile), not a blind bypass.
  • uv.lock regenerated to 0.3.0 here — un-reds main on merge.

Note: the uv.lock diff is 5 version-string lines only (the workspace members 0.2.0 → 0.3.0); zero dependency changes.

🤖 Generated with Claude Code

… red main)

Two related fixes.

1. Version display drift. `ultan --version` / `ultan doctor` printed a HARDCODED
   `__version__ = "0.2.0"` in ultan/__init__.py that set-version.sh never touched,
   so after the 0.3.0 release doctor reported 0.2.0 while the installed dist was
   0.3.0. Root cause: a second source of version truth. Fix: derive `__version__`
   from importlib.metadata (single source = pyproject -> wheel), computed lazily
   via PEP 562 so the `ultan hook` hot path never pays the lookup (verified by
   test_hook_import).

2. Stale lockfile reddened main. set-version.sh bumped every workspace member in
   pyproject but never re-locked, so uv.lock kept 0.2.0 and `uv sync --locked`
   (CI) failed on main after the v0.3.0 release merged — and the self-stamped
   ci-success on the release PR meant it was never caught pre-merge. Fixes:
   - set-version.sh now runs `uv lock` after the version edits.
   - release.yml sets up uv and runs `uv sync --locked` before stamping
     ci-success, so the stamp reflects the only checks that can change for a
     version bump (coherence + lockfile), not a blind bypass.
   - uv.lock regenerated to 0.3.0 here, which un-reds main on merge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nickroci nickroci merged commit 57982a2 into main Jun 12, 2026
7 checks passed
@nickroci nickroci deleted the fix/version-from-metadata branch June 12, 2026 10: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