Skip to content

Latest commit

 

History

History
47 lines (42 loc) · 4.06 KB

RELEASE.md

File metadata and controls

47 lines (42 loc) · 4.06 KB

Releasing matplotlylib

Follow the steps in this document to release a new version of matplotlylib.

Overview

  • The version field in pyproject.toml sets the package version. Update that field for each release. The release tag is the same version with a v prefix, for example v0.2.0 for version 0.2.0.
  • The publish-pypi workflow builds the package, uploads it to PyPI with trusted publishing (OIDC), and then creates the GitHub release. A maintainer starts the workflow by hand. PyPI trusts the workflow itself, so no API token is necessary.

Release steps

  1. Create a release branch titled release-vX.Y.Z
  2. Update the version:
    • Set version in pyproject.toml to X.Y.Z
    • PyPI never accepts a version number twice, even after you delete a release. Thus, each release needs a new version.
  3. Update the changelog:
    • Review the items in CHANGELOG.md under the "Unreleased" header. We try to follow the keepachangelog guidelines.
    • Put each item under the matching subheader: ### Added, ### Changed, ### Deprecated, ### Removed, ### Fixed, or ### Security
    • Make sure that all items follow this format:
      • - Description of change [[#XXXX](https://github.com/plotly/matplotlylib/pull/XXXX)]
      • ...followed by with thanks to @username for the contribution! if the PR is from a community contributor
    • Add any missing items for PRs that merged since the last release
    • Leave out PRs that do not change the built package, for example a README change or a minor dependency upgrade
    • Add a header ## [X.Y.Z] - YYYY-MM-DD above the unreleased items, under ## Unreleased. Leave ## Unreleased in place, with nothing under it.
    • The publish-pypi workflow copies this section into the GitHub release notes. The second word of the header must be exactly the version in brackets, without the v prefix of the tag. If it is not, the workflow stops before it creates the release.
    • Commit and push the pyproject.toml and CHANGELOG.md updates
  4. Open a PR into main. Wait for the tests to pass, get approval, and then merge into main.
  5. On your local machine, check out main, pull, and tag the merge commit of the release branch with the version number:
    git checkout main
    git pull
    git tag vX.Y.Z
    git push origin vX.Y.Z
    
  6. Release on PyPI and GitHub:
    • Open the Actions tab and select publish-pypi
    • Select "Run workflow". Leave the branch at main, enter the tag (for example vX.Y.Z), and start the run.
    • The build job makes sure that the tag exists and points to a commit on main. Then the job builds the package and makes sure that the built version matches the tag. If the version in pyproject.toml does not match the tag, the job stops before anything reaches PyPI.
    • Open the run and approve the deployment under "Review deployments". The pypi environment needs a review from the plotly/libraries_admin team.
    • The pypi-publish job uploads the files from the build job. The upload uses skip-existing, so a second run of the same tag skips the files that PyPI holds already.
    • After the upload, the github-release job creates the GitHub release for the tag. The job uses the tag as the title and the matching CHANGELOG.md section as the notes. The job attaches the same .whl and .tar.gz files that went to PyPI. A tag that contains rc becomes a pre-release.
    • If the release exists already, the job keeps the existing notes and uploads only the files that the release does not hold yet. Thus, you can run the workflow again after a partial failure.
  7. Confirm the release:
    • Open the PyPI project page to make sure that the new package version is available
    • Open the GitHub release page and make sure that the release has the correct notes and two attached files
    • If everything looks correct, the release is complete