opencv / opencv/opencv-python

Switch to trusted publishing for package upload to PyPI in CI

Open
#1,110 0 comments 0 reactions 1 assignee View on GitHub

@avdivan is already working on this.

Since Jun 18, 2025.

Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Description

Trusted publishing (with attestations) means I can know for certain that what I download from PyPI is the same artefact which was generated in GitHub CI, meaning that what I see in GitHub is the same as what is installed - handy for auditing (rather than having to manually review all of the installed files on each release).

See the Python packaging documentation, the PyPI documentation, and the official pypi-publish GitHub action documentation on trusted publishing - you'll need to configure an environment in PyPI and GitHub. You will be able to remove the OPENCV_CONTRIB_PYTHON_PASSWORD project secret.

Should be as simple as switching to the pypa/gh-action-pypi-publish action (instead of twine upload ..., setting skip-existing: true) in the "Upload wheels" steps of the Release jobs of all the workflows, and adding environment and permissions to those jobs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.