Fix the release workflow's lint job, and let a failed release be re-run - #17
Merged
Conversation
The first tag this repo ever pushed, v0.0.22, never published: CI-with-BnP
failed at `lint` before hatch checked a single file, so `build` and `push`
were skipped.
Environment `hatch-static-analysis` is incompatible: module
'virtualenv.discovery.builtin' has no attribute 'propose_interpreters'
hatch 1.16.2 requires `virtualenv>=20.26.6` with no upper bound, so pipx
installs virtualenv 21.x, where that API is gone. It only bites when hatch has
to discover an interpreter other than its own -- on the runner pipx installs
hatch under 3.12 while setup-python puts 3.13 on PATH -- which is why
`unit-test` passed and `lint` did not.
ci.yaml has carried `pipx inject hatch "virtualenv<21"` since April for exactly
this. ci-with-bnp.yaml never got it, and until v0.0.22 it had never run.
Fix it at the source instead of copying the workaround: hatch 1.17.0 raised its
own floor to `virtualenv>=21`, so bump HATCH_VERSION to 1.17.1 in both
workflows and drop the pin. Verified locally against a reproduction of the
runner's interpreter mismatch: `hatch fmt` and `hatch test --all --randomize`
both pass. Note 1.17 deprecates `hatch fmt` in favour of `hatch check`; it
still works, and moving is a separate change.
Also add `workflow_dispatch` so a release whose publish leg fails can be re-run
without moving the tag, guarded by a job that refuses a ref that is not a tag.
The `push` job already rejects one, but only after the arm64 build has run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
v0.0.22— the first tag this repo ever pushed — never published.CI-with-BnPfailed atlintbefore hatch checked a single file, sobuildandpushwere skipped and neitherghcr.io/netclab/function-eapi:v0.0.22nor the Upbound one exists.The failure
hatch 1.16.2 declares
virtualenv>=20.26.6with no upper bound, so pipx installs virtualenv 21.x, where that API is gone. It only fires when hatch has to discover an interpreter other than the one it runs on — on the runner pipx installs hatch under Python 3.12.3 whilesetup-pythonputs 3.13.14 on PATH. That is whyunit-testpassed andlintdid not, and why the same content linted green on #16.ci.yamlhas carriedpipx inject hatch "virtualenv<21"since the April "Update ci.yaml" runs, for exactly this.ci-with-bnp.yamlnever got it — and, with no tag in the repo until now, had never run.The fix
Rather than copy the workaround into a second workflow: hatch 1.17.0 raised its own floor to
virtualenv>=21, i.e. it is the release that adapted to the new API. SoHATCH_VERSIONgoes to1.17.1in both workflows and the pin is dropped.Verified locally against a reproduction of the runner's interpreter mismatch (3.13 first on PATH, hatch installed by pipx under 3.12):
virtualenv<21hatch fmtpasseshatch fmtpasses;hatch test --all --randomize2 passedOne note: 1.17 deprecates
hatch fmtin favour ofhatch check code --fix/hatch check fmt --fix. It still works; migrating is a separate change.Re-running a release
ci-with-bnp.yamltriggered only onpush: tags: v*, so a release that died inpushcould not be retried without moving the tag. Addsworkflow_dispatch, gated by aguardjob that refuses a ref which is not a tag — thepushjob already rejects one via its tag/version check, but only after the arm64 build has burned ten minutes.🤖 Generated with Claude Code