publish: don't infer check URLs for pyx uploads #16234
Merged
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.
I think I've got this right, but could use a sanity check from @charliermarsh and @konstin 🙂
Summary
At the moment,
uv publish
obtains a check URL for pyx-based registries in one of two flows:token_store.is_known_url
The end result of either of these flows is that
uv publish
does a pre-upload check against the simple index before attempting to upload a distribution. However, this isn't needed in pyx's case, since pyx matches PyPI's behavior of idempotency on uploads -- pyx returns a 200 if the(filename, digest)
pair has already been uploaded.So, this PR just removes both of those flows. (2) is easy, (1) requires us to special-case the configuration lookup slightly to ignore the index URL if its publish URL is known as a pyx upload URL.
Notably, we do still honor a check URL for pyx if the user explicitly passes one in one the CLI. I think this is fine -- it will work in most publishing scenarios, just not ones that we're otherwise automating (i.e., Trusted Publishing).
Test Plan
I'm going to drive some e2e testing on pyx-auth-action using builds against these changes. That'll confirm that we don't secretly introduce the check URL anywhere else.