|
4 | 4 | #
|
5 | 5 |
|
6 | 6 | # You can set these variables from the command line.
|
7 |
| -PYTHON = python |
| 7 | +PYTHON = python3 |
8 | 8 | SPHINXBUILD = sphinx-build
|
| 9 | +BLURB = $(PYTHON) -m blurb |
9 <
8000
/td> | 10 | PAPER =
|
10 | 11 | SOURCES =
|
11 | 12 | DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
|
12 | 13 |
|
13 |
| -ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \ |
| 14 | +ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PAPER) \ |
14 | 15 | $(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
|
15 | 16 |
|
16 | 17 | .PHONY: help build html htmlhelp latex text changes linkcheck \
|
17 | 18 | suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
|
18 |
| - autobuild-dev autobuild-stable |
| 19 | + autobuild-dev autobuild-stable venv |
19 | 20 |
|
20 | 21 | help:
|
21 | 22 | @echo "Please use \`make <target>' where <target> is one of"
|
22 | 23 | @echo " clean to remove build files"
|
| 24 | + @echo " venv to create a venv with necessary tools" |
23 | 25 | @echo " html to make standalone HTML files"
|
24 | 26 | @echo " htmlview to open the index page built by the html target in your browser"
|
25 | 27 | @echo " htmlhelp to make HTML files and a HTML help project"
|
|
37 | 39 | @echo " serve to serve the documentation on the localhost (8000)"
|
38 | 40 |
|
39 | 41 | build:
|
| 42 | + -mkdir -p build |
| 43 | + $(BLURB) merge -f build/NEWS |
40 | 44 | $(SPHINXBUILD) $(ALLSPHINXOPTS)
|
41 | 45 | @echo
|
42 | 46 |
|
@@ -102,7 +106,11 @@ htmlview: html
|
102 | 106 | $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
|
103 | 107 |
|
104 | 108 | clean:
|
105 |
| - -rm -rf build/* |
| 109 | + -rm -rf build/* venv/* |
| 110 | + |
| 111 | +venv: |
| 112 | + $(PYTHON) -m venv venv |
| 113 | + ./venv/bin/python3 -m pip install -U Sphinx |
106 | 114 |
|
107 | 115 | dist:
|
108 | 116 | rm -rf dist
|
@@ -148,21 +156,26 @@ dist:
|
148 | 156 | cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
|
149 | 157 |
|
150 | 158 | check:
|
151 |
| - $(PYTHON) tools/rstlint.py -i tools |
| 159 | + $(PYTHON) tools/rstlint.py -i tools -i venv -i README.rst |
152 | 160 |
|
153 | 161 | serve:
|
154 | 162 | ../Tools/scripts/serve.py build/html
|
155 | 163 |
|
156 | 164 | # Targets for daily automated doc build
|
| 165 | +# By default, Sphinx only rebuilds pages where the page content has changed. |
| 166 | +# This means it doesn't always pick up changes to preferred link targets, etc |
| 167 | +# To ensure such changes are picked up, we build the published docs with |
| 168 | +# `-E` (to ignore the cached environment) and `-a` (to ignore already existing |
| 169 | +# output files) |
157 | 170 |
|
158 | 171 | # for development releases: always build
|
159 | 172 | autobuild-dev:
|
160 |
| - make dist SPHINXOPTS='-A daily=1 -A versionswitcher=1' |
| 173 | + make dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A versionswitcher=1' |
161 | 174 | -make suspicious
|
162 | 175 |
|
163 | 176 | # for quick rebuilds (HTML only)
|
164 | 177 | autobuild-dev-html:
|
165 |
| - make html SPHINXOPTS='-A daily=1 -A versionswitcher=1' |
| 178 | + make html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1 -A versionswitcher=1' |
166 | 179 |
|
167 | 180 | # for stable releases: only build if not in pre-release stage (alpha, beta)
|
168 | 181 | # release candidate downloads are okay, since the stable tree can be in that stage
|
|
0 commit comments