Follow the steps in this document to release a new version of Kaleido.
- Versions are determined automatically from git tags by
setuptools-git-versioning. There is no hard-coded version string to update. Pushing av*tag starts thetest-and-buildworkflow, which builds and tests the package on each platform. That workflow publishes nothing. - The
publish-pypiworkflow uploads the package to PyPI with trusted publishing (OIDC), then creates the GitHub release. A maintainer starts the workflow by hand, so no API token is necessary.
- Create release branch titled
release-vX.Y.Z- We try to follow semantic versioning guidelines as much as possible
- Update the changelog:
- Review the items in
CHANGELOG.mdunder the "Unreleased" header - Ensure all items follow this format:
- Description of change [[#XXXX](https://github.com/plotly/kaleido/pull/XXXX)]- ...followed by
with thanks to @username for the contribution!if the PR is from a community contributor
- Add any missing items (PRs which were merged since the last release)
- PRs which don't change the contents of the built package (e.g. changes to the README, etc.) and minor dependency upgrades don't need to be mentioned
- Add a header
## vX.Y.Z -- YYYY-MM-DDabove the unreleased items, under## Unreleased - The
publish-pypiworkflow copies this section into the GitHub release notes. The second word of the header must be exactly the tag, or the workflow stops before it creates the release. - Commit and push the
CHANGELOG.mdupdates - Normally, the changelog is the only file that needs to be updated when making a release. The package version is determined automatically as explained in the overview above.
- Review the items in
- Open a PR into
main, wait for tests to pass, get approval, and then merge intomain - On your local machine, check out
main, pull, and tag the release branch merge commit with the version number:git checkout main git pull git tag vX.Y.Z git push origin vX.Y.Z - Watch the
test-and-buildworkflow:- The tag push starts
.github/workflows/test_and_build.yml - The workflow builds the package on Linux, Windows, and macOS for each supported Python version, then runs the tests against the built wheel
- If the workflow fails, read the failure before you continue. A flaky browser test does not block the release, but a build failure does.
- The tag push starts
- Release on PyPI and GitHub:
- Open the Actions tab and select
publish-pypi - Select "Run workflow", enter the tag (for example
vX.Y.Z), and start the run - Open the run and approve the deployment under "Review deployments"
- The
pypienvironment needs a review from theplotly/libraries_adminteam. The job waits for that approval before GitHub issues the OIDC token, so an unapproved run never reaches PyPI. - The
pypi-publishjob checks out the tag, builds the package, and confirms that the built version matches the tag. The upload usesskip-existing, so a second run of the same tag skips the files that PyPI holds already. - After the upload, the
github-releasejob creates the GitHub release for the tag. The job uses the tag as the title and the matchingCHANGELOG.mdsection as the notes. The job attaches the same.whland.tar.gzfiles that went to PyPI. A tag that containsrcbecomes a pre-release. - If the release exists already, the job keeps the existing notes and uploads only the files that the release does not hold yet. Thus you can run the workflow again after a partial failure.
- Open the Actions tab and select
- Confirm the release:
- Open https://github.com/plotly/kaleido/releases and make sure that the release has the correct notes and two attached files
- If the notes need a change, edit the release on GitHub. A second run of the workflow does not replace the notes.
That's it! Make sure to visit https://pypi.org/project/kaleido to verify that the new package version is available.