Skip to content

Build identity (--version) and a manual release workflow - #112

Merged
eaitbrahim merged 1 commit into
mainfrom
feat/versioning
Jul 20, 2026
Merged

Build identity (--version) and a manual release workflow#112
eaitbrahim merged 1 commit into
mainfrom
feat/versioning

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

Prerequisites for running against live funds. Verified state before this: no CI at all, no tags, version never moved off 0.1.0, no --version. "Run it live" meant running whatever happened to be checked out.

keel --version

Reports version + commit + working-tree state. That last part is the point:

keel 0.1.0 (c11baba726af, DIRTY) [checkout]
warning: this build is NOT reproducible -- it does not correspond to a commit.
         Do not run it against live funds.

Two sources: keel/_build_info.py stamped by the release workflow (so an installed artifact identifies itself with no git and no repo present), else git.

⚠️ A stale stamp in a modified checkout would otherwise claim [release] and hide a dirty tree — precisely the misreport this exists to prevent. When git disagrees with the stamp, git wins. There is a test for it.

Workflows

  • ci.yml — tests + ruff on push/PR, plus keel --version as an import-time smoke. The release gate is only worth something if main does not drift red between releases.
  • release.ymlworkflow_dispatch only. Nothing that moves money ships on a merge.

The release job refuses to bump the version itself — that is a human decision in a reviewed PR, so CI never writes to main. It also refuses a non-semver input, a mismatch with pyproject.toml, or an existing tag.

⚠️ Two real problems, found by running the release path locally instead of trusting the YAML

1. uv build alone produces an uninstallable wheel. keel depends on workspace members (keel-core, keel-broker-*) published nowhere. Fixed with --all-packages plus --find-links.

2. ⛔ The distribution name keel is taken on PyPI — by an unrelated project, "Kill proccesses effectively and easily". pip preferred it over our local wheel and silently installed a stranger's package. For a tool that places orders with a live API key that is a supply-chain hazard, not a cosmetic clash.

Distribution renamed to keel-trader; the import package and CLI command both stay keel, so nothing changes day to day. Release notes instruct installing by path and warn against installing by name.

Verified end to end, locally

stamp → uv build --all-packages → install into a clean venv by path → keel --version from outside any git repokeel 0.1.0 (c11baba726af) [release], no DIRTY, exit 0.

Verification

1255 tests pass (up from 1241), ruff clean.

🤖 Generated with Claude Code

Prerequisites for running against live funds. Verified state before this:
NO CI at all, no git tags, version never moved off 0.1.0, no --version --
"run it live" meant running whatever happened to be checked out.

keel --version reports version + commit + WORKING-TREE STATE. The last
part is the point: "0.1.0 (abc123, DIRTY)" and "0.1.0 (abc123)" are
materially different claims, and the first corresponds to no commit at
all. Non-reproducible builds print a loud warning against live use.

Two sources: keel/_build_info.py stamped by the release workflow (so an
INSTALLED artifact identifies itself with no git and no repo present),
else git. A STALE stamp in a modified checkout would otherwise claim
[release] and hide a dirty tree -- the exact misreport this exists to
prevent -- so when git disagrees with the stamp, git wins.

Workflows: ci.yml (tests+ruff on push/PR, plus a --version smoke) and
release.yml (workflow_dispatch ONLY -- nothing that moves money ships on
a merge). The release job refuses to bump the version itself: that is a
human decision in a reviewed PR, so CI never writes to main. It also
refuses a non-semver input, a mismatch with pyproject, or an existing tag.

TWO REAL PROBLEMS FOUND BY TESTING THE RELEASE PATH LOCALLY RATHER THAN
TRUSTING THE YAML:

1. uv build alone produces an UNINSTALLABLE wheel -- keel depends on
   workspace members (keel-core, keel-broker-*) published nowhere. Fixed
   with --all-packages plus --find-links.

2. THE DISTRIBUTION NAME "keel" IS TAKEN ON PyPI by an unrelated project
   ("Kill proccesses effectively and easily"). pip preferred it over our
   local wheel and silently installed a STRANGER'S PACKAGE. For a tool
   that places orders with a live API key that is a supply-chain hazard,
   not a cosmetic clash. Distribution renamed to keel-trader; the import
   package and the CLI command both stay keel. Release notes instruct
   installing BY PATH and warn against installing by name.

Verified end to end locally: stamp -> uv build --all-packages -> install
into a clean venv by path -> keel --version from outside any git repo
reports "keel 0.1.0 (<sha>) [release]", no DIRTY, exit 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@eaitbrahim
eaitbrahim merged commit 2de1b57 into main Jul 20, 2026
1 check passed
@eaitbrahim
eaitbrahim deleted the feat/versioning branch July 20, 2026 20:27
@eaitbrahim eaitbrahim added the feature New capability (groups under Features) label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability (groups under Features)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant