Collect and upload PEP 740 attestations during uv publish#16731
Collect and upload PEP 740 attestations during uv publish#16731
uv publish#16731Conversation
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
Signed-off-by: William Woodruff <william@astral.sh>
|
Flagging one thing: unlike |
Signed-off-by: William Woodruff <william@astral.sh>
| `uv publish` does not currently generate attestations; attestations must | ||
| be created separately before publishing. |
There was a problem hiding this comment.
Should we link or suggest how they would be created?
There was a problem hiding this comment.
The wrinkle here is that there's no good way to do this currently 😅 -- we could point users to pypi-attestations as a DIY approach, but that's a glue package that isn't really intended for direct usage.
(What gh-action-pypi-publish does is have a helper script that uses the pypi-attestations APIs.)
One option here would be to create astral-sh/pypi-attest as an action, which we'd then recommend at least until we have in-client attesting. That would only take me an hour or two to build.
Signed-off-by: William Woodruff <william@astral.sh>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.11` -> `0.9.13` | 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.13`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0913) [Compare Source](astral-sh/uv@0.9.12...0.9.13) Released on 2025-11-26. ##### Bug fixes - Revert "Allow `--with-requirements` to load extensionless inline-metadata scripts" to fix reading of requirements files from streams ([#​16861](astral-sh/uv#16861)) - Validate URL wheel tags against `Requires-Python` and required environments ([#​16824](astral-sh/uv#16824)) ##### Documentation - Drop unpublished crates from the uv crates.io README ([#​16847](astral-sh/uv#16847)) - Fix the links to uv in crates.io member READMEs ([#​16848](astral-sh/uv#16848)) ### [`v0.9.12`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0912) [Compare Source](astral-sh/uv@0.9.11...0.9.12) Released on 2025-11-24. ##### Enhancements - Allow `--with-requirements` to load extensionless inline-metadata scripts ([#​16744](astral-sh/uv#16744)) - Collect and upload PEP 740 attestations during `uv publish` ([#​16731](astral-sh/uv#16731)) - Prevent `uv export` from overwriting `pyproject.toml` ([#​16745](astral-sh/uv#16745)) ##### Documentation - Add a crates.io README for uv ([#​16809](astral-sh/uv#16809)) - Add documentation for intermediate Docker layers in a workspace ([#​16787](astral-sh/uv#16787)) - Enumerate workspace members in the uv crate README ([#​16811](astral-sh/uv#16811)) - Fix documentation links for crates ([#​16801](astral-sh/uv#16801)) - Generate a crates.io README for uv workspace members ([#​16812](astral-sh/uv#16812)) - Move the "Export" guide to the projects concept section ([#​16835](astral-sh/uv#16835)) - Update the cargo install recommendation to use crates ([#​16800](astral-sh/uv#16800)) - Use the word "internal" in crate descriptions ([#​16810](astral-sh/uv#16810)) </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:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS43IiwidXBkYXRlZEluVmVyIjoiNDIuMjEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Summary
Still working on this.TL;DR: This makes
uv publishbehave liketwine upload: when a user doesuv publish dist/*anddist/*includes attestations, we now group those attestations with their matching distribution and include them in the upload. This changes the behavior from the previous behavior, which silently skipped these (since they don't match the distribution filename format).This is a step towards #15618: we don't produce attestations within uv itself yet, but this allows uv to upload them if they're already present as part of the distribution paths.
Test Plan
I've broken the
uv-publishcrate's functionality for collecting upload inputs a part a bit to make testing of the grouping logic easier;files_for_publishingis nowgroup_files_for_publishing, with an interior helper (group_files) that does no I/O or filesystem ops. I've added unit tests for that inner helper to confirm our matching/grouping works as expected and doesn't regress on other publishing tests.Separately, it'd be nice to have some kind of integration test with an index that supports attestations, like PyPI or TestPyPI. I'll need to think a bit about how best to do that 🙂