Add PyPI publish attestations during publish workflow #15678
Replies: 2 comments
-
|
The swap does what you're describing, and it's clean here because the workflow Worth spelling out why this is the route today: uv publish can't generate Two small things if a PR goes in:
Low-risk, mostly mechanical, and the Trusted Publishing setup that makes it |
Beta Was this translation helpful? Give feedback.
-
|
Hey all, just wanted to check in on this. Do the maintainers have any opinion here? Happy to answer any questions or provide clarification on anything, but if this is not desired I can just go ahead and close :) Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Hi! I noticed a lot of supply-chain hardening PRs across several FastAPI org projects lately, in wake of the many attacks in the open-source ecosystem lately. On behalf of the Python community, I'd like to thank you for taking the time and effort to make your already wonderful tools more secure :)
While reviewing these, I noticed that the org's Python packages already publish to PyPI using OIDC/Trusted Publishing via GitHub Actions, but most current releases do not yet have PyPI publish attestations. From the docs:
Because these workflows already build with
uv buildand have Trusted Publishing configured, this looks like it can be enabled with a very small change: replace the final publish command withpypa/gh-action-pypi-publish, which uses the existing Trusted Publishing/OIDC setup and generates PyPI publish attestations by default.The diff would be roughly:
This applies to most of the FastAPI organization Python packages:
fastapi,typer,asyncer,fastapi-cli,fastapi-new,sqlmodel, andannotated-doc. (annotated-docactually had attestations uploaded at its last release,0.0.4, when it was using thepypa/gh-action-pypi-publishto publish, but has since been transitioned touv publish; a potential future release would currently revert to not publishing attestations.)(Alternatively, astral-sh/attest-action would also work here while preserving the existing
uv publishstep. uv cannot produce attestations itself, but it does upload any already available attestations duringuv publish; the action generates attestations in Python for theuv publishstep to use. However, it's advertised as early-dev/unstable, so I would recommend using the official PyPA action)Would you be open to PRs for this across the package repos?
Operating System
Other
Operating System Details
N/A
FastAPI Version
N/A
Pydantic Version
N/A
Python Version
N/A
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions