Skip to content

Conversation

kandersolar
Copy link
Member

  • Closes Switch to PyPI "trusted publishing" #2511
  • I am familiar with the contributing guidelines
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

This guide is helpful: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

I also separated the PyPI publishing portion to a separate job. This is so that the additional permissions required for Trusted Publishing are only accessible to the actual upload, not the build steps (which run often, on PRs). With separate steps, the dist files have to be stored as artifacts. I think that will also make them accessible for manual download as a job output if desired, which might be handy someday.

@kandersolar kandersolar added this to the v0.13.1 milestone Sep 22, 2025
@kandersolar kandersolar added the build tools Pipelines, CI, GH actions label Sep 22, 2025
@kandersolar
Copy link
Member Author

Seems like this should be fine, although I'd appreciate an extra pair of eyes on this if anyone has the time.

After merging, I'll get Trusted Publishing set up on the PyPI side and decommission the API token we've been using.

@AdamRJensen
Copy link
Member

After merging, I'll get Trusted Publishing set up on the PyPI side and decommission the API token we've been using.

PR looks good to me. Might as well do the change now -- just make a pre-release subsequently as a test.

@wholmgren
Copy link
Member

In reviewing this I stumbled across https://github.com/hynek/build-and-inspect-python-package which is less helpful for the publishing changes in this PR but may be worth considering all at once for the building/testing/report aspects.

@kandersolar kandersolar merged commit 880b802 into pvlib:main Sep 23, 2025
5 checks passed
@kandersolar kandersolar deleted the trusted-publishing branch September 23, 2025 13:09
This was referenced Sep 23, 2025
@kandersolar
Copy link
Member Author

Following up: it worked as expected when testing with v0.13.1a1 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build tools Pipelines, CI, GH actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to PyPI "trusted publishing"

3 participants