-
Notifications
You must be signed in to change notification settings - Fork 70
Use gh-action-pypi-publish v1 release branch, tp. #215
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
Conversation
The Trusted Publisher setup in PyPI is very easy, all you need is the following four pieces of information:
Fill these in on the CyLP Publishing settings page. The workflow uses a new GitHub deployment environment named You could first test the workflow by temporarily having it push to
provided you first configure trusted publishing on test.pypi.org first. I'd also change the GHA deployment environment name to |
OK, thanks, @mjpieters. I saw the message about the legacy publishing in the out and I will merge this PR to address that, but I got sidetracked running down the other error that is indicated there. It looks like there is more going on than just the legacy publishing. The error message seemed to indicate some problem with the metadata. Looking into that, it seems we should either specify the metadata fields in Anyway, that did not fix the error. I downloaded the macOS wheels locally and tried to read their metadata with
After a lot of Googling and asking AI, I finally, I just opened up the
I can see in the logs that Anyway, I will merge your PRs and see what happens, but I don't see how it can change the contents of the |
@mjpieters, I just pushed a commit that will try to publish to |
There is issue with the metadata. I had verified the wheels with the most recent twine release and it's all fine. The error is purely due to the old tooling not knowing what to do with the Metadata version 2.4 data. The wheels also work perfectly, I had no issue installing the macos arm64 versions and run my project tests against them. I can't comment on the use of |
It's working! :-) |
The release branch makes sure future releases don't fail when newer metadata versions are used or where the PyPI publishing tooling needs to be updated to match changes in PyPI itself. Also, switch to using trusted publishing, where GitHub signs wheels so users can know that the wheels where built by the official CyLP github repository.
87bb7ae
to
3b8071a
Compare
@tkralphs: On test.pypi you can see that the wheels all have full attestations attached too now. I do note that the |
OK, great. Add this to the pantheon of incredibly unhelpful error messages. And to the list of times I ignored the elephant in the room :). It still seems a bit weird that Out of curiosity, why do you need
The documentation here doesn't add it. |
The action documentation does. When you include a URL, GitHub will display it in relevant locations such as the deployments list for the |
Ugh, I should have tested. The case is wrong. It should be |
I cancelled the workflow and fixed that typo. Let's hope this is the last thing! |
OK, all good now! Thanks for the help! |
It's all great! I can see the new release on PyPI, and you can see that the pypi deployments page here on GH includes the environment URL set in the workflow. :-) With the |
Thanks so much. |
The release branch makes sure future releases don't fail when newer metadata versions are used or where the PyPI publishing tooling needs to be updated to match changes in PyPI itself.
Also, switch to using trusted publishing, where GitHub signs wheels so users can know that the wheels where built by the official CyLP github repository.
Important
Trusted publishing requires changes to the CyLP PyPI project, see Adding a Trusted Publisher to an existing PyPI project in the PyPI documentation.
Once this workflow is shown to be working, you'll also want to remove the
PYPI_API_TOKEN
secret from this project, and revoke that token in PyPI.Fixes #214