Releasing ACCESS-MOPPy#
This guide is for maintainers creating an ACCESS-MOPPy release and for anyone
following up the automatic analysis3 environment update in
ACCESS-Analysis-Conda.
How releases are versioned#
ACCESS-MOPPy uses versioneer with the git tag prefix moppy-v. The
release version is taken from the tag itself, so there is no version string to
edit in the source tree before a release.
Examples of valid release tags:
moppy-v1.8.0
moppy-v1.8.1
moppy-v1.9.0rc1
What the numbers mean, and what the project promises not to break within a major version, is documented for users in Versioning and compatibility. Read it before choosing between a patch and a minor bump.
Final releases and pre-releases#
A tag whose version is plain digits and dots — moppy-v1.8.0 — is a final
release. Anything else — moppy-v1.9.0rc1, and the a/b suffixes used
throughout the 1.0 to 1.7 series — is a PEP 440 pre-release, and the CD
workflow treats it differently:
Final release |
Pre-release |
|
|---|---|---|
PyPI |
published |
published, but |
|
uploaded to the |
uploaded to the |
|
updated automatically |
not updated |
This is why every release up to moppy-v1.7.20b was invisible to a plain
pip install access_moppy: the whole history was pre-releases. From
1.8.0 onwards, tag without a suffix unless you specifically want a
candidate.
Before you tag#
Make sure the release commit is on the branch you want to release from and that all intended PRs are merged.
Update
CHANGELOG.rstwith a new top entry for the version you are about to tag. The changelog in this repository is the maintainer-written release summary; GitHub Releases can point back to it.Check the vocabulary submodules are in the state you want to ship. Run
git submodule update --init --recursiveso the checked-out submodules match the commits the release commit records —git submodule statusmarks a mismatch with a leading+. The CD workflow explicitly verifies that the packaged wheel and sdist contain the bundled vocabulary content, but it cannot tell that the content is the revision you meant.Run the validation you consider appropriate for the release. At minimum, make sure the CI for the release commit is green.
Confirm the worktree does not contain accidental local-only changes that should not be part of the tagged commit.
Creating the release#
Create an annotated tag on the release commit, then push it to GitHub:
git tag -a moppy-v1.8.0 -m "ACCESS-MOPPy 1.8.0"
git push origin moppy-v1.8.0
Pushing a tag matching moppy-v* triggers .github/workflows/cd.yml.
What the CD workflow does#
The release workflow has three jobs:
pypibuilds the sdist and wheel, checks that the bundled vocabulary directories are present in both artifacts, and publishes the package to PyPI.condabuilds the conda packagesaccess-moppyandaccess-moppy-esmvalfrom the tagged source and uploads them to theaccessnriAnaconda channel.update_analysis3waits foraccess-moppy-esmvalto appear in the channel, updates theanalysis3environment inACCESS-NRI/ACCESS-Analysis-Conda, and opens a pull request there. This job is skipped for a pre-release.
After tagging, watch the CD workflow in GitHub Actions and confirm that the
jobs finish successfully — all three for a final release, the first two for a
candidate.
Releasing a candidate first#
For a release that changes something users depend on, or when the release machinery itself has changed, tag a candidate before the final version:
git tag -a moppy-v1.9.0rc1 -m "ACCESS-MOPPy 1.9.0rc1"
git push origin moppy-v1.9.0rc1
The candidate reaches PyPI and the conda rc label without touching
analysis3, so it can be installed and exercised on Gadi:
pip install --pre access_moppy==1.9.0rc1
# or
conda install -c accessnri/label/rc access-moppy
When the candidate is good, tag the same commit with the final version and push that tag. The candidate is not deleted; it stays on PyPI as a pre-release and is simply never installed by default.
Checking the released artifacts#
After the workflow completes, check that:
PyPI shows the new
access_moppyversion.Anaconda shows the new
access-moppyandaccess-moppy-esmvalpackages under theaccessnrichannel, on themainlabel for a final release or therclabel for a candidate.For a final release, a PR was opened in
ACCESS-NRI/ACCESS-Analysis-Condawith a title likeBump access-moppy to <version> in analysis3 env.
How the analysis3 update works#
The final release job updates ACCESS-Analysis-Conda automatically.
It does the following:
Derives the version from the workflow input or the tagged release.
Waits until
accessnri::access-moppy-esmval==<version>is visible via the Anaconda API.Clones
ACCESS-NRI/ACCESS-Analysis-Conda.Creates or reuses a branch named
update/access-moppy-<version>.Updates the existing
access-moppy-esmval = { version = "...", ... }dependency entry inenvironments/analysis3/pixi.tomlto the released version.Runs
pixi run rebuild-envinenvironments/analysis3, which re-solvespixi.lockagainst the editedpixi.tomland exportsenvironment.ymlfrom the new lock file.Commits the regenerated
pixi.toml,pixi.lockandenvironment.ymlfiles.Pushes the branch and opens a PR if one does not already exist.
Manual analysis3 update#
If the package release succeeded but the analysis3 update did not, make the
same change manually in ACCESS-NRI/ACCESS-Analysis-Conda.
From a local clone of that repository:
git checkout -b update/access-moppy-<version> origin/main
Edit environments/analysis3/pixi.toml so the existing
access-moppy-esmval dependency points to ==<version>, then rebuild the
environment metadata:
cd environments/analysis3
pixi run rebuild-env
Commit the regenerated files and open a PR:
git add environments/analysis3/pixi.toml \
environments/analysis3/pixi.lock \
environments/analysis3/environment.yml
git commit -m "analysis3: bump access-moppy to <version>"
git push -u origin update/access-moppy-<version>
Then open the PR in GitHub against ACCESS-NRI/ACCESS-Analysis-Conda:main.
Troubleshooting#
If the release tag does not start with moppy-v, the CD workflow will not
run automatically.
If update_analysis3 was skipped, check the version the pypi job
reported. The job runs only when the version is plain digits and dots, so a
tag such as moppy-v1.8.0b or moppy-v1.8.0rc1 skips it by design.
If the conda job succeeds but update_analysis3 times out waiting for
the package, check that the uploaded version exists for
accessnri::access-moppy-esmval rather than only for access-moppy.
If the analysis3 PR already exists, the workflow reuses the branch and does
not open a duplicate PR.