Skip to content

PEFT patch releases

Benjamin Bossan edited this page Sep 28, 2026 · 1 revision

Patch release workflow

Maintainer task: Create a patch release with cherry-picked commit(s) that:

  1. includes a review step for the patch
  2. works from fork

Assumptions:

  • upstream = canonical repository
  • origin = your fork
  • Previous release = X.Y.0
  • Patch release = X.Y.1

0. Preparation

# edit these lines:
export OLD_VERSION="X.Y.0"
export NEW_VERSION="X.Y.1"

export OLD_TAG="v${OLD_VERSION}"
export NEW_TAG="v${NEW_VERSION}"

export RELEASE_BRANCH="release/${NEW_VERSION}"
export PR_BRANCH="release-prep/${NEW_VERSION}"

Fetch current upstream state:

git fetch upstream --tags
git fetch origin

1. Create the release branch from the previous release

git switch -c "$RELEASE_BRANCH" "$OLD_TAG"
git push -u upstream "$RELEASE_BRANCH"

2. Create your PR branch

git switch -c "$PR_BRANCH"

This branch stays on your fork.

3. Cherry-pick the patch

git cherry-pick <COMMIT_SHA1> <COMMIT_SHA2>

If conflicts occur, resolve and then:

git add <files>
git cherry-pick --continue

If git reports:

The previous cherry-pick is now empty

and the change is already present after conflict resolution:

git cherry-pick --skip

If that is unexpected, inspect before skipping:

git status
git show <COMMIT_SHA>
git diff

To abandon the cherry-pick:

git cherry-pick --abort

4. Make the release-specific changes

Bump version to $NEW_VERSION in setup.py and peft.__init__.py.

Then:

git add <files>
git commit -m "Prepare ${NEW_TAG} release"

5. Push the PR branch to your fork

git push -u origin "$PR_BRANCH"

On GitHub, create a PR:

  • base repository: canonical/upstream repository
  • base branch: release/X.Y.1
  • head repository: your fork
  • head branch: release-prep/X.Y.1

The PR should contain:

  1. the cherry-picked patch
  2. the release-specific changes

6. Merge the PR

After review, merge it into the upstream release branch.

Then update your local branch:

git fetch upstream
git switch "$RELEASE_BRANCH"
git reset --hard "upstream/$RELEASE_BRANCH"

7. Release

Follow the remaining steps of the normal release procedure, except that you use the $RELEASE_BRANCH instead of the main branch.