fix: reliable version resolution + single-source manifests (bump 0.4.2)#36
Merged
Conversation
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]>
54748e3 to
19e8bc8
Compare
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.
The CLI read its version from
package.json/pyproject.tomlnext to the script — fine in-repo, butunknownonce installed where no manifest sits beside the binary (brew, pip/pipx). Fixed with installer stamping.read_cli_versionprefers$WTCRAFT_VERSION, falls back to the manifest (in-repo dev), thenunknown_cli.pystampsWTCRAFT_VERSIONfromimportlib.metadatabefore execWTCRAFT_VERSION(matches the existingWTCRAFT_TEMPLATE_DIRinjection)__init__.pyderives__version__from package metadata instead of a second hardcoded literal (which had already drifted to0.3.8)scripts/bump-version.shsingle-sources the three build manifests; bumped to 0.4.2tests/e2e_version.shcovers env stamp / in-repo manifest read / manifest-lessunknownsha256still points at the 0.4.1 tarball — update it once thev0.4.2tag/tarball exists.🤖 Generated with Claude Code