Add PEP 740 publish attestations to PyPI releases#3230
Open
shaanmajid wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
The
release-pypijob inrelease.ymlpublishes to PyPI over Trusted Publishing but uploads no PEP 740 attestations, so the wheels get no index-served provenance (e.g., none of the v1.14.0 files carry aprovenancein the JSON API).There's already an
actions/atteststep in that job, but it seems to mirrorrelease-githuband only writes a GitHub-side attestation (example). This technically works, but is kind of a mismatch; this isn't where Python consumers see provenance -- PEP 740 is the PyPI-native version.Changes
astral-sh/attest-actionon non-dry-runs to generate PEP 740 attestations right beforeuv publish, which uploads them automatically.actions/atteststep (and its required permissions, which are no longer necessary)I used
astral-sh/attest-actionsince it fits the current uv flow with the smallest diff, and best preserves existing dry-run semantics. An alternative would be to move the publish topypa/gh-action-pypi-publish, which uses Trusted Publishing + PEP 740 by default, which is also used bypyo3/pyo3). Happy to change in that direction if maintainers prefer :^)Note:
release-github's attestations are untouched; those will continue to be available via GitHub Releases as before.