How to allow/enable trusted publishing for Github project URLs on pypi.org project pages #1312
|
I noticed that twine 6.1.0 introduced support for "Trusted publishing" to pypi.org; see https://twine.readthedocs.io/en/latest/changelog.html#twine-6-1-0-2025-01-17 and #1194. It looks like it's supposed to work automatically, but i don't understand how to enable it. When i used twine a few weeks ago to upload to pypi.org with twine 6.2.0, it certainly didn't result in any Github urls on the project pages (e.g. https://pypi.org/project/PyMuPDF/) being listed as "Verified". And there were no diagnostics warning about a Trusted publishing failure. For reference:
Could anyone advise what i need to do to allow pypi to verify that i have access to the Github repositories listed in the wheel metadata? Thanks in advance. |
Replies: 4 comments 4 replies
|
Hi @julian-smith-artifex-com, please see https://docs.pypi.org/trusted-publishers/adding-a-publisher/ Once you've enrolled your publisher on PyPI, you can remove your API token from CI/CD and add |
|
Thanks, but i'm a bit confused. I'm not uploading wheels by running twine in a Github action or similar. Instead i upload wheels by running twine on my local unix system. So while we use Github to host the code (https://github.com/pymupdf/pymupdf), i don't use Github as a publisher. So i don't know how to fill in the |
|
Ok, good to know thanks. So how can i persuade pypi to make https://github.com/pymupdf/pymupdf show the |
|
Ok, thanks for clarifying. (I wonder whether the twine/pypi docs could be updated to include this information.) |
PyPI's verified links feature currently requires Trusted Publishing, since that's the only automatic way PyPI can cryptographically verify a link between a PyPI project and its source URLs. So unfortunately there's no real way to get locally published URLs marked as verified, since there's no way to verify them ATM.
(This might change in the future, but also note that URL verification doesn't affect a package in any positive or negative way.)