Releasing#
pnps is pure Python: a release is one sdist and one wheel, built and published by
.github/workflows/release.yml on a v* tag. The version comes from the tag
(hatch-vcs; tests/test_release_tags.py keeps it to v* tags). Nothing merges, tags or
publishes automatically: each of those steps is a maintainer’s.
Depend on a released solprop#
pnps needs solprop’s free-space route, its low-storage march and its far-field
statistics, and takes them from PyPI: "solprop>=0.4" in dependencies. solprop
requires solprop-native, its compiled backend, at its own version, so there is no
extra. The floor is the oldest release the suite passes against.
To move to a newer solprop:
Raise the floor in
pyproject.tomland runuv lock --upgrade-package solprop.Run the whole gate on the locked environment:
uv sync, thenuv run poe check-allanduv run poe cov.Commit
pyproject.tomlanduv.lock, with a release-note fragment underchangelog.d/naming the new floor.
solprop releases are 0.x for now, and a minor release may break its API: read its changelog’s “Changed (breaking)” section before raising the floor.
To develop against an unreleased solprop, install the checkout over the locked one in
the environment, without touching the lock:
uv pip install -e ../solprop -e ../solprop/native, then run with uv run --no-sync,
since a plain uv run restores the locked versions.
The rolling release PR#
Implementation pull requests do not edit CHANGELOG.md, because every one would then
change the same lines. Each adds a Markdown fragment under changelog.d/, named
<short-slug>.<category>.md; changelog.d/README.md
gives the format and the categories.
uv run poe changelog-check # part of poe check: validate the fragments
uv run poe changelog-preview # print the assembled changelog, changing nothing
After each push to main, .github/workflows/release-notes.yml creates or refreshes
one draft pull request, Prepare the next release notes, on
chore/release-after-<last-version>. The last released version comes from
CITATION.cff. The draft groups every pending fragment under ## Unreleased and removes
the collected fragments on its branch. Correct a note by editing its fragment in an
ordinary pull request, not by editing the draft. To refresh it by hand:
gh workflow run release-notes.yml --ref main
The updater checks that its branch is exactly what it generated before writing another commit, so a manual edit stops it rather than being overwritten. It keeps the previous head as a parent, so updates are ordinary fast-forward pushes. A closed pull request, or one marked ready, pauses updates; reopen a draft closed by mistake to resume them.
Commits made with the workflow’s token do not start CI, so the draft shows no test
results while it is being refreshed. The maintainer’s release commit below starts CI,
and the required ci-passed check still has to pass.
The first release#
git ls-fileslists only what belongs in the public tree: no local paths, host names, private notes or development-register identifiers (AGENTS.md, “The public tree stands alone”).A fresh clone builds from PyPI alone:
uv sync --locked, thenuv run poe check.The repository starts from a single root commit of the finished tree, not from the development history:
scratch=$(mktemp -d) git archive --format=tar --prefix=pnps/ HEAD | tar -x -C "$scratch" cd "$scratch/pnps" git init -b main git add -A git commit -m "pnps: forward model of PNPS traces in bulk media"
Before the first release
CITATION.cffnames no version; the first release commit adds it (tests/test_release_metadata.py).
One-time setup#
service |
what to set up |
|---|---|
GitHub |
the repository |
PyPI |
a pending trusted publisher for the project |
Read the Docs |
the project |
Codecov |
the repository, and its upload token as the secret |
Zenodo |
the GitHub integration for |
Read the Docs (on its community plan), PyPI and Zenodo need the repository to be public.
There is no TestPyPI dry run: the name pnps on TestPyPI belongs to an unrelated
project. Check a release’s distributions from the workflow’s pnps-dist artifact instead.
Set the repository variable PUBLISH to true only once the trusted publisher and the
environment exist: until then the release workflow builds and checks the distributions
but does not publish them. A job that names an environment which does not exist makes
GitHub create it with no reviewer and no tag rule, so create the environment first.
Making a release#
Mark the rolling release pull request ready before editing it, which freezes automatic refreshes. In a worktree of its branch, bring in
mainand collect any fragments that arrived since the last refresh:git merge origin/main uv run poe changelog-collect
Read the collected notes as a whole and choose the version. Move the
Unreleasedsection under## [X.Y.Z] - YYYY-MM-DD, keeping an empty## Unreleasedabove it, and giveCITATION.cffthe sameversionanddate-released(tests/test_release_metadata.pychecks that they agree). This is the release commit.Run
uv run poe checkanduv run poe cov, push, and wait forci-passed. Merge the pull request; the next pending fragment starts a new draft for the next cycle.Tag the release commit on
mainasvX.Y.Zand push the tag. The release workflow checks thatCITATION.cffnames the tag’s version, builds the sdist and the wheel, checks that their metadata names solprop as an ordinary requirement, and publishes them whenPUBLISHis set.Publish a GitHub release from the tag, with the changelog section as its notes; Zenodo archives it.
.zenodo.jsonnames no version, so the record takes it from the release.Check that
pip install "pnps==X.Y.Z"works in a fresh environment (before PyPI, the same from the tag:pip install "git+https://github.com/LupoLab/pnps@vX.Y.Z").