Release Guide¶
This guide is manual-first. It covers token-based PyPI releases.
Release Policy¶
- Use SemVer:
MAJOR.MINOR.PATCH. - Package version is generated automatically from git tags via
setuptools-scm. - Use annotated git tags in the form
vX.Y.Z. - Tag and package version must match exactly (for example, tag
v0.1.1produces package version0.1.1). - Never reuse a version number after it has been uploaded to PyPI.
One-Time Setup¶
Accounts and project names¶
- Create/verify account on:
- PyPI:
https://pypi.org/ - Ensure package name
stacksatsis available/owned by this project.
Local tooling¶
Use Python 3.11+ and install packaging tools:
Local token handling (default)¶
Use PyPI API tokens locally only. Do not commit them.
Example with environment variables:
If your local workflow uses PYPI_API_KEY in .env, map it at runtime:
Manual Release Checklist¶
1) Prepare release branch/PR¶
- Update
CHANGELOG.md(required): - Add user-visible changes under
## [Unreleased]. - Before tagging, move unreleased entries into the new
vX.Y.Zsection with the release date. - Start a fresh
## [Unreleased]section for follow-up work. - Ensure CI/tests are green.
- Merge to
main.
2) Local preflight checks¶
From repository root:
This should run lint, tests, build, and twine check.
If your environment has constrained SSL trust roots, scripts/release_check.sh will:
- Fall back to already-installed local build/twine when tool refresh via pip fails.
- Retry package build with python -m build --no-isolation only when isolated-build failure looks SSL-related.
- Still fail normally for non-SSL build errors.
3) Build artifacts¶
4) Publish to PyPI (default)¶
5) Tag release¶
The tag is the source of truth for the version. No manual version bump is required.
6) Post-release verification¶
- Verify package page on PyPI.
- Install from PyPI in a fresh virtual environment.
- Verify entry points:
stacksatsstacksats-plot-mvrvstacksats-plot-weights
CI Workflow Notes¶
- Pull requests run packaging checks (
package-check-pr.yml). - Pushes to
mainrun packaging checks (package-check.yml). - PyPI publishing is manual only via
scripts/publish_pypi_manual.sh. - Pull requests also run docs quality checks (
docs-check.yml): - markdown lint
- spelling checks
- link checks
- docs reference checks
- strict docs build
- Pushes to
mainpublish docs to GitHub Pages viadocs-pages.yml.
GitHub Pages Source¶
Configure Pages source to GitHub Actions.
End-to-End Validation Runbook¶
Use this sequence after workflows are merged:
- Open a PR with release notes/changelog updates and verify
package-check-pr.ymlpasses. - Create and push annotated tag
vX.Y.Z. - Run
bash scripts/publish_pypi_manual.sh. - Verify package page on PyPI.
- Install from PyPI in a fresh virtual environment and run command smoke tests.
Expected results:
- Manual publish succeeds with local
PYPI_API_KEY. - Local build and
twine checkpass before upload.
Operational Notes¶
- Do not commit PyPI tokens or store them in repository files.
- Keep
scripts/publish_pypi_manual.shas the default release path. - If a release fails after version/tag creation, bump to the next version and retry; do not overwrite versions.
- Keep contributor and policy docs current:
CONTRIBUTING.mdSECURITY.mdCODE_OF_CONDUCT.md