Repository navigation
[cherry-pick][2.60.0][ci] Pass --skip-existing when uploading wheels to PyPI/TestPyPI (#67254) - #67319
Merged
sai-miduthuri merged 1 commit intoOct 26, 2026
Conversation
) ## Why `upload_wheels_to_pypi()` shells out to `twine upload` **once per file**, in `sorted()` order, with `check=True`. A single rejected file therefore aborts the loop and strands every wheel after it — and because a retry starts over at file #1, which it already uploaded successfully, the retry fails immediately too. The step cannot recover on its own. This bit the 2.58.1 release. The TestPyPI upload was rejected partway through (the project had hit its size limit), leaving **9 of 24 wheels unpublished**: all four `cp314` wheels, `cp313-win_amd64`, and all four `ray_cpp` wheels (`ray_cpp` sorts after `ray-`, so none of them were attempted). Every retry of the job 400'd on the first file, and the missing wheels had to be uploaded manually. ## What Adds `--skip-existing` to the twine invocation, making the step idempotent: files already on the index are skipped rather than failing the run, so a partial upload is repaired by simply re-running the job. This only affects *duplicate file* rejections — twine still fails the step on other errors (bad auth, size limits, malformed metadata), which is the behavior we want. ## Tests `ci/ray_ci/automation/test_pypi_lib.py` asserts the exact twine argv; updated accordingly. All 9 tests pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: elliot-barn <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]> (cherry picked from commit 8bbfe80) Signed-off-by: Sai Miduthuri <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the PyPI upload automation script to include the --skip-existing flag in the twine upload command. This prevents the upload process from failing and aborting if a wheel file already exists on the PyPI index, which previously caused incomplete releases. The corresponding test suite has also been updated to reflect this change. There are no review comments, so I have no feedback to provide.
elliot-barn
approved these changes
Oct 23, 2026
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.
Cherry-pick of #67254 (master commit 8bbfe80) onto
releases/2.60.0.Why
upload_wheels_to_pypi()inci/ray_ci/automation/pypi_lib.pyrunstwine uploadonce per file withcheck=True. One rejected file aborts the rest of the upload. Every retry then fails on the first file, which is already on the index. This stranded 9 of 24 wheels in the 2.58.1 TestPyPI upload. #67254 adds--skip-existing, so a re-run skips the files already uploaded and finishes the rest.Cherry-pick details
Applied cleanly with
git cherry-pick -x. The change is identical to the master commit: the same 2 files, 8 insertions, and the samegit patch-id --stable.No prerequisite commits are missing. Both files on this branch were identical to #67254's parent, so after the pick they match master at 8bbfe80.
Not a duplicate: this branch doesn't contain #67254, and no PR against
releases/2.60.0references it.Testing
pre-commit run --files ci/ray_ci/automation/pypi_lib.py ci/ray_ci/automation/test_pypi_lib.pyI didn't run
//ci/ray_ci/automation:test_pypi_liblocally. It's taggedci_unit, so CI's:coral: reef: ci+release tooling testsjob runs it on this PR.AI assistance was used to prepare this cherry-pick.
🤖 Generated with Claude Code