-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Collect and upload PEP 740 attestations during uv publish
#16731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
|
Flagging one thing: unlike |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Thanks! I'm guessing maybe this belongs under |
Signed-off-by: William Woodruff <[email protected]>
|
I added a small section to the packaging guide, but I'm not sure how much detail to include. One thing that made me realize is that we don't really expose a knob for this at the moment -- maybe it makes sense to add |
|
The knobs and their names sound good |
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
| `uv publish` does not currently generate attestations; attestations must | ||
| be created separately before publishing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link or suggest how they would be created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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 🙂