Fix Python release: sdist build failure and restore tag trigger - #314
Open
TomBener wants to merge 1 commit into
Open
Fix Python release: sdist build failure and restore tag trigger#314TomBener wants to merge 1 commit into
TomBener wants to merge 1 commit into
Conversation
The `macos` job is the only one passing `--sdist`, and it has failed since
v2.14.1 because maturin cannot pack the `autocorrect` path dependency:
Caused by: Failed to add path dependency autocorrect
Caused by: File autocorrect_py-x.y.z/autocorrect/README.md was already
added from autocorrect/README.md, can't add it from README.md
`autocorrect/Cargo.toml` declares `readme = "../README.md"` while
`autocorrect/README.md` also exists, so both files end up at the same path
inside the sdist. Cargo already warns about this and silently packs the
in-package copy, so pointing `readme` at it changes nothing on crates.io.
Since `publish` needs the `macos` job, a single failure there skipped the
upload entirely and no wheels reached PyPI.
Co-Authored-By: Claude Opus 4.8 <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.
Problem
autocorrect-pyon PyPI is stuck at 2.14.0 (2025-04-26), while this repo is at v2.16.3. Versions 2.14.1 through 2.16.3 were never published.Two things went wrong, one after the other:
1. The
macosjob started failing at v2.14.1.It is the only job that passes
--sdist, and sincepublishdeclaresneeds: [macos, ...], that one failure skipped the upload entirely — the other 13 build jobs were all green, but nothing reached PyPI. This happened for both v2.14.1 and v2.14.2 (the job died after ~40s; the logs have since expired).The cause is a file collision when maturin packs the
autocorrectpath dependency into the sdist:autocorrect/Cargo.tomldeclaresreadme = "../README.md", butautocorrect/README.mdalso exists, so both files end up at the same path inside the sdist. Cargo already warns about this today and silently packs the in-package copy:This surfaced at v2.14.1 because #267 moved
autocorrect-py/pyproject.tomlfrommaturin>=0.13,<0.14tomaturin>=1.9.0,<2.0.0. maturin 0.13 did not pack path dependencies this way; every maturin from 1.8.7 through 1.11.5 hits the collision. I verified this locally version by version — 1.8.7 / 1.9.0 / 1.9.1 / 1.9.6 / 1.10.2 / 1.11.5 all fail, 1.12.6 / 1.13.3 / 1.14.1 succeed (maturin fixed it in 1.12.0, released 2026-02-14).2. The tag trigger was then removed.
9a81398("ci: Disable auto release rust, ruby, java, python.") switchedrelease-py.ymltoworkflow_dispatchonly. It has not run since 2025-07-25, so tagging a release no longer builds or publishes the Python package at all.Solution
Two lines:
autocorrect/Cargo.toml: pointreadmeat the in-packageREADME.md. This is the file Cargo already ships, so nothing changes on crates.io — it just makes the manifest match reality and removes the collision. This fixes the sdist build on every maturin version, so no version pin is needed..github/workflows/release-py.yml: restore thepush: tags: v*trigger alongsideworkflow_dispatch.Testing
Local, against the maturin version that was actually in use when CI broke (1.9.1):
The
x86_64-apple-darwincross build also succeeds.Full workflow run on my fork: https://github.com/TomBener/autocorrect/actions/runs/29832606315
All 13 build jobs pass, including
macos, and its artifact now contains what was missing:As in #227, the only expected failure is
publish, which gets a 403 from PyPI because a fork has no credentials.I did not touch
release-java.ymlorrelease-crate-gem.yml, which were disabled in the same commit — crates.io is also still at 2.14.2, but that is a separate call for you to make.