Skip to content

CI: pin flit_core with flit in the PyPI publish job; allow publishing a tag by manual dispatch - #974

Merged
mmcky merged 2 commits into
mainfrom
ci/pin-flit-core-publish
Sep 24, 2026
Merged

mmcky merged 2 commits into
mainfrom
ci/pin-flit-core-publish

Conversation

@mmcky

@mmcky mmcky commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

The v0.12.0 tag run (35960284940) passed every test job and then failed in "Publish to PyPi" before uploading anything: TypeError: SdistBuilder.build() got an unexpected keyword argument 'gen_setup_py'. PyPI still lists 0.11.4 as latest with no 0.12.0 files, so nothing is burned.

Cause. The job installs flit~=3.6, which resolves to flit 3.12.0. That release requires only flit_core>=3.12.0 with no upper bound, so pip paired it with flit_core 4.1.0 (released 16 September 2026; the 4.0 series began on 4 August, after the v0.11.4 publish in July). flit 3.12 still passes gen_setup_py to SdistBuilder.build(), which flit_core 4 removed.

Fix. Install flit~=3.12 and flit_core~=3.12 together so both stay in the 3.x series that has published this package until now. Moving to flit 4 is a separate decision.

Re-publishing the existing tag. A rerun of the failed job uses the workflow as of the tag, so it would fail the same way. Rather than delete and recreate the tag and release, this adds a workflow_dispatch trigger with a ref input, and the publish job checks out that ref. After this merges, running the workflow from main with ref=v0.12.0 builds and uploads 0.12.0 from the tagged commit:

gh workflow run ci.yml --ref main -f ref=v0.12.0

The tests job still gates publish; on a dispatch it runs against main.

Follow-up worth its own issue. Switching the job to pypa/gh-action-pypi-publish with trusted publishing would remove both the pip pins and the long-lived PYPI_TOKEN secret.

🤖 Generated with Claude Code

…lish

flit~=3.6 resolves to flit 3.12.0, which requires only flit_core>=3.12
with no upper bound, so pip now pairs it with flit_core 4.1.0 and
`flit publish` fails with a TypeError on gen_setup_py. Pin both to the
3.12 series. Add a workflow_dispatch `ref` input so an existing tag can
be published from main without re-tagging.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 24, 2026 05:41
@mmcky mmcky added the CI label Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The publish workflow logic needs adjustment to avoid context/evaluation pitfalls and to better constrain/align what gets published vs what gets tested.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR updates the CI workflow to (1) prevent PyPI publish failures caused by an incompatible flit/flit_core resolver combination, and (2) enable manually publishing an already-existing tag (e.g., v0.12.0) without recreating the tag/release.

Changes:

  • Add a workflow_dispatch trigger with a required ref input for manually publishing an existing tag.
  • Update the publish job to run on manual dispatch and to check out the requested ref.
  • Pin flit and flit_core to the 3.x series to avoid the gen_setup_py incompatibility with flit_core 4.x.
File Description
.github/​workflows/​ci.yml Adds manual dispatch publishing support and pins flit/flit_core to keep PyPI publishing stable.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml Resolved
@coveralls

coveralls commented Sep 24, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 94.0%. remained the same — ci/pin-flit-core-publish into main

Check out the dispatch input as refs/tags/<name> so a branch name or
SHA cannot resolve and a missing tag fails the checkout step.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@mmcky
mmcky merged commit bcc18b5 into main Sep 24, 2026
15 checks passed
@mmcky
mmcky deleted the ci/pin-flit-core-publish branch September 24, 2026 06:17
@mmcky mmcky mentioned this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants