Making a new Python library release

This guide shows how to make a new Perfetto Python library release to PyPI.

The release process is split into two stages, both orchestrated by the tools/release_python.py script.

Stage 1: Bumping the version

The first stage creates a pull request to update the package version.

  1. Run the release script from the root of the repository.
tools/release_python.py --bump-version

The script will guide you through the following steps:

  1. Once the script completes, push the new branch and create a pull request.

  2. After the pull request is reviewed and landed, proceed to Stage 2.

Stage 2: Publishing the release and updating the download URL

The second stage publishes the package to PyPI and then creates a second pull request to update the source code with the correct download URL.

  1. Find the commit hash of the landed version bump CL from Stage 1.

  2. Run the release script again, providing the landed commit hash.

tools/release_python.py --publish --commit <landed-commit-hash>

The script will then perform the following steps:

  1. Once the script completes, push the new branch for the download_url update and create a second pull request. After this final PR is landed, the release is complete.