Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ discriminated by tag namespace. See
- We release when there's a meaningful body of work to ship. No fixed monthly or quarterly schedule.
- Patch releases are cut from the corresponding feature release branch as fixes warrant.
- Breaking changes target the **first feature release of the month** (`YY.MM.0.0`). Subsequent feature releases in the same month (`YY.MM.1.0`, `YY.MM.2.0`, …) should not contain breaking changes unless absolutely required. Exceptions must be justified in the PR description and in the `## Breaking changes` changelog entry, alongside the standard deprecation note.
- Patch releases carry bug fixes only. A non-breaking feature that can't wait for the next release from `main` ships as the next feature release in the month (`YY.MM.N+1.0`). If `main` holds unreleased breaking changes, that release is cut from the previous tag instead of from `main` (see "Cutting a feature release from the previous tag").

## What counts as a breaking change

Expand Down Expand Up @@ -164,6 +165,18 @@ A patch release is `YY.MM.N.P` where `P >= 1`. Patches are cut from the previous
Copy the new dated `vYY.MM.N.P` block from the release branch's `CHANGELOG.md` into `CHANGELOG.md`, `git rm` the fragments the release commit consumed (`git show --name-only --diff-filter=D --format= pybamm-vYY.MM.N.P -- changelog.d`), and update `CITATION.cff`. Open a PR to `main`.
8. Delete the release branch after tagging — it is no longer needed.

### Cutting a feature release from the previous tag

Use this when a later feature release in the same month (`YY.MM.N+1.0`) must ship non-breaking features while `main` holds unreleased breaking changes. Cutting it from `main` would ship those breaks. It follows the patch flow, but bumps `N` and resets `P` to `0`.

1. Ensure the features, and any bug fixes to ship with them, are merged to `main` first via normal PRs. None may be breaking.
2. Create a new branch from the latest tag in the current feature line: `git checkout -b release/vYY.MM.N+1.0 pybamm-vYY.MM.N.P` (e.g. `release/v27.1.1.0` from `pybamm-v27.1.0.1`).
3. Cherry-pick the changes onto the new branch with `git cherry-pick -x <commit-sha-from-main>`.
4. Check and build the fragments as in step 4 of "Cutting a patch release", running `uv run python scripts/update_version.py YY.MM.N+1.0`. Commit the result on the release branch.
5. Create a GitHub _release_ with the tag `pybamm-vYY.MM.N+1.0` from the release branch (NOT from `main`). Copy the relevant `CHANGELOG.md` block into the release description. This triggers `publish_pypi.yml`.
6. Verify the release installs cleanly: `pip install pybamm==YY.MM.N+1.0`.
7. Update the changelog on `main` and delete the release branch as in steps 7 and 8 of "Cutting a patch release".

### Cutting a `pybammsolvers` release

`pybammsolvers` releases independently of PyBaMM. **`packages/pybammsolvers/src/pybammsolvers/version.py` is the single source of truth for its published version**, *not* the release tag — the `pybammsolvers-v*` tag namespace only routes the workflow. The version is a static string (dynamic VCS versioning is avoided because it would force a build during dependency resolution, which build-tool-less resolvers like Dependabot cannot do); the `sync-pybammsolvers-version` pre-commit hook mirrors `version.py` into the two static copies — `pyproject.toml` (`[project] version`, which stamps the built distribution) and `vcpkg.json` (`version-string`) — so a bump touches only one file. Keep the tag and `version.py` in lockstep, or the wrong version ships.
Expand Down
Loading