# 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: 1. Raise the floor in `pyproject.toml` and run `uv lock --upgrade-package solprop`. 2. Run the whole gate on the locked environment: `uv sync`, then `uv run poe check-all` and `uv run poe cov`. 3. Commit `pyproject.toml` and `uv.lock`, with a release-note fragment under `changelog.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 `..md`; [`changelog.d/README.md`](https://github.com/LupoLab/pnps/blob/main/changelog.d/README.md) gives the format and the categories. ```sh 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-`. 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: ```sh 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-files` lists 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`, then `uv run poe check`. - The repository starts from a single root commit of the finished tree, not from the development history: ```sh 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.cff` names no version; the first release commit adds it (`tests/test_release_metadata.py`). ## One-time setup | service | what to set up | |---|---| | GitHub | the repository `LupoLab/pnps`; a ruleset on `main` (no deletion, no force push, pull requests, the required check `ci-passed`, and a merge queue in place of requiring branches to be up to date) and one protecting `v*` tags; an environment `pypi` with a required reviewer, deployable only from `v*` tags; secret scanning with push protection, Dependabot security updates and private vulnerability reporting (`SECURITY.md`) | | PyPI | a pending trusted publisher for the project `pnps`: owner `LupoLab`, repository `pnps`, workflow `release.yml`, environment `pypi` | | Read the Docs | the project `pnps`, building from `.readthedocs.yaml`, with pull-request builds on for previews. Its check is not required: Read the Docs never builds the merge queue's commits, so a required check would stall the queue, and CI's `docs` job already builds the manual with warnings as errors | | Codecov | the repository, and its upload token as the secret `CODECOV_TOKEN`; CI's `coverage` job uploads `coverage.xml` on every run, for the README badge and the pull-request reports. CI enforces 100 % coverage itself, so a failed upload does not fail CI (`fail_ci_if_error: false`) | | Zenodo | the GitHub integration for `LupoLab/pnps`, which archives each GitHub release under one concept DOI (`.zenodo.json`, `CITATION.cff`) | 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 1. Mark the rolling release pull request ready **before** editing it, which freezes automatic refreshes. In a worktree of its branch, bring in `main` and collect any fragments that arrived since the last refresh: ```sh git merge origin/main uv run poe changelog-collect ``` 2. Read the collected notes as a whole and choose the version. Move the `Unreleased` section under `## [X.Y.Z] - YYYY-MM-DD`, keeping an empty `## Unreleased` above it, and give `CITATION.cff` the same `version` and `date-released` (`tests/test_release_metadata.py` checks that they agree). This is the release commit. 3. Run `uv run poe check` and `uv run poe cov`, push, and wait for `ci-passed`. Merge the pull request; the next pending fragment starts a new draft for the next cycle. 4. Tag the release commit on `main` as `vX.Y.Z` and push the tag. The release workflow checks that `CITATION.cff` names the tag's version, builds the sdist and the wheel, checks that their metadata names solprop as an ordinary requirement, and publishes them when `PUBLISH` is set. 5. Publish a GitHub release from the tag, with the changelog section as its notes; Zenodo archives it. `.zenodo.json` names no version, so the record takes it from the release. 6. 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"`).