Releasing¶
pyTomoAO is published to PyPI by
.github/workflows/publish.yml, which runs when a GitHub release is created. Publishing
uses PyPI’s trusted publishing (OIDC), so no API token is stored in the repository.
The changelog¶
CHANGELOG.md at the repository root follows
Keep a Changelog and is rendered in the docs as
Changelog. Every user-visible change should land in the Unreleased section as
part of the pull request that makes it, not be reconstructed at release time.
Version numbering¶
The version lives in a single place, pyTomoAO/__init__.py:
__version__ = "2.0.0"
pyproject.toml declares dynamic = ["version"] and reads it from there at build time via
[tool.setuptools.dynamic], and Sphinx reads it from the installed package metadata, so
bumping that one string is enough. Keep CITATION.cff in step with it.
pyTomoAO follows semantic versioning:
Patch (
2.0.0 → 2.0.1) — bug fixes, documentation, no interface change.Minor (
2.0.0 → 2.1.0) — new features, new configuration keys, backwards compatible.Major (
1.0.1 → 2.0.0) — changes that break existing configuration files or scripts.
Renaming a configuration key or changing a default that alters reconstructor output is a breaking change, even though nothing in Python raises.
Cutting a release¶
Merge everything you want in the release into
dev, with CI green.Bump
__version__inpyTomoAO/__init__.pyondev.Update
CHANGELOG.md: rename theUnreleasedheading to the new version with today’s date, add a fresh emptyUnreleasedsection above it, and update the comparison links at the bottom of the file.Open a pull request from
devintomainand merge it once CI passes. This also publishes the updated documentation to GitHub Pages.Create a GitHub release targeting
main, taggedv<version>(e.g.v1.1.0), using the changelog entry as the release notes.Creating the release triggers
publish.yml. It builds the sdist and wheel, verifies them withtwine check --strict, installs the wheel into a clean virtualenv and imports it, then publishes through thepypiGitHub environment. Add a required reviewer to that environment in the repository settings if you want releases to need a second pair of eyes.Verify the result:
pip install --upgrade pyTomoAO python -c "import pyTomoAO; print(pyTomoAO.__version__)"
If a release goes wrong¶
PyPI does not allow re-uploading a version that has already been published. If a broken release ships, yank it on PyPI and publish a new patch version — do not attempt to reuse the number.