Releasing¶
Releases are published to PyPI and GitHub by the
release.yml workflow when a version tag is pushed.
One-time setup¶
On PyPI, add a Trusted Publisher for the project
pytktable: ownernbro, repositorytktable, workflowrelease.yml, environmentpypi. This lets the workflow publish without an API token.On GitHub, create the environment
pypi(Settings → Environments).
Release a version¶
Update the version in
pyproject.toml, e.g.poetry version 0.2.0(orpatch,minor,major).Move the entries under Unreleased in
CHANGELOG.mdto a section for the new version.Commit, then tag the commit with the same version:
git tag 0.2.0
Push the commit and the tag:
git push origin main 0.2.0
The workflow then:
runs the tests;
checks that the tag equals the version in
pyproject.toml;builds the sdist and wheel;
publishes them to PyPI;
creates a GitHub release with the files and generated release notes. Versions that are not plain
X.Y.Z(e.g.0.2.0rc1) are marked as pre-releases.