KEMBAR78
publish: don't infer check URLs for pyx uploads by woodruffw · Pull Request #16234 · astral-sh/uv · GitHub
Skip to content

Conversation

woodruffw
Copy link
Member

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:

  1. Explicitly configured as an index URL in the index configuration
  2. Implicitly discovered/inferred through 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.

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw self-assigned this Oct 10, 2025
@woodruffw woodruffw added the enhancement New feature or improvement to existing functionality label Oct 10, 2025
@woodruffw woodruffw temporarily deployed to uv-test-registries October 10, 2025 15:58 — with GitHub Actions Inactive
@woodruffw
Copy link
Member Author

@woodruffw woodruffw merged commit 6fb00a9 into main Oct 10, 2025
100 checks passed
@woodruffw woodruffw deleted the ww/pyx-no-check-infer branch October 10, 2025 16:51
@konstin
Copy link
Member

konstin commented Oct 13, 2025

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.

FWIW another difference is that pre-check will skip the actual upload if the file already exists, i.e. a performance optimization.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Oct 15, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.1` -> `0.9.2` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.2`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#092)

[Compare Source](astral-sh/uv@0.9.1...0.9.2)

Released on 2025-10-10.

##### Python

- Add CPython 3.9.24.
- Add CPython 3.10.19.
- Add CPython 3.11.14.
- Add CPython 3.12.12.

##### Enhancements

- Avoid inferring check URLs for pyx in `uv publish` ([#&#8203;16234](astral-sh/uv#16234))
- Add `uv tool list --show-python` ([#&#8203;15814](astral-sh/uv#15814))

##### Documentation

- Add missing "added in" to new environment variables in reference ([#&#8203;16217](astral-sh/uv#16217))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDQuNCIsInVwZGF0ZWRJblZlciI6IjQxLjE0NC40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants