Releasing#
Checklist#
Tests pass on the release branch:
uv run pytest, and CI is green on all platforms.Golden files are current and reviewed (see Tests).
Version: update
versioninpyproject.toml(the package is built with flit).Docs: in
docs/conf.py, set the defaultHC_SOURCE_REFto the release tag (for example"v2.0.0") so source links in the published docs point at the released code. Build with-Wto catch broken links and references.Changelog: add the release to the changelog.
Tag and release on GitHub, with the tag
v+ the version (v2.0.0). Publishing a GitHub release runs thepython-publish.ymlworkflow, which builds the wheel and sdist (uv build, flit backend), checks the version matches the tag and uploads to PyPI.After the release, set
HC_SOURCE_REFback to the development branch.
CI#
Workflow |
Runs |
|---|---|
|
On pushes and pull requests to |
|
On a published GitHub release: build, check the version against the tag and upload to PyPI. |
PyPI trusted publishing#
The publish workflow has no API token: PyPI trusts it directly. This is set up once, on pypi.org, under Publishing → Add a new publisher → GitHub:
Field |
Value |
|---|---|
Owner |
|
Repository |
|
Workflow |
|
Environment |
|
The pypi environment exists in the repository’s Settings → Environments (GitHub
creates it on the first run if it doesn’t); a required reviewer on it makes each upload
wait for approval.