PSA: PyPI’s support for PEP 740 is now live, and enabled by default for packages that use Trusted Publishing with the canonical PyPA pypi-publish action!
The switch was silently flipped a few weeks ago, but today makes it official. Since enablement, we’ve seen over 20,000 attestations uploaded to PyPI and 20/360 (so far) of the top packages upload attestations. The latter can be tracked with Are we PEP 740 yet?.
What’s the current progress on manual attestations to support projects not hosted on GitHub (or instructions for how we can integrate our own code forges)?
Edit: Mea culpa, I should have read the linked blog more closely. Looks like there is a manual workflow available but it still requires the use of GitHub Actions (so not really sensible for those of us not using GitHub). Progress on supporting additional code forges seems to be tracked in PEP 740: Post-deployment tasks · Issue #17001 · pypi/warehouse · GitHub for the time being.
Yep! The plan is to enable GitLab in short order, followed by the other currently supported Trusted Publisher providers, followed by looking into non-TP identities (like emails).
The part that is missing from the docs is that when looking at a PyPI package the attestations are found by going to the “download files” page and then clicking the “view details” link next to an artifact. I guess that view details page has been there a long time although I haven’t looked at it before.
Looking at that attestation report I see that it notes the publisher with a link to the workflow file but that is a HEAD link. I thought that this would trace it back to the exact commit but I don’t see any identifier for the commit that was used.
The exact commit information is present, but we aren’t presenting it in the web UI yet. If you click on the transparency log entry link you’ll see it in the signing certificate’s extensions. My colleagues and I will be working on refining the web UI in the coming days!
Okay I see the workflow SHA there. Does the trusted publishing mechanism ensure that the commit itself can still be found in future? For example if someone used force push to remove the commit from the GitHub repo would it still be possible to view the code from the commit somewhere?