@@ -18,6 +18,47 @@ Release guide
1818 ``remote `` and a read/write remote is ``DANGER ``
1919
2020
21+ .. _release_feature_freeze :
22+
23+ Making the release branch
24+ =========================
25+
26+ When a new minor release (vX.Y.0) is approaching, a new release branch must be made.
27+ When precisely this should happen is up to the release manager, but this point is where
28+ most new features intended for the minor release are merged and you are entering a
29+ feature freeze (i.e. newly implemented features will be going into vX.Y+1).
30+ This does not necessarily mean that no further changes will be made prior to release,
31+ just that those changes will be made using the backport system.
32+
33+ For an upcoming ``v3.7.0 `` release, first create the branch::
34+
35+ git switch main
36+ git pull
37+ git switch -c v3.7.x
38+ git push DANGER v3.7.x
39+
40+ Update the ``v3.7.0 `` milestone so that the description reads::
41+
42+ New features and API changes
43+
44+ on-merge: backport to v3.7.x
45+
46+ Micro versions should instead read::
47+
48+ Bugfixes and docstring changes
49+
50+ on-merge: backport to v3.7.x
51+
52+ Check all active milestones for consistency. Older milestones should also backport
53+ to higher minor versions (e.g. ``v3.6.3 `` and ``v3.6-doc `` should backport to both
54+ ``v3.6.x `` and ``v3.7.x `` once the ``v3.7.x `` branch exists and while PR backports are
55+ still targeting ``v3.6.x ``)
56+
57+ Create the milestone for the next-next minor release (i.e. ``v3.9.0 ``, as ``v3.8.0 ``
58+ should already exist). While most active items should go in the next minor release,
59+ this milestone can help with longer term planning, especially around deprecation
60+ cycles.
61+
2162.. _release-testing :
2263
2364Testing
@@ -34,6 +75,14 @@ In addition the following test should be run and manually inspected::
3475
3576 python tools/memleak.py agg 1000 agg.pdf
3677
78+ Run the User Acceptance Tests for the NBAgg and ipympl backends::
79+
80+ jupyter notebook lib/matplotlib/backends/web_backend/nbagg_uat.ipynb
81+
82+ For ipympl, restart the kernel, add a cell for ``%matplotlib widget `` and do
83+ not run the cell with ``matplotlib.use('nbagg') ``. Tests which check
84+ ``connection_info ``, use ``reshow ``, or test the OO interface are not expected
85+ to work for ``ipympl ``.
3786
3887.. _release_ghstats :
3988
@@ -50,16 +99,16 @@ prepare this list:
5099 b. Change the link target at the top of the file.
51100 c. Remove the "Previous GitHub Stats" section at the end.
52101
53- For example, when updating from v3.2 .0 to v3.2 .1::
102+ For example, when updating from v3.7 .0 to v3.7 .1::
54103
55- cp doc/users/github_stats.rst doc/users/prev_whats_new/github_stats_3.2 .0.rst
56- $EDITOR doc/users/prev_whats_new/github_stats_3.2 .0.rst
104+ cp doc/users/github_stats.rst doc/users/prev_whats_new/github_stats_3.7 .0.rst
105+ $EDITOR doc/users/prev_whats_new/github_stats_3.7 .0.rst
57106 # Change contents as noted above.
58- git add doc/users/prev_whats_new/github_stats_3.2 .0.rst
107+ git add doc/users/prev_whats_new/github_stats_3.7 .0.rst
59108
601092. Re-generate the updated stats::
61110
62- python tools/github_stats.py --since-tag v3.2 .0 --milestone=v3.2 .1 \
111+ python tools/github_stats.py --since-tag v3.7 .0 --milestone=v3.7 .1 \
63112 --project 'matplotlib/matplotlib' --links > doc/users/github_stats.rst
64113
651143. Review and commit changes. Some issue/PR titles may not be valid reST (the most
@@ -87,7 +136,7 @@ Update and validate the docs
87136Merge ``*-doc `` branch
88137----------------------
89138
90- Merge the most recent 'doc' branch (e.g., ``v3.2 .0-doc ``) into the branch you
139+ Merge the most recent 'doc' branch (e.g., ``v3.7 .0-doc ``) into the branch you
91140are going to tag on and delete the doc branch on GitHub.
92141
93142Update supported versions in Security Policy
@@ -193,7 +242,7 @@ notes in the commit message::
193242
194243and then create a signed, annotated tag with the same text in the body message::
195244
196- git tag -a -s v2.0 .0
245+ git tag -a -s v3.7 .0
197246
198247which will prompt you for your GPG key password and an annotation. For pre-releases it
199248is important to follow :pep: `440 ` so that the build artifacts will sort correctly in
@@ -206,9 +255,12 @@ it is important to move all branches away from the commit with the tag [#]_::
206255
207256Finally, push the tag to GitHub::
208257
209- git push DANGER main v2.0 .0
258+ git push DANGER v3.7.x v3.7 .0
210259
211260Congratulations, the scariest part is done!
261+ This assumes the release branch has already been made.
262+ Usually this is done at the time of feature freeze for a minor release (which often
263+ coincides with the last patch release of the previous minor version)
212264
213265.. [# ] The tarball that is provided by GitHub is produced using `git archive `_.
214266 We use setuptools_scm _ which uses a format string in
@@ -225,25 +277,29 @@ Congratulations, the scariest part is done!
225277
226278 To generate the file that GitHub does use::
227279
228- git archive v2.0 .0 -o matplotlib-2.0 .0.tar.gz --prefix=matplotlib-2.0 .0/
280+ git archive v3.7 .0 -o matplotlib-3.7 .0.tar.gz --prefix=matplotlib-3.7 .0/
229281
230282 .. _git archive : https://git-scm.com/docs/git-archive
231283.. _setuptools_scm : https://github.com/pypa/setuptools_scm
232284
233285If this is a final release, also create a 'doc' branch (this is not
234286done for pre-releases)::
235287
236- git branch v2.0 .0-doc
237- git push DANGER v2.0 .0-doc
288+ git branch v3.7 .0-doc
289+ git push DANGER v3.7 .0-doc
238290
239- and if this is a major or minor release, also create a bug-fix branch (a micro
240- release will be cut from this branch)::
291+ Update (or create) the ``v3.7-doc `` milestone.
292+ The description should include the instruction for meeseeksmachine to backport changes
293+ with the ``v3.7-doc `` milestone to both the ``v3.7.x `` branch and the ``v3.7.0-doc `` branch::
241294
242- git branch v2.0.x
295+ Documentation changes (.rst files and examples)
243296
244- On this branch un-comment the globs from :ref: `release_chkdocs `. And then ::
297+ on-merge: backport to v3.7.x
298+ on-merge: backport to v3.7.0-doc
245299
246- git push DANGER v2.0.x
300+ Check all active milestones for consistency. Older doc milestones should also backport to
301+ higher minor versions (e.g. ``v3.6-doc `` should backport to both ``v3.6.x `` and ``v3.7.x ``
302+ if the ``v3.7.x `` branch exists)
247303
248304
249305.. _release_DOI :
@@ -259,16 +315,15 @@ automatically produce one once the tag is pushed). Add the DOI post-fix and vers
259315the dictionary in :file: `tools/cache_zenodo_svg.py ` and run the script.
260316
261317This will download the new SVG to :file: `doc/_static/zenodo_cache/{ postfix } .svg ` and
262- edit :file: `doc/citing.rst `. Commit the new SVG, the change to
263- :file: `tools/cache_zenodo_svg.py `, and the changes to :file: `doc/citing.rst ` to the
264- VER-doc branch and push to GitHub. ::
318+ edit :file: `doc/users/project/ citing.rst `. Commit the new SVG, the change to
319+ :file: `tools/cache_zenodo_svg.py `, and the changes to :file: `doc/users/project/ citing.rst `
320+ to the VER-doc branch and push to GitHub. ::
265321
266- git checkout v2.0 .0-doc
322+ git checkout v3.7 .0-doc
267323 $EDITOR tools/cache_zenodo_svg.py
268324 python tools/cache_zenodo_svg.py
269- $EDITOR doc/citing.html
270325 git commit -a
271- git push DANGER v2.0 .0-doc:v2.0 .0-doc
326+ git push DANGER v3.7 .0-doc:v3.7 .0-doc
272327
273328
274329.. _release_bld_bin :
@@ -300,7 +355,7 @@ Make distribution and upload to PyPI
300355Once you have collected all of the wheels (expect this to take a few hours), generate
301356the tarball::
302357
303- git checkout v2.0 .0
358+ git checkout v3.7 .0
304359 git clean -xfd
305360 python -m build --sdist
306361
@@ -327,7 +382,7 @@ build the docs from the ``ver-doc`` branch. An easy way to arrange this is::
327382
328383 pip install matplotlib
329384 pip install -r requirements/doc/doc-requirements.txt
330- git checkout v2.0 .0-doc
385+ git checkout v3.7 .0-doc
331386 git clean -xfd
332387 make -Cdoc O="-t release -j$(nproc)" html latexpdf LATEXMKOPTS="-silent -f"
333388
@@ -347,22 +402,22 @@ Assuming you have this repository checked out in the same directory as
347402matplotlib ::
348403
349404 cd ../matplotlib.github.com
350- cp -a ../matplotlib/doc/build/html 2.0 .0
351- rm 2.0 .0/.buildinfo
352- cp ../matplotlib/doc/build/latex/Matplotlib.pdf 2.0 .0
405+ cp -a ../matplotlib/doc/build/html 3.7 .0
406+ rm 3.7 .0/.buildinfo
407+ cp ../matplotlib/doc/build/latex/Matplotlib.pdf 3.7 .0
353408
354409which will copy the built docs over. If this is a final release, link the
355410``stable `` subdirectory to the newest version::
356411
357412 rm stable
358- ln -s 2.0 .0 stable
413+ ln -s 3.7 .0 stable
359414
360- You will need to manually edit :file: `versions.html ` to show the last
361- 3 tagged versions. You will also need to edit :file: `sitemap.xml ` to include
415+ You will need to manually edit :file: `versions.html ` to show the released version.
416+ You will also need to edit :file: `sitemap.xml ` to include
362417the newly released version. Now commit and push everything to GitHub ::
363418
364419 git add *
365- git commit -a -m 'Updating docs for v2.0 .0'
420+ git commit -a -m 'Updating docs for v3.7 .0'
366421 git push DANGER main
367422
368423Congratulations you have now done the third scariest part!
@@ -372,6 +427,33 @@ If you have access, clear the CloudFlare caches.
372427It typically takes about 5-10 minutes for the website to process the push and update the
373428live web page (remember to clear your browser cache).
374429
430+ .. _release_merge_up :
431+
432+ Merge up changes to main
433+ ========================
434+
435+ After a release is done, the changes from the release branch should be merged into the
436+ ``main `` branch. This is primarily done so that the released tag is on the main branch
437+ so ``git describe `` (and thus ``setuptools-scm ``) has the most current tag.
438+ Secondarily, changes made during release (including removing individualized release
439+ notes, fixing broken links, and updating the version switcher) are bubbled up to
440+ ``main ``.
441+
442+ Git conflicts are very likely to arise, though aside from changes made directly to the
443+ release branch (mostly as part of the release), they should be relatively-easily resolved
444+ by using the version from ``main ``. This is not a universal rule, and care should be
445+ taken to ensure correctness::
446+
447+ git switch main
448+ git pull
449+ git switch -c merge_up_v3.7.0
450+ git merge v3.7.x
451+ # resolve conflicts
452+ git merge --continue
453+
454+ Due to branch protections for the ``main `` branch, this is merged via a standard pull
455+ request, though the PR cleanliness status check is expected to fail. The PR should not
456+ be squashed because the intent is to merge the branch histories.
375457
376458Announcing
377459==========
@@ -384,8 +466,10 @@ version of the release notes along with acknowledgments should be sent to
384466385467
386468In addition, announcements should be made on social networks (e.g., Twitter via the
387- ``@matplotlib `` account, any other via personal accounts). `NumFOCUS
388- <https://numfocus.org/> `__ should be contacted for inclusion in their newsletter.
469+ ``@matplotlib `` account, any other via personal accounts).
470+
471+ Add a release announcement to the ``mpl-brochure-site `` "News" section of
472+ ``docs/body.html ``, linking to the discourse page for the announcement.
389473
390474
391475Conda packages
0 commit comments