Releasing¶
This guide covers the PyPI release workflow for nyc-geo-toolkit.
Release discipline¶
- Current stable line:
0.1.x - Version source: git tags via Hatch VCS
- Preferred publish trigger: GitHub Release publication
Patch releases in the 0.1.x line should stay backward-compatible. If a change
materially alters the documented public contract, consumer expectations, or
normalization semantics, cut a new minor release instead of shipping it as a
patch.
Pre-release checks¶
Before tagging a release, run:
make ci
make audit
make docs-build
make smoke-dist
If the release touches the top-level API or shared geography behavior, also
verify downstream consumers such as nyc311.
Bootstrap checklist¶
These one-time steps must be completed by a human account owner before the trusted publishing flow can be used:
- Create or verify the PyPI account that will own
nyc-geo-toolkit, and enable 2FA. - Create or verify a TestPyPI account if you want a dry run before production.
- Add a pending trusted publisher for project
nyc-geo-toolkiton both TestPyPI and PyPI using:- Owner:
random-walks - Repository:
nyc-geo-toolkit - Workflow:
.github/workflows/cd.yml - Environment:
pypi
- Owner:
- In GitHub, create the
pypienvironment and add any desired deployment protection rules. - Set the repository variable
PYPI_PUBLISH_ENABLED=trueonly when you are ready to allow publishing.
TestPyPI dry run¶
- Create the release tag, for example
0.1.3. - Push the tag.
- Run the
CDworkflow manually from that tag with:publish=truerepository=testpypi
- Verify installation from TestPyPI in a clean environment.
Production release¶
- Confirm the
pypienvironment andPYPI_PUBLISH_ENABLED=trueare in place. - Publish a GitHub Release from the tag.
The release.published trigger will publish to real PyPI automatically.