Skip to content

Commit 861e526

Browse files
jeremiedbbglemaitre
andcommitted
DOC Update maintainers doc now that we use towncrier (#30455)
Co-authored-by: Guillaume Lemaitre <guillaume@probabl.ai>
1 parent 761e10c commit 861e526

File tree

1 file changed

+60
-24
lines changed

1 file changed

+60
-24
lines changed

doc/developers/maintainer.rst.template

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,18 @@ Reference Steps
118118
* [ ] Update the sklearn dev0 version in main branch
119119
{%- endif %}
120120
* [ ] Set the version number in the release branch
121+
* [ ] Generate the changelog in the release branch
121122
* [ ] Check that the wheels for the release can be built successfully
122123
* [ ] Merge the PR with `[cd build]` commit message to upload wheels to the staging repo
123124
* [ ] Upload the wheels and source tarball to https://test.pypi.org
124125
* [ ] Create tag on the main repo
125126
* [ ] Confirm bot detected at https://github.com/conda-forge/scikit-learn-feedstock
126127
and wait for merge
127128
* [ ] Upload the wheels and source tarball to PyPI
129+
{%- if key != "rc" %}
128130
* [ ] Update news and what's new date in main branch
129131
* [ ] Backport news and what's new date in release branch
132+
{%- endif %}
130133
{%- if key == "final" %}
131134
* [ ] Update symlink for stable in https://github.com/scikit-learn/scikit-learn.github.io
132135
{%- endif %}
@@ -139,17 +142,62 @@ Reference Steps
139142
{%- endif %}
140143

141144
{% if key == "rc" %}
142-
- Create a PR from `main` and targeting `main` to increment the dev0 `__version__`
143-
variable in `sklearn/__init__.py`. This means while we are in the release
144-
candidate period, the latest stable is two version behind the `main` branch,
145-
instead of one. In this PR targeting `main`, you should also include a new what's
146-
new file under the `doc/whats_new/` directory so that we prepare the
147-
changelog for the next release.
145+
- Create a PR from `main` and targeting `main` to prepare for the next version. In
146+
this PR you need to:
147+
148+
- Increment the dev0 `__version__` variable in `sklearn/__init__.py`. This means
149+
that while we are in the release candidate period, the latest stable is two
150+
versions behind the `main` branch, instead of one.
151+
152+
- Include a new what's new file under the `doc/whats_new/` directory. Don't forget
153+
to add an entry for this new file in `doc/whats_new.rst`.
154+
155+
- Change the what's new file to the newly created one in the `filename` field of
156+
the `tool.towncrier` section in `pyproject.toml`.
157+
148158
{% endif %}
149159

150160
- In the release branch, change the version number `__version__` in
151161
`sklearn/__init__.py` to `{{ version_full }}`.
152162

163+
- In the release branch, generate the changelog for the incoming version, i.e
164+
`doc/whats_new/{{ version_short }}.rst`.
165+
{%- if key == "rc" %}
166+
During the RC period we want to keep the fragments when we generate the changelog
167+
because we'll generate it again for the final release, including the changes that
168+
may happen in between:
169+
170+
.. prompt:: bash
171+
172+
towncrier build --keep --version {{ version_short}}.0
173+
{%- else -%}
174+
For a non RC release, push a commit where you:
175+
176+
- generate the changelog, not keeping the fragments.
177+
178+
.. prompt:: bash
179+
180+
towncrier build --version {{ version_full}}
181+
182+
{%- if key == "final" %}
183+
- link the release highlights example
184+
{%- endif %}
185+
- add the list of contributor names. Suppose that the tag of the last release in
186+
the previous major/minor version is `{{ previous_tag }}`, then you can use the
187+
following command to retrieve the list of contributor names:
188+
189+
.. prompt:: bash
190+
191+
git shortlog -s {{ previous_tag }}.. |
192+
cut -f2- |
193+
sort --ignore-case |
194+
tr "\n" ";" |
195+
sed "s/;/, /g;s/, $//" |
196+
fold -s
197+
198+
Then create a PR targeting the `main` branch and cherry-pick this commit there.
199+
{%- endif %}
200+
153201
- Trigger the wheel builder with the `[cd build]` commit marker. See also the
154202
`workflow runs of the wheel builder
155203
<https://github.com/scikit-learn/scikit-learn/actions/workflows/wheels.yml>`_.
@@ -206,6 +254,12 @@ Reference Steps
206254
https://github.com/conda-forge/scikit-learn-feedstock. If not, submit a PR for the
207255
release, targeting the `{% if key == "rc" %}rc{% else %}main{% endif %}` branch.
208256

257+
{%- if key == "rc" %}
258+
Make sure to update the PR such that it will be synchronized with the `main`
259+
branch. In particular, backport migrations that may have been added since the last
260+
release.
261+
{% endif %}
262+
209263
- Trigger the `PyPI publishing workflow
210264
<https://github.com/scikit-learn/scikit-learn/actions/workflows/publish_pypi.yml>`_
211265
again, but this time to upload the artifacts to the real https://pypi.org/. To do
@@ -246,24 +300,6 @@ Reference Steps
246300
twine upload dist/*
247301

248302
{% if key != "rc" %}
249-
- In the `main` branch, edit the corresponding file in the `doc/whats_new` directory
250-
to update the release date
251-
{%- if key == "final" %}, link the release highlights example,{% endif %}
252-
and add the list of contributor names. Suppose that the tag of the last release in
253-
the previous major/minor version is `{{ previous_tag }}`, then you can use the
254-
following command to retrieve the list of contributor names:
255-
256-
.. prompt:: bash
257-
258-
git shortlog -s {{ previous_tag }}.. |
259-
cut -f2- |
260-
sort --ignore-case |
261-
tr "\n" ";" |
262-
sed "s/;/, /g;s/, $//" |
263-
fold -s
264-
265-
Then cherry-pick it in the release branch.
266-
267303
- In the `main` branch, edit `doc/templates/index.html` to change the "News" section
268304
in the landing page, along with the month of the release.
269305
{%- if key == "final" %}

0 commit comments

Comments
 (0)