8000 Merge pull request #24721 from charris/fix-docs · numpy/numpy@ba2935d · GitHub
[go: up one dir, main page]

Skip to content

Commit ba2935d

Browse files
authored
Merge pull request #24721 from charris/fix-docs
DOC: Doc fixes and updates.
2 parents 399c0c5 + 8558fcc commit ba2935d

File tree

3 files changed

+89
-77
lines changed

3 files changed

+89
-77
lines changed

.spin/cmds.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,8 @@ def build(ctx, meson_args, jobs=None, clean=False, verbose=False):
7575
default="auto",
7676
help="Number of parallel build jobs"
7777
)
78-
@click.option(
79-
"--install-deps/--no-install-deps",
80-
default=False,
81-
help="Install dependencies before building"
82-
)
8378
@click.pass_context
84-
def docs(ctx, sphinx_target, clean, first_build, jobs, install_deps):
79+
def docs(ctx, sphinx_target, clean, first_build, jobs):
8580
"""📖 Build Sphinx documentation
8681
8782
By default, SPHINXOPTS="-W", raising errors on warnings.
@@ -97,13 +92,12 @@ def docs(ctx, sphinx_target, clean, first_build, jobs, install_deps):
9792
9893
spin docs TARGET
9994
100-
"""
101-
if sphinx_target not in ('targets', 'help'):
102-
if install_deps:
103-
util.run(['pip', 'install', '-q', '-r', 'doc_requirements.txt'])
95+
E.g., to build a zipfile of the html docs for distribution:
96+
97+
spin docs dist
10498
99+
"""
105100
meson.docs.ignore_unknown_options = True
106-
del ctx.params['install_deps']
107101
ctx.forward(meson.docs)
108102

109103

doc/RELEASE_WALKTHROUGH.rst

Lines changed: 81 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ documentation. There are a few ways to streamline things:
2020
online twine documentation for details.
2121

2222

23-
Release preparation
24-
===================
23+
Prior to release
24+
================
2525

2626
Add/drop Python versions
2727
------------------------
@@ -39,28 +39,43 @@ wheels for new Python versions after the first Python rc once manylinux and
3939
cibuildwheel support it. For Python 3.11 we were able to release within a week
4040
of the rc1 announcement.
4141

42+
4243
Backport Pull Requests
4344
----------------------
4445

4546
Changes that have been marked for this release must be backported to the
4647
maintenance/1.21.x branch.
4748

48-
Update release documentation
49-
----------------------------
5049

51-
Four documents usually need to be updated or created before making a release:
50+
Make a release PR
51+
=================
52+
53+
Five documents usually need to be updated or created for the release PR:
5254

5355
- The changelog
5456
- The release-notes
5557
- The ``.mailmap`` file
56-
- The ``doc/source/release.rst`` file
58+
- The ``pyproject.toml`` file
59+
- The ``pyproject.setuppy.toml`` file # 1.26.x only
60+
61+
These changes should be made in an ordinary PR against the maintenance branch.
62+
The commit message should contain a ``[wheel build]`` directive to test if the
63+
wheels build. Other small, miscellaneous fixes may be part of this PR. The
64+
commit message might be something like::
65+
66+
REL: Prepare for the NumPy 1.20.0 release
67+
68+
- Create 1.20.0-changelog.rst.
69+
- Update 1.20.0-notes.rst.
70+
- Update .mailmap.
71+
- Update pyproject.toml
72+
- Update pyproject.setuppy.toml
73+
74+
[wheel build]
5775

58-
These changes should be made as an ordinary PR against the maintenance branch.
59-
After release all files except ``doc/source/release.rst`` will need to be
60-
forward ported to the main branch.
6176

6277
Generate the changelog
63-
~~~~~~~~~~~~~~~~~~~~~~
78+
----------------------
6479

6580
The changelog is generated using the changelog tool::
6681

@@ -75,8 +90,9 @@ file, which is a lot of work. It is best to make several trial runs before
7590
reaching this point and ping the malefactors using a GitHub issue to get the
7691
needed information.
7792

93+
7894
Finish the release notes
79-
~~~~~~~~~~~~~~~~~~~~~~~~
95+
------------------------
8096

8197
If this is the first release in a series the release note is generated, see
8298
the release note in ``doc/release/upcoming_changes/README.rst`` to see how to
@@ -91,13 +107,24 @@ done. Note that the ``:orphan:`` markup at the top, if present, will need
91107
changing to ``.. currentmodule:: numpy`` and the ``doc/source/release.rst``
92108
index file will need updating.
93109

94-
Check the ``pavement.py`` file
95-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96110

97-
Check that the pavement.py file points to the correct release notes. It should
98-
have been updated after the last release, but if not, fix it now::
111+
Set the release version
112+
-----------------------
113+
114+
Edit the ``pyproject.toml`` and ``pyproject.setuppy.toml`` files and set the
115+
release version::
116+
117+
$ gvim pyproject.toml pyproject.setuppy.toml
118+
119+
120+
Check the ``pavement.py`` and ``doc/source/release.rst`` files
121+
--------------------------------------------------------------
122+
123+
Check that the ``pavement.py`` file points to the correct release notes. It should
124+
have been updated after the last release, but if not, fix it now. Also make
125+
sure that the notes have an entry in the ``release.rst`` file::
99126

100-
$ gvim pavement.py
127+
$ gvim pavement.py doc/source/release.rst
101128

102129

103130
Release walkthrough
@@ -109,6 +136,7 @@ need to make adjustments if you have not forked the repository but simply
109136
cloned it locally. You can also edit ``.git/config`` and add ``upstream`` if it
110137
isn't already present.
111138

139+
112140
1. Prepare the release commit
113141
-----------------------------
114142

@@ -135,42 +163,34 @@ If you need to delete the tag due to error::
135163
$ git tag -d v1.21.0
136164
$ git push --delete upstream v1.21.0
137165

166+
138167
2. Build wheels
139168
---------------
140169

141-
Build wheels via cibuildwheel (preferred)
142-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143-
144170
Tagging the build at the beginning of this process will trigger a wheel build
145171
via cibuildwheel and upload wheels and an sdist to the staging repo. The CI run
146172
on github actions (for all x86-based and macOS arm64 wheels) takes about 1 1/4
147-
hours. The CI run on travis (for aarch64) takes less time. You can check for
148-
uploaded files at the `staging repository`_, but note that it is not closely
149-
synched with what you see of the running jobs.
173+
hours. The CI runs on cirrus (for aarch64 and M1) take less time. You can check
174+
for uploaded files at the `staging repository`_, but note that it is not
175+
closely synched with what you see of the running jobs.
150176

151177
If you wish to manually trigger a wheel build, you can do so:
152178

153179
- On github actions -> `Wheel builder`_ there is a "Run workflow" button, click
154180
on it and choose the tag to build
155-
- On travis_ there is a "More Options" button, click on it and choose a branch
156-
to build. There does not appear to be an option to build a tag.
181+
- On Cirrus we don't currently have an easy way to manually trigger builds and
182+
uploads.
157183

158184
If a wheel build fails for unrelated reasons, you can rerun it individually:
159185

160186
- On github actions select `Wheel builder`_ click on the commit that contains
161187
the build you want to rerun. On the left there is a list of wheel builds,
162188
select the one you want to rerun and on the resulting page hit the
163189
counterclockwise arrows button.
164-
- On travis_ select the failing build, which will take you to the travis job for
165-
that build. Hit the restart job button.
166-
167-
Note that if you do need to rerun jobs, you will need to delete the uploaded
168-
file, if any, in the anaconda `staging repository`_, The old files will not be
169-
overwritten.
190+
- On cirrus we haven't figured it out.
170191

171192
.. _`staging repository`: https://anaconda.org/multibuild-wheels-staging/numpy/files
172193
.. _`Wheel builder`: https://github.com/numpy/numpy/actions/workflows/wheels.yml
173-
.. _travis : https://app.travis-ci.com/github/numpy/numpy
174194

175195

176196
3. Download wheels
@@ -193,28 +213,7 @@ file is updated for continued development::
193213
$ paver write_release
194214

195215

196-
5. Reset the maintenance branch into a development state (skip for prereleases)
197-
-------------------------------------------------------------------------------
198-
199-
Create release notes for next release and edit them to set the version. These
200-
notes will be a skeleton and have little content::
201-
202-
$ cp doc/source/release/template.rst doc/source/release/1.21.1-notes.rst
203-
$ gvim doc/source/release/1.21.1-notes.rst
204-
$ git add doc/source/release/1.21.1-notes.rst
205-
206-
Add new release notes to the documentation release list and update the
207-
``RELEASE_NOTES`` variable in ``pavement.py``::
208-
209-
$ gvim doc/source/release.rst pavement.py
210-
211-
Commit the result::
212-
213-
$ git commit -a -m"REL: prepare 1.21.x for further development"
214-
$ git push upstream HEAD
215-
216-
217-
6. Upload to PyPI
216+
5. Upload to PyPI
218217
-----------------
219218

220219
Upload to PyPI using ``twine``. A recent version of ``twine`` of is needed
@@ -233,7 +232,7 @@ wheel. PyPI only allows a single source distribution, here we have
233232
chosen the zip archive.
234233

235234

236-
7. Upload files to github
235+
6. Upload files to github
237236
-------------------------
238237

239238
Go to `<https://github.com/numpy/numpy/releases>`_, there should be a ``v1.21.0
@@ -252,7 +251,7 @@ may take several tries to get it look right. Then
252251
- Hit the ``{Publish,Update} release`` button at the bottom.
253252

254253

255-
8. Upload documents to numpy.org (skip for prereleases)
254+
7. Upload documents to numpy.org (skip for prereleases)
256255
-------------------------------------------------------
257256

258257
.. note:: You will need a GitHub personal access token to push the update.
@@ -263,10 +262,8 @@ and most patch releases. ``make merge-doc`` clones the ``numpy/doc`` repo into
263262

264263
$ git clean -xdfq
265264
$ git co v1.21.0
266-
$ pushd doc
267-
$ make docenv && source docenv/bin/activate
268-
$ make merge-doc
269-
$ pushd build/merge
265+
$ python -m spin docs merge-doc --build
266+
$ pushd doc/build/merge
270267

271268
If the release series is a new one, you will need to add a new section to the
272269
``doc/build/merge/index.html`` front page just after the "insert here" comment::
@@ -299,11 +296,30 @@ Once everything seems satisfactory, update, commit and upload the changes::
299296
$ python3 update.py
300297
$ git commit -a -m"Add documentation for v1.21.0"
301298
$ git push
302-
$ deactivate
303-
$ popd
304299
$ popd
305300

306301

302+
8. Reset the maintenance branch into a development state (skip for prereleases)
303+
-------------------------------------------------------------------------------
304+
305+
Create release notes for next release and edit them to set the version. These
306+
notes will be a skeleton and have little content::
307+
308+
$ cp doc/source/release/template.rst doc/source/release/1.21.1-notes.rst
309+
$ gvim doc/source/release/1.21.1-notes.rst
310+
$ git add doc/source/release/1.21.1-notes.rst
311+
312+
Add new release notes to the documentation release list and update the
313+
``RELEASE_NOTES`` variable in ``pavement.py``::
314+
315+
$ gvim doc/source/release.rst pavement.py
316+
317+
Commit the result::
318+
319+
$ git commit -a -m"REL: prepare 1.21.x for further development"
320+
$ git push upstream HEAD
321+
322+
307323
9. Announce the release on numpy.org (skip for prereleases)
308324
-----------------------------------------------------------
309325

@@ -327,6 +343,7 @@ commit and push::
327343

328344
Go to your Github fork and make a pull request.
329345

346+
330347
10. Announce to mailing lists
331348
-----------------------------
332349

@@ -337,8 +354,8 @@ as generated for the release notes above. If you crosspost, make sure that
337354
python-announce-list is BCC so that replies will not be sent to that list.
338355

339356

340-
11. Post-release tasks (skip for prereleases)
341-
---------------------------------------------
357+
11. Post-release update main (skip for prereleases)
358+
---------------------------------------------------
342359

343360
Checkout main and forward port the documentation changes::
344361

@@ -353,6 +370,7 @@ Checkout main and forward port the documentation changes::
353370

354371
Go to GitHub and make a PR.
355372

373+
356374
12. Update oldest-supported-numpy
357375
---------------------------------
358376

doc/source/user/building.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Building NumPy requires the following software installed:
5151
can be used, including optimized LAPACK libraries such as OpenBLAS or MKL.
5252
The choice and location of these libraries as well as include paths and
5353
other such build options can be specified in a ``.pc`` file, as documented in
54-
:ref:`scipy:using-pkg-config-to-detect-libraries-in-a-nonstandard-location`.
54+
:ref:`scipy:building-blas-and-lapack`.
5555

5656
4) Cython
5757

@@ -138,7 +138,7 @@ file.
138138
Cross compilation
139139
-----------------
140140

141-
For cross compilation instructions, see :doc:`scipy:cross_compilation` and the
142-
`Meson documentation <meson>`_.
141+
For cross compilation instructions, see :doc:`scipy:building/cross_compilation`
142+
and the `Meson documentation <meson>`_.
143143

144144
.. _meson: https://mesonbuild.com/Cross-compilation.html#cross-compilation

0 commit comments

Comments
 (0)
0