Use the release validation script before publishing a Saturn build:
bash scripts/validate-release.shFor a release, pass the artifact directory and upload those same validated files:
bash scripts/validate-release.sh distThe script runs the same checks that should protect a release artifact:
uv run pytestuv run ruff check .uv run mypyuv run python -m compileall -q saturn_notebookuv build --out-dir <artifact directory>uv run twine check <artifacts>uv run python scripts/check-wheel.py <built wheel>
The wheel check verifies required package data, including bundled KaTeX assets and notices, and then installs the wheel into a temporary uv virtual environment. The installed saturn command is smoke-tested with --help, version, standalone KaTeX HTML export, and a basic notebook run.
Release checklist:
- Start from a clean worktree except for intentionally ignored local files.
- Update
CHANGELOG.mdunderUnreleasedbefore cutting a release. - Optionally run
bash scripts/validate-release.shbefore tagging for confidence. - Tag the release commit, then run
bash scripts/validate-release.sh dist. - Inspect the validated wheel and sdist names in
dist/, and upload those same files.
Without an argument, the validation script builds into a temporary directory so stale files under dist/ cannot mask packaging problems. With an artifact directory argument, the directory must not already exist; this prevents uploading stale files alongside the validated build.
Saturn uses dynamic versions from git tags through uv-dynamic-versioning. The release version comes from a git tag such as 1.4.0; do not edit pyproject.toml to set the version.
-
Decide the version. For user-visible behavior changes, prefer a minor release such as
1.4.0over a patch release. -
Finalize
CHANGELOG.md. Move the currentUnreleasedcontents under a dated release heading, for example:## [1.4.0] - 2026-06-09Leave a fresh empty
## Unreleasedsection above it. -
Commit the changelog update:
git add CHANGELOG.md git commit -m "Prepare 1.4.0 release" -
Optionally run release validation before tagging for confidence:
bash scripts/validate-release.sh
-
Create an annotated tag from the release commit:
git tag -a 1.4.0 -m "Release 1.4.0" -
Build and validate the tagged artifacts:
rm -rf dist bash scripts/validate-release.sh dist
-
Verify the artifact version in the validated
dist/files:ls dist
Confirm the filenames contain the exact release version, such as
1.4.0, and do not contain.dev,.post, or+<hash>. -
Optionally upload to TestPyPI first:
uv run twine upload --repository testpypi dist/* -
Upload to PyPI:
uv run twine upload dist/*Use a PyPI API token when prompted, or set credentials in the environment:
export TWINE_USERNAME=__token__ export TWINE_PASSWORD=pypi-...
-
Push the release commit and tag:
git push origin HEAD:<branch> git push origin 1.4.0
Important cautions:
- PyPI files are immutable. If a bad
1.4.0is uploaded, another file with the same version cannot replace it. - Build only from a clean tagged commit.
- If the built filename contains
.dev,.post, or+<hash>, stop and fix the tag/version state before uploading. - If working from a detached
HEAD, attach or push the release commit to the intended branch before treating it as an official release.