Creating a release

Preparing a release

  1. Prepare the project for a new release

    nox -s release:prepare -- --type {major,minor,patch}
    

    The release:prepare nox session affects the pyproject.toml, version.py, and files in the doc/changes directory:

    • Creates & switches to a release branch (can be skipped with --no-branch)

    • Updates the version in the pyproject.toml and version.py

    • Moves the content of unreleased changes file unreleased.md to a versioned changes file changes_<version>.md

    • Adds a description of dependency changes to the versioned changes file:

      • Only direct dependencies are described, no transitive dependencies

      • Changes are detected by comparing the current content of file poetry.lock to the latest Git tag.

    • Updates the changelog.md list with the newly created versioned changes file

    • Commits the changes (can be skipped with --no-add)

    • Pushes the changes and creates a PR (can be skipped with --no-pr)

  2. Merge your Pull Request to the default branch

  3. Trigger the release

    nox -s release:trigger
    

    Use the nox session release:trigger to:

    • Switch to & pull the changes from the default branch

    • Verify that the version to be released does not already have a git tag or GitHub release

    • Create a new tag & push it to the default branch, which will trigger the GitHub workflow cd.yml

What to do if the release failed?

The release failed during pre-release checks

  1. Delete the local tag

    git tag -d "<major>.<minor>.<patch>""
    
  2. Delete the remote tag

    git push --delete origin "<major>.<minor>.<patch>"
    
  3. Fix the issue(s) which led to the failing checks

  4. Start the release process from the beginning

One of the release steps failed (Partial Release)

  1. Check the GitHub action/workflow to see which steps failed

  2. Finish or redo the failed release steps manually

Note

Example

Scenario: Publishing of the release on GitHub was successfully but during the PyPi release, the upload step was interrupted.

Solution: Manually push the package to PyPi