@@ -17,7 +17,9 @@ Before a release
1717
18181. Update authors table:
1919
20- Create a token on GitHub's page with the following permission: ``read:org ``.
20+ Create a `classic token on GitHub <https://github.com/settings/tokens/new >`_
21+ with the ``read:org `` following permission.
22+
2123 Run the following script, entering the token in:
2224 .. prompt :: bash $
2325
@@ -45,8 +47,12 @@ Before a release
4547
4648**Permissions **
4749
48- The release manager must be a *maintainer * of ``scikit-learn `` to be able to
49- publish on ``pypi.org `` and ``test.pypi.org ``.
50+ The release manager must be a *maintainer * of the ``scikit-learn/scikit-learn ``
51+ repository to be able to publish on ``pypi.org `` and ``test.pypi.org ``
52+ (via a manual trigger of a dedicated Github Actions workflow).
53+
54+ The release manager does not need extra permissions on ``pypi.org `` to publish a
55+ release in particular.
5056
5157The release manager must be a *maintainer * of the ``conda-forge/scikit-learn-feedstock ``
5258repository. This can be changed by editing the ``recipe/meta.yaml `` file in the
@@ -107,16 +113,18 @@ under the ``doc/whats_new/`` folder so PRs that target the next version can
107113contribute their changelog entries to this file in parallel to the release
108114process.
109115
110- Minor version release and bug-fix release
111- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116+ Minor version release (also known as bug-fix release)
117+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112118
113119The minor releases should include bug fixes and some relevant documentation
114120changes only. Any PR resulting in a behavior change which is not a bug fix
115- should be excluded.
121+ should be excluded. As an example, instructions are given for the ` 1.2.2 ` release.
116122
117- - Create a branch, **on your own fork ** (here referred to as `fork `) for the release.
118- For instance, to release `1.2.2 ` create the `release-1.2.2 ` branch
119- from `main ` with:
123+ - If needed, create a commit reordering the changelog section for the release.
124+ This must be done via a PR targeting on ``main ``.
125+
126+ - Create a branch, **on your own fork ** (here referred to as `fork `) for the release
127+ from `upstream/main `.
120128
121129 .. prompt :: bash $
122130
@@ -125,7 +133,7 @@ should be excluded.
125133 git checkout -b release-1.2.2 main
126134 git push -u fork release-1.2.2:release-1.2.2
127135
128- - Create a PR to the `upstream/1.2.X ` branch (not to `upstream/main `)
136+ - Create a ** draft ** PR to the `upstream/1.2.X ` branch (not to `upstream/main `)
129137 with all the desired changes.
130138
131139 - Do not push anything on that branch yet.
@@ -144,10 +152,16 @@ should be excluded.
144152 - **Do not remove lines but drop commit by replace ** ``pick `` **with ** ``drop ``
145153
146154 - Commits to pick for bug-fix release *generally * are prefixed with: `FIX `, `CI `,
147- `DOC `
155+ `DOC `. They should at least include all the commits of the merged PRs
156+ that were milestoned for this release on GitHub and/or documented as such in
157+ the changelog. It's likely that some bugfixes were documented in the
158+ changelog of the main major release instead of the next bugfix release,
159+ in which case, the matching changelog entries will need to be moved,
160+ first in the `main ` branch then backported in the release PR.
148161
149162 - Commits to drop for bug-fix release *generally * are prefixed with: `FEAT `,
150- `MAINT `, `ENH `, `API `
163+ `MAINT `, `ENH `, `API `. Reasons for not including them is to prevent change of
164+ behavior (which only must feature in breaking or major releases).
151165
152166 - After having dropped or picked commit, **do no exit ** but paste the content
153167 of the `git-rebase-todo ` message in the PR.
@@ -157,12 +171,20 @@ should be excluded.
157171
158172 - Resolve merge conflicts when they happen.
159173
160- - Create a commit reordering the changelog.
174+ - Force push the result of the rebase and the extra release commits to the release PR:
175+
176+ .. prompt :: bash $
177+
178+ git push -f fork release-1.2.2:release-1.2.2
179+
180+ - Copy the :ref: `release_checklist ` template and paste it in the description of the
181+ Pull Request to track progress.
161182
162- - Create a commit updating the version number i.e. ``sklearn.__version__ ``.
183+ - Review all the commits included in the release to make sure that they do not
184+ introduce any new feature. We should not blindly trust the commit message prefixes.
163185
164- Copy the :ref: ` release_checklist ` template and paste it in the description of the
165- Pull Request to track progress .
186+ - Remove the draft status of the release PR and invite other maintainers to review the
187+ list of included commits .
166188
167189.. _making_a_release :
168190
0 commit comments