Releasing¶
contract-checker is published to PyPI. Releases
are fully automated: publishing a GitHub Release builds the package and uploads it to PyPI.
This page is for maintainers. Contributors don't need to do anything here — your changes ship with the next release.
How versioning works¶
The package version is derived from git tags by
setuptools-scm. There is no version string to bump by
hand: the latest vX.Y.Z tag is the version. The CLI reports it at runtime from the installed
package metadata:
Cutting a release¶
- Make sure
mainis green and contains everything you want to ship. - On GitHub, go to Releases → Draft a new release.
- Create a new tag of the form
vX.Y.Z(e.g.v0.2.0), following semantic versioning, targetingmain. For a release candidate usevX.Y.ZrcN(e.g.v0.2.0rc1) and tick Set as a pre-release. - Write the release notes and click Publish release.
Use the PEP 440 tag form
Write release candidates as v0.1.0rc1, not v0.1.0-rc1. The workflow checks that the built
version equals the tag (minus the leading v) and fails before publishing if they differ.
Publishing the release triggers the
Release workflow,
which:
- Checks out the tagged commit (with full history, so
setuptools-scmcan resolve the version). - Runs the test suite against the tagged commit — PyPI uploads are immutable, so a release that fails its tests never reaches PyPI.
- Builds the sdist and wheel with
uv buildand checks their version matches the tag. - Publishes them to PyPI via Trusted Publishing (OIDC — no API tokens stored in the repo).
Once the workflow finishes, the new version is available:
Pre-releases are not installed by default. Request one explicitly: