Skip to content

Commit 74721f7

Browse files
committed
DOC: lots of small fixes, add description of tarball issue
1 parent 032b355 commit 74721f7

File tree

2 files changed

+66
-49
lines changed

2 files changed

+66
-49
lines changed

doc/devel/release_guide.rst

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ tagged commit should be tested locally before it is uploaded::
2424

2525
In addition the following two tests should be run and manually inspected::
2626

27-
python unit/memleak_hawaii3.py``
27+
python unit/memleak_hawaii3.py
2828
pushd examples/tests/
2929
python backend_driver.py
3030
popd
3131

3232

3333
.. _release_ghstats:
3434

35-
Github Stats
35+
GitHub Stats
3636
------------
3737

38-
We automatically extract github issue, PRs, and authors from the github via the API::
38+
We automatically extract GitHub issue, PRs, and authors from the GitHub via the API::
3939

4040
python tools/github_stats.py --since-tag $TAG --project 'matplotlib/matplotlib' --links --milestone v2.0.0 > doc/users/github_stats.rst
4141

@@ -50,12 +50,12 @@ Check Docs
5050
Before tagging, make sure that the docs build cleanly ::
5151

5252
pushd doc
53-
python make.py html pdf -n 16
53+
python make.py html latex -n 16
5454
popd
5555

5656
After the docs are built, check that all of the links, internal and external, are still
5757
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 ::
58+
need to create a python2 environment with ``requests==2.9.0`` and linkchecker ::
5959

6060
conda create -p /tmp/lnkchk python=2 requests==2.9.0
6161
source activate /tmp/lnkchk
@@ -82,20 +82,36 @@ message ::
8282
git tag -a -s v2.0.0
8383

8484
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 ::
85+
For pre releases it is important to follow :pep:`440` so that the
86+
build artifacts will sort correctly in pypi. Finally, push the tag to GitHub ::
8787

8888
git push -t DANGER v2.0.0
8989

9090
Congratulations, the scariest part is done!
9191

9292
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 ::
93+
tarball from GitHub it is important to move all branches away from the commit
94+
with the tag [#]_::
9595

9696
git commit --allow-empty
9797
git push DANGER master
9898

99+
100+
.. [#] The tarball that is provided by GitHub is produced using `git
101+
archive <https://git-scm.com/docs/git-archive>`__. We use
102+
`versioneer <https://github.com/warner/python-versioneer>`__
103+
which uses a format string in
104+
:file:`lib/matplotlib/_version.py` to have ``git`` insert a
105+
list of references to exported commit (see
106+
:file:`.gitattributes` for the configuration). This string is
107+
then used by ``versioneer`` to produce the correct version,
108+
based on the git tag, when users install from the tarball.
109+
However, if there is a branch pointed at the tagged commit,
110+
then the branch name will also be included in the tarball.
111+
When the branch eventually moves, anyone how checked the hash
112+
of the tarball before the branch moved will have an incorrect
113+
hash.
114+
99115
If this is a final release, also create a 'doc' branch (this is not
100116
done for pre-releases)::
101117

@@ -110,18 +126,20 @@ micro release will be cut off of this branch)::
110126

111127

112128

113-
.. _release_tag:
129+
.. _release_DOI:
114130

115131
Release Management / DOI
116132
------------------------
117133

118-
Via the github UI (chase down link), turn the newly pushed tag into a
134+
Via the GitHub UI (chase down link), turn the newly pushed tag into a
119135
release. If this is a pre-release remember to mark it as such.
120136

121137
For final releases also get a DOI from `zenodo
122138
<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 ::
139+
with DOI link and commit to the VER-doc branch and push to GitHub ::
124140

141+
git checkout v2.0.0-doc
142+
emacs doc/_templates/citing.html
125143
git push DANGER v2.0.0-doc:v2.0.0-doc
126144

127145
.. _release_bld_bin:
@@ -131,26 +149,25 @@ Building binaries
131149

132150
We distribute mac, windows, and many linux wheels as well as a source
133151
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
152+
builders. Mac and manylinux wheels are built on travis . You need to
153+
edit the :file:`.travis.yml` file and push to master of `the build
137154
project <https://github.com/MacPython/matplotlib-wheels>`__.
138155

139156
Update the ``master`` branch (for pre-releases the ``devel`` branch)
140157
of the `conda-forge feedstock
141158
<https://github.com/conda-forge/matplotlib-feedstock>`__ via pull request.
142159

143-
If this is a final release the following down-steam packagers should be contacted:
160+
If this is a final release the following downsteam packagers should be contacted:
144161

145-
- debian
146-
- fedora
147-
- arch
148-
- gentoo
149-
- macports
150-
- homebrew
162+
- Debian
163+
- Fedora
164+
- Arch
165+
- Gentoo
166+
- Macports
167+
- Homebrew
151168
- Christoph Gohlke
152-
- continuum
153-
- enthought
169+
- Continuum
170+
- Enthought
154171

155172
This can be done ahead of collecting all of the binaries and uploading to pypi.
156173

@@ -202,7 +219,7 @@ always the documentation for the latest stable release. Under that,
202219
there are directories containing the documentation for older versions.
203220
The documentation for current master are built on travis and push to
204221
the `devdocs <https://github.com/matplotlib/devdocs/>`__ repository.
205-
These are available `matplotlib.org/devdocs
222+
These are available at `matplotlib.org/devdocs
206223
<http://matplotlib.org/devdocs>`__.
207224

208225
Assuming you have this repository checked out in the same directory as
@@ -211,23 +228,23 @@ matplotlib ::
211228
cd ../matplotlib.github.com
212229
mkdir 2.0.0
213230
rsync -a ../matplotlib/doc/build/html/* 2.0.0
214-
cp ../matplotlib/doc/build/html/Matplotlib.pdf 2.0.0
231+
cp ../matplotlib/doc/build/latex/Matplotlib.pdf 2.0.0
215232

216233
which will copy the built docs over. If this is a final release, also
217234
replace the top-level docs ::
218235

219236
rsync -a 2.0.0/* ./
220237

221238
You will need to manually edit :file:`versions.html` to show the last
222-
3 tagged versions. Now commit and push everything to github ::
239+
3 tagged versions. Now commit and push everything to GitHub ::
223240

224241
git add *
225242
git commit -a -m 'Updating docs for v2.0.0
226243
git push DANGER master
227244

228245
Congratulations you have now done the third scariest part!
229246

230-
It typically takes about 5-10 minutes for github to process the push
247+
It typically takes about 5-10 minutes for GitHub to process the push
231248
and update the live web page (remember to clear your browser cache).
232249

233250

@@ -244,7 +261,7 @@ version of the release notes along with acknowledgments should be sent to
244261
For final releases announcements should also be sent to the
245262
numpy/scipy/jupyter mailing lists and python-announce.
246263

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.
264+
In addition, announcements should be made on social networks (twitter,
265+
g+, FB). For major release, `NumFOCUS <http://www.numfocus.org/>`__
266+
should be contacted for inclusion in their news letter and maybe to
267+
have something posted on their blog.

tools/github_stats.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ def issues_closed_since(period=timedelta(days=365), project="ipython/ipython", p
7777
since = period
7878
url = "https://api.github.com/repos/%s/%s?state=closed&sort=updated&since=%s&per_page=%i" % (project, which, since.strftime(ISO8601), PER_PAGE)
7979
allclosed = get_paged_request(url, headers=make_auth_header())
80-
80+
8181
filtered = [ i for i in allclosed if _parse_datetime(i['closed_at']) > since ]
8282
if pulls:
8383
filtered = [ i for i in filtered if _parse_datetime(i['merged_at']) > since ]
8484
# filter out PRs not against master (backports)
8585
filtered = [ i for i in filtered if i['base']['ref'] == 'master' ]
8686
else:
8787
filtered = [ i for i in filtered if not is_pull_request(i) ]
88-
88+
8989
return filtered
9090

9191

@@ -113,10 +113,10 @@ def report(issues, show_urls=False):
113113
# deal with unicode
114114
if sys.version_info < (3,):
115115
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
116-
116+
117117
# Whether to add reST urls for all issues in printout.
118118
show_urls = True
119-
119+
120120
parser = ArgumentParser()
121121
parser.add_argument('--since-tag', type=str,
122122
help="The git tag to use for the starting point (typically the last major release)."
@@ -133,10 +133,10 @@ def report(issues, show_urls=False):
133133
parser.add_argument('--links', action='store_true', default=False,
134134
help="Include links to all closed Issues and PRs in the output."
135135
)
136-
136+
137137
opts = parser.parse_args()
138138
tag = opts.since_tag
139-
139+
140140
# set `since` from days or git tag
141141
if opts.days:
142142
since = datetime.utcnow() - timedelta(days=opts.days)
@@ -153,9 +153,9 @@ def report(issues, show_urls=False):
153153
since += td
154154
else:
155155
since -= td
156-
156+
157157
since = round_hour(since)
158-
158+
159159
milestone = opts.milestone
160160
project = opts.project
161161

@@ -172,18 +172,18 @@ def report(issues, show_urls=False):
172172
else:
173173
issues = issues_closed_since(since, project=project, pulls=False)
174174
pulls = issues_closed_since(since, project=project, pulls=True)
175-
175+
176176
# For regular reports, it's nice to show them in reverse chronological order
177177
issues = sorted_by_field(issues, reverse=True)
178178
pulls = sorted_by_field(pulls, reverse=True)
179-
179+
180180
n_issues, n_pulls = map(len, (issues, pulls))
181181
n_total = n_issues + n_pulls
182-
182+
183183
# Print summary report we can directly include into release notes.
184184
print('.. _github-stats:')
185185
print()
186-
print('Github Stats')
186+
print('GitHub Stats')
187187
print('============')
188188

189189
print()
@@ -193,18 +193,18 @@ def report(issues, show_urls=False):
193193
print()
194194
print("These lists are automatically generated, and may be incomplete or contain duplicates.")
195195
print()
196-
196+
197197
ncommits = 0
198198
all_authors = []
199199
if tag:
200200
# print git info, in addition to GitHub info:
201201
since_tag = tag+'..'
202202
cmd = ['git', 'log', '--oneline', since_tag]
203203
ncommits += len(check_output(cmd).splitlines())
204-
204+
205205
author_cmd = ['git', 'log', '--use-mailmap', "--format=* %aN", since_tag]
206206
all_authors.extend(check_output(author_cmd).decode('utf-8', 'replace').splitlines())
207-
207+
208208
pr_authors = []
209209
for pr in pulls:
210210
pr_authors.extend(get_authors(pr))
@@ -219,12 +219,12 @@ def report(issues, show_urls=False):
219219
print("The full list can be seen `on GitHub <https://github.com/%s/milestone/%s>`__"
220220
% (project, milestone)
221221
)
222-
222+
223223
print()
224224
print("The following %i authors contributed %i commits." % (len(unique_authors), ncommits))
225225
print()
226226
print('\n'.join(unique_authors))
227-
227+
228228
if opts.links:
229229
print()
230230
print("GitHub issues and pull requests:")

0 commit comments

Comments
 (0)