Skip to content

Derive version from git tags via hatch-vcs#117

Merged
alexkroman merged 16 commits into
mainfrom
hatch-vcs-versioning
Jun 12, 2026
Merged

Derive version from git tags via hatch-vcs#117
alexkroman merged 16 commits into
mainfrom
hatch-vcs-versioning

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

What & why

Releases now derive the version from the git tag via hatch-vcs instead of hand-syncing a literal across pyproject.toml + aai_cli/__init__.py. Cutting a release collapses to pushing a tag — there is no version string to bump.

Changes

  • Versioning: pyproject.toml uses dynamic = ["version"] + [tool.hatch.version] source = "vcs" with a version-file hook that writes a gitignored aai_cli/_version.py; aai_cli/__init__.py re-exports __version__ from it. The uv lock --check spike confirmed the lockfile does not drift on commits past a tag.
  • Gate config: ruff + vulture exclude the generated _version.py; mypy/pyright/import-linter accept it as-is.
  • Homebrew (Formula/assembly.rb): the GitHub source tarball has no .git, so def install feeds the version via the generic SETUPTOOLS_SCM_PRETEND_VERSION (hatch-vcs 0.x doesn't honor the dist-scoped form) — installing resources under a clean env first, then setting it only for our package so resource versions aren't affected.
  • Release scripts: deleted scripts/bump_patch.sh; rewrote scripts/cut_release.sh to derive the version from tags (no arg → next patch above the latest tag; cut_release.sh X.Y.Z → explicit). All safety gates preserved. Dropped the deleted script from check.sh's shellcheck list.
  • Welcome banner: dropped the tagline so the longer dev version (X.Y.Z.devN+g<hash>) stays on one line; --version/telemetry keep the full commit-identifying version.
  • gitleaks: allowlisted a generic-api-key false positive on a kwarg expression in stream_exec.py (version-skew between local and CI gitleaks).
  • README: added a welcome screenshot and a "Things you can do" showcase of one-liners (all commands verified against the CLI).
  • Docs: design + implementation plan under docs/superpowers/.

Notes for reviewers

  • The version-derivation approach, env-var discovery, and banner change were each independently reviewed.
  • docs/superpowers/ planning artifacts are included for traceability — say the word if you'd rather they not land in the repo.

🤖 Generated with Claude Code

alexkroman-assembly and others added 14 commits June 12, 2026 09:48
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The hatch-vcs dev version (X.Y.Z.devN+g<hash>) is long enough to wrap the
welcome banner at 80 cols. Drop the tagline so the banner stays one line
while --version/telemetry keep the full commit-identifying version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread scripts/cut_release.sh
alexkroman-assembly and others added 2 commits June 12, 2026 10:55
The no-tag guard ran before the explicit-version branch, so 'cut_release.sh
X.Y.Z' errored in a tagless repo despite explicit input being supported.
Move the guard into the auto-bump branch and handle the no-tag status line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexkroman alexkroman added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit 6bf9b30 Jun 12, 2026
16 checks passed
@alexkroman alexkroman deleted the hatch-vcs-versioning branch June 12, 2026 18:05
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.

2 participants