Releasing¶
A version is published by pushing a tag v<version>. The Release workflow then runs the checks, builds the
package, publishes it on TestPyPI, waits for an approval on GitHub, publishes it on PyPI, publishes the
documentation site and creates the GitHub release with the changes of CHANGELOG.md.
- A minor or major version, such as
0.2.0or1.0.0, is first tried as a release candidate: setversion = "0.2.0rc1"inpyproject.toml, commit, then push the branch and the tag at once. A release candidate only goes to TestPyPI. Check its page and its installation, and fix with0.2.0rc2and so on until it is right. - Set the final version in
pyproject.toml, and replace## [Unreleased]with## [0.2.0] - <date>inCHANGELOG.md. Commit, then push the branch and the tag at once. - Check the version on TestPyPI, then approve the
pypienvironment in the workflow run on GitHub.
A patch version, such as 0.1.1, skips step 1. When TestPyPI shows a problem, the approval is refused and the patch
is tried again as 0.1.1rc1.
git push origin main v0.2.0rc1 sends the branch and this tag only, in one push: the checks run once, and a tag
left on the computer is never sent by mistake.