Skip to content

[cherry-pick][2.60.0][ci] Pass --skip-existing when uploading wheels to PyPI/TestPyPI (#67254) - #67319

Merged
sai-miduthuri merged 1 commit into
releases/2.60.0from
sai-miduthuri/cherry-pick-67254-2.60.0
Oct 26, 2026
Merged

sai-miduthuri merged 1 commit into
releases/2.60.0from
sai-miduthuri/cherry-pick-67254-2.60.0

Conversation

@sai-miduthuri

Copy link
Copy Markdown
Contributor

Cherry-pick of #67254 (master commit 8bbfe80) onto releases/2.60.0.

Why

upload_wheels_to_pypi() in ci/ray_ci/automation/pypi_lib.py runs twine upload once per file with check=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 same git 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.0 references it.

Testing

Command Result
pre-commit run --files ci/ray_ci/automation/pypi_lib.py ci/ray_ci/automation/test_pypi_lib.py Passed (ruff, black, docstyle, import order, and the other applicable hooks)

I didn't run //ci/ray_ci/automation:test_pypi_lib locally. It's tagged ci_unit, so CI's :coral: reef: ci+release tooling tests job runs it on this PR.

AI assistance was used to prepare this cherry-pick.

🤖 Generated with Claude Code

)

## 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]>
@sai-miduthuri
sai-miduthuri requested a review from a team as a code owner October 23, 2026 10:26

@gemini-code-assist gemini-code-assist Bot 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.

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.

@ray-gardener ray-gardener Bot added the devprod label Oct 23, 2026
@sai-miduthuri sai-miduthuri added the go add ONLY when ready to merge, run all tests label Oct 23, 2026
@sai-miduthuri
sai-miduthuri merged commit 9a2e920 into releases/2.60.0 Oct 26, 2026
7 checks passed
@sai-miduthuri
sai-miduthuri deleted the sai-miduthuri/cherry-pick-67254-2.60.0 branch October 26, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devprod go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants