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/release_python.py
script.
The first stage creates a pull request to update the package version.
tools/release/release_python.py --bump-version
The script will guide you through the following steps:
python/setup.py
and prompt you for the new version.version
in python/setup.py
and create a commit.Once the script completes, push the new branch and create a pull request.
After the pull request is reviewed and landed, proceed to Stage 2.
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.
Find the commit hash of the landed version bump CL from Stage 1.
Run the release script again, providing the landed commit hash.
tools/release/release_python.py --publish --commit <landed-commit-hash>
The script will then perform the following steps:
download_url
in python/setup.py
, build the package, and upload it to PyPI. You will be prompted for your PyPI credentials. For the username, use __token__
. For the password (API token), find “Perfetto PyPi API Key” on http://go/valentine.download_url
in python/setup.py
to point to the commit from the --commit
argument.download_url
update and create a second pull request. After this final PR is landed, the release is complete.