Skip to content

fix: reliable version resolution + single-source manifests (bump 0.4.2)#36

Merged
zywkloo merged 1 commit into
mainfrom
fix/version-resolution
Jun 14, 2026
Merged

fix: reliable version resolution + single-source manifests (bump 0.4.2)#36
zywkloo merged 1 commit into
mainfrom
fix/version-resolution

Conversation

@zywkloo

@zywkloo zywkloo commented Jun 14, 2026

Copy link
Copy Markdown
Owner

The CLI read its version from package.json/pyproject.toml next to the script — fine in-repo, but unknown once installed where no manifest sits beside the binary (brew, pip/pipx). Fixed with installer stamping.

  • read_cli_version prefers $WTCRAFT_VERSION, falls back to the manifest (in-repo dev), then unknown
  • pip: _cli.py stamps WTCRAFT_VERSION from importlib.metadata before exec
  • brew: the formula wrapper exports WTCRAFT_VERSION (matches the existing WTCRAFT_TEMPLATE_DIR injection)
  • __init__.py derives __version__ from package metadata instead of a second hardcoded literal (which had already drifted to 0.3.8)
  • scripts/bump-version.sh single-sources the three build manifests; bumped to 0.4.2
  • tests/e2e_version.sh covers env stamp / in-repo manifest read / manifest-less unknown

⚠️ Release TODO: the Formula sha256 still points at the 0.4.1 tarball — update it once the v0.4.2 tag/tarball exists.

🤖 Generated with Claude Code

The CLI read its version from package.json/pyproject.toml next to the script,
which works in-repo but returns "unknown" once installed where no manifest sits
beside the binary (brew, pip/pipx). Fix with installer stamping:

- read_cli_version prefers $WTCRAFT_VERSION, falling back to the manifest for
  in-repo development, then "unknown"
- pip: _cli.py stamps WTCRAFT_VERSION from importlib.metadata before exec
- brew: the formula wrapper exports WTCRAFT_VERSION (matches the existing
  WTCRAFT_TEMPLATE_DIR injection)
- __init__.py derives __version__ from package metadata instead of a second
  hardcoded literal (which had already drifted to 0.3.8)

Single-source the three build manifests via scripts/bump-version.sh and bump to
0.4.2. Add tests/e2e_version.sh covering the env stamp, the in-repo manifest
read, and the manifest-less "unknown" path.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@zywkloo zywkloo force-pushed the fix/version-resolution branch from 54748e3 to 19e8bc8 Compare June 14, 2026 06:23
@zywkloo zywkloo merged commit e458cb5 into main Jun 14, 2026
1 check passed
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