1+ .. highlight :: bash
2+
13.. _release-guide :
24
3- *************
4- Release Guide
5- *************
5+ ===============
6+ Release Guide
7+ ===============
68
79A guide for developers who are doing a matplotlib release.
810
9- Development (beta/RC) release checklist
10- ---------------------------------------
11-
12- - [ ] Testing
13- - [ ] Create empty REL: commit
14- - [ ] Create tag
15- - [ ] Push tags + branches to GH
16- - [ ] Notify mac/windows/conda builders
17- - [ ] Merge everything to master
18- - [ ] announce release
19-
20- Final release checklist
21- -----------------------
22-
23- - [ ] Testing
24- - [ ] update gh states
25- - [ ] Create empty REL: commit
26- - [ ] Create tag
27- - [ ] Create branches
28- - [ ] Push tags + branches to GH
29- - [ ] release / DOI management
30- - [ ] Notify mac/windows/conda builders
31- - [ ] Merge everything to master
32- - [ ] build documentation
33- - [ ] upload to pypi / sf
34- - [ ] deploy updated documentation
35- - [ ] announce release
36-
37- Details
38- -------
11+ All Releases
12+ ============
3913
4014.. _release-testing :
4115
4216Testing
43- =======
17+ -------
4418
4519We use `travis-ci <https://travis-ci.org/matplotlib/matplotlib >`__ for
4620continuous integration. When preparing for a release, the final
4721tagged commit should be tested locally before it is uploaded::
4822
4923 python tests.py --processes=8 --process-timeout=300
5024
51- In addition ::
25+ In addition the following two tests should be run and manually inspected ::
5226
53- python unit/memleak_hawaii3.py
54-
55- should be run to check for memory leaks. Optionally, make sure ::
56-
57- cd examples/tests/
27+ python unit/memleak_hawaii3.py``
28+ pushd examples/tests/
5829 python backend_driver.py
59-
60- runs without errors and check the output of the PNG, PDF, PS and SVG
61- backends.
30+ popd
6231
6332
6433.. _release_ghstats :
6534
6635Github Stats
67- ============
36+ ------------
6837
69- To make sure everyone's hard work gets credited, regenerate the github
70- stats. In the project root run ::
38+ We automatically extract github issue, PRs, and authors from the github via the API::
7139
72- python tools/github_stats.py --since-tag $TAG --project 'matplotlib/matplotlib' --links > doc/users/github_stats.rst
40+ python tools/github_stats.py --since-tag $TAG --project 'matplotlib/matplotlib' --links --milestone v2.0.0 > doc/users/github_stats.rst
7341
42+ Review and commit changes. Some issue/PR titles may not be valid rst (the most common issue is
43+ ``* `` which is interpreted as unclosed markup).
7444
75- where `$TAG ` is the tag of the last major release. This will generate
76- stats for all work done since that release.
45+ .. _release_chkdocs :
7746
78- - [ ] review and commit changes
79- - [ ] check for valid rst
80- - [ ] re-add github-stats link
47+ Check Docs
48+ ----------
49+
50+ Before tagging, make sure that the docs build cleanly ::
51+
52+ pushd doc
53+ python make.py html pdf -n 16
54+ popd
55+
56+ After the docs are built, check that all of the links, internal and external, are still
57+ valid. We use ``linkchecker `` for this, which has not been ported to python3 yet. You will
58+ need to create a python2 enviroment with ``requests==2.9.0 `` and linkchecker ::
59+
60+ conda create -p /tmp/lnkchk python=2 requests==2.9.0
61+ source activate /tmp/lnkchk
62+ pip install linkchecker
63+ pushd docs/build/html
64+ linkchecker index.html --check-extern
65+
66+ Address any issues which may arise. The internal links are checked on travis, this should only
67+ flag failed external links.
8168
8269.. _release_tag :
8370
84- Create Tag
85- ==========
71+ Create release commit and tag
72+ -----------------------------
73+
74+ To create the tag, first create an empty commit with a very terse set of the release notes
75+ in the commit message ::
76+
77+ git commit --allow-empty
78+
79+ and then create a signed, annotated tag with the same text in the body
80+ message ::
81+
82+ git tag -a -s v2.0.0
83+
84+ which will prompt you for your gpg key password and an annotation.
85+ For pre releases it is important to follow :pep: `440 ` so than the
86+ build artifacts will sort correctly in pypi. Finally, push the tag to github ::
8687
87- On the tip of the current branch::
88+ git push -t DANGER v2.0.0
89+
90+ Congratulations, the scariest part is done!
91+
92+ To prevent issues with any down-stream builders which download the
93+ tarball from github it is important to move all branches away from the commit
94+ with the tag ::
8895
8996 git commit --allow-empty
90- git tag -a -s v1.5.0
97+ git push DANGER master
9198
92- The commit and tag message should be very terse release notes should look something
93- like
99+ If this is a final release, also create a 'doc' branch (this is not
100+ done for pre-releases)::
94101
95- REL: vX.Y.Z
102+ git branch v2.0.0-doc
103+ git push DANGER v2.0.0-doc
96104
97- Something brief description
105+ and if this is a major or minor release, also create a bug-fix branch (a
106+ micro release will be cut off of this branch)::
98107
99- Development releases should be post-fixed with the proper string following
100- ` PEP 440<https://www.python.org/dev/peps/pep-0440/> `__ conventions.
108+ git branch v2.0.x
109+ git push DANGER v2.0.x
101110
102- .. _release-branching :
103111
104- Branching
105- =========
106112
107- Once all the tests are passing and you are ready to do a release, you
108- need to create a release branch. These only need to be created when
109- the second part of the version number changes::
113+ .. _release_tag :
110114
111- git checkout -b v1.1.x
112- git push [email protected] :matplotlib/matplotlib.git v1.1.x 115+ Release Management / DOI
116+ ------------------------
113117
118+ Via the github UI (chase down link), turn the newly pushed tag into a
119+ release. If this is a pre-release remember to mark it as such.
114120
115- .. _release-packaging :
121+ For final releases also get a DOI from `zenodo
122+ <https://zenodo.org/> `__ and edit :file: `doc/_templates/citing.html `
123+ with DOI link and commit to the VER-doc branch and push to github ::
116124
117- Packaging
118- =========
125+ git push DANGER v2.0.0-doc:v2.0.0-doc
119126
120- * Make sure the :file: `MANIFEST.in ` is up to date and remove
121- :file: `MANIFEST ` so it will be rebuilt by MANIFEST.in
127+ .. _release_bld_bin :
122128
123- * run `git clean ` in the mpl git directory before building the sdist
129+ Building binaries
130+ -----------------
124131
125- * unpack the sdist and make sure you can build from that directory
132+ We distribute mac, windows, and many linux wheels as well as a source
133+ tarball via pypi. Before uploading anything, contact the various
134+ builders. Mac and manylinux wheels are built on travis
135+ . You need to edit the
136+ :file: `.travis.yml ` file and push to master of `the build
137+ project <https://github.com/MacPython/matplotlib-wheels> `__.
126138
127- * Use :file: `setup.cfg ` to set the default backends. For windows and
128- OSX, the default backend should be TkAgg. You should also turn on
129- or off any platform specific build options you need. Importantly,
130- you also need to make sure that you delete the :file: `build ` dir
131- after any changes to :file: `setup.cfg ` before rebuilding since cruft
132- in the :file: `build ` dir can get carried along.
139+ Update the ``master `` branch (for pre-releases the ``devel `` branch)
140+ of the `conda-forge feedstock
141+ <https://github.com/conda-forge/matplotlib-feedstock> `__ via pull request.
133142
134- * On windows, unix2dos the rc file.
143+ If this is a final release the following down-steam packagers should be contacted:
135144
136- * We have a Makefile for the OS X builds in the mpl source dir
137- :file: `release/osx `, so use this to prepare the OS X releases.
145+ - debian
146+ - fedora
147+ - arch
148+ - gentoo
149+ - macports
150+ - homebrew
151+ - Christoph Gohlke
152+ - continuum
153+ - enthought
138154
139- * We have a Makefile for the win32 mingw builds in the mpl source dir
140- :file: `release/win32 ` which you can use this to prepare the windows
141- releases.
155+ This can be done ahead of collecting all of the binaries and uploading to pypi.
142156
157+ .. _release_upload_bin :
143158
144- Update PyPI
145- ===========
159+ make distribution and upload to pypi / SF
160+ -----------------------------------------
146161
147- This step tells PyPI about the release and uploads a source
148- tarball. This should only be done with final (non-release-candidate)
149- releases, since doing so will hide any available stable releases.
162+ Once you have collected all of the wheels, generate the tarball ::
150163
151- You may need to set up your ` .pypirc ` file as described in the
152- ` distutils register command documentation
153- <http://docs. python.org/2/distutils/packageindex.html> `_.
164+ git checkout v2.0.0
165+ git clean -xfd
166+ python setup.py sdist
154167
155- Then updating the record on PyPI is as simple as::
168+ and copy all of the wheels into :file: `dist ` directory. You should use
169+ ``twine `` to upload all of the files to pypi ::
156170
157- python setup.py register
171+ twine -s upload dist/matplotlib*tar.gz
172+ twine upload dist/*whl
158173
159- This will hide any previous releases automatically.
174+ Congratulations, you have now done the second scariest part!
160175
161- Then, to upload the source tarball::
176+ Additionally, for a final release, upload all of the files to sourceforge.
162177
163- rm -rf dist
164- python setup.py sdist upload
178+ .. _release_docs :
165179
180+ Build and Deploy Documentation
181+ ------------------------------
182+
183+ To build the documentation you must have the tagged version installed, but
184+ build the docs from the ``ver-doc `` branch. An easy way to arrange this is::
185+
186+ pip install matplotlib
187+ pip install -r doc-requirements.txt
188+ git checkout v2.0.0-doc
189+ git clean -xfd
190+ cd doc
191+ pyhton make.py html latex -n 16
192+
193+ which will build both the html and pdf version of the documentation.
166194
167- Build and deploy Documentation
168- ==============================
169195
170196The built documentation exists in the `matplotlib.github.com
171- <https://github.com/matplotlib/matplotlib.github.com/> `_ repository.
197+ <https://github.com/matplotlib/matplotlib.github.com/> `__ repository.
172198Pushing changes to master automatically updates the website.
173199
174200The documentation is organized by version. At the root of the tree is
@@ -177,39 +203,48 @@ there are directories containing the documentation for older versions.
177203The documentation for current master are built on travis and push to
178204the `devdocs <https://github.com/matplotlib/devdocs/ >`__ repository.
179205These are available `matplotlib.org/devdocs
180- <http://matplotlib.org/devdocs> `__. There is a symlink directory
181- with the name of the most recently released version that points to the
182- root. With each new release, these directories may need to be
183- reorganized accordingly. Any time these version directories are added
184- or removed, the `versions.html ` file (which contains a list of the
185- available documentation versions for the user) must also be updated.
206+ <http://matplotlib.org/devdocs> `__.
186207
208+ Assuming you have this repository checked out in the same directory as
209+ matplotlib ::
187210
188- In the matplotlib source repository, build the documentation::
211+ cd ../matplotlib.github.com
212+ mkdir 2.0.0
213+ rsync -a ../matplotlib/doc/build/html/* 2.0.0
214+ cp ../matplotlib/doc/build/html/Matplotlib.pdf 2.0.0
189215
190- cd doc
191- python make.py html
192- python make.py latex
216+ which will copy the built docs over. If this is a final release, also
217+ replace the top-level docs ::
193218
194- Then copy the build products into your local checkout of the
195- `matplotlib.github.com ` repository (assuming here to be checked out in
196- `~/matplotlib.github.com `::
219+ rsync -a 2.0.0/* ./
197220
198- cp -r build/html/* ~/matplotlib.github.com
199- cp build/latex/Matplotlib.pdf ~/matplotlib. github.com
221+ You will need to manually edit :file: ` versions.html ` to show the last
222+ 3 tagged versions. Now commit and push everything to github ::
200223
201- Then, from the `matplotlib.github.com ` directory, commit and push the
202- changes upstream::
224+ git add *
225+ git commit -a -m 'Updating docs for v2.0.0
226+ git push DANGER master
203227
204- git commit -m "Updating for v1.0.1"
205- git push upstream master
228+ Congratulations you have now done the third scariest part!
206229
230+ It typically takes about 5-10 minutes for github to process the push
231+ and update the live web page (remember to clear your browser cache).
207232
208233
209234Announcing
210- ==========
235+ ----------
236+
237+ The final step is to announce the release to the world. A short
238+ version of the release notes along with acknowledgments should be sent to
239+
240+ 241+ 242+ 243+
244+ For final releases announcements should also be sent to the
245+ numpy/scipy/jupyter mailing lists and python-announce.
211246
212- Announce the release on matplotlib-announce, matplotlib-users, and
213- matplotlib-devel . Final (non- release-candidate) versions should also
214- be announced on python-announce. Include a summary of highlights from
215- the CHANGELOG and/or post the whole CHANGELOG since the last release .
247+ In addition, annoucments should be made on social networks (twitter,
248+ g+, FB) . For major release, numFOCUS should be contacted for
249+ inclusion in their news letter and maybe to have something posted on
250+ their blog .
0 commit comments