Skip to content

Switch to PyPI "trusted publishing" #2511

Closed

Description

@kandersolar

We use an API token to upload releases to PyPI. However, best practice now seems to be Trusted Publishing over API tokens (see PyPI, PyPA, scientific-python.org, PyOpenSci). The basic idea is that we can allow PyPI to recognize and trust GitHub Actions (specifically, pvlib's publishing workflow) as a valid publisher with no need for us to supply a token. This approach is supposed to be more secure than long-lived API tokens. More info here:

It looks like @AdamRJensen already uses Trusted Publishing for twoaxistracking. I propose we move pvlib-python (and the other projects in the pvlib org) to Trusted Publishing:

  1. Configure PyPI to trust our GH Actions workflow (publish.yml) as a publisher
  2. Modify our workflow to use Trusted Publishing instead of the PyPI API token it currently uses
  3. Invalidate the PyPI API token and remove it from this repo's GH Secrets

Activity

  1. added
    build tools
    on Jul 28, 2025
  2. added this to the v0.13.1 milestone on Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    build tools

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions