Skip to content

Commit 32de30c

Browse files
authored
Infra: Refactor Makefile (python#3514)
1 parent 502a13a commit 32de30c

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

.github/workflows/render.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
if: (github.ref == 'refs/heads/main') && (matrix.python-version == '3.x')
5757
uses: JamesIves/github-pages-deploy-action@v4
5858
with:
59-
folder: build # Synchronise with Makefile -> OUTPUT_DIR
59+
folder: build # Synchronise with Makefile -> BUILDDIR
6060
single-commit: true # Delete existing files
6161

6262
- name: Purge CDN cache

Makefile

+15-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
# You can set these variables from the command line.
44
PYTHON = python3
55
VENVDIR = .venv
6+
# synchronise with render.yml -> deploy step
7+
BUILDDIR = build
68
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
79
BUILDER = html
810
JOBS = 8
911
SOURCES =
10-
# synchronise with render.yml -> deploy step
11-
OUTPUT_DIR = build
1212
SPHINXERRORHANDLING = -W --keep-going -w sphinx-warnings.txt
1313

14-
ALLSPHINXOPTS = -b $(BUILDER) -j $(JOBS) \
15-
$(SPHINXOPTS) $(SPHINXERRORHANDLING) peps $(OUTPUT_DIR) $(SOURCES)
14+
ALLSPHINXOPTS = -b $(BUILDER) \
15+
-j $(JOBS) \
16+
$(SPHINXOPTS) $(SPHINXERRORHANDLING) \
17+
peps $(BUILDDIR) $(SOURCES)
1618

1719
## html to render PEPs to "pep-NNNN.html" files
1820
.PHONY: html
@@ -27,14 +29,17 @@ htmlview: html
2729
## dirhtml to render PEPs to "index.html" files within "pep-NNNN" directories
2830
.PHONY: dirhtml
2931
dirhtml: BUILDER = dirhtml
30-
dirhtml: venv
31-
$(SPHINXBUILD) $(ALLSPHINXOPTS)
32+
dirhtml: html
3233

33-
## check-links to check validity of links within PEP sources
34-
.PHONY: check-links
34+
## linkcheck to check validity of links within PEP sources
35+
.PHONY: linkcheck
3536
check-links: BUILDER = linkcheck
36-
check-links: venv
37-
$(SPHINXBUILD) $(ALLSPHINXOPTS)
37+
check-links: html
38+
39+
## check-links (deprecated: use 'make linkcheck' alias instead)
40+
.PHONY: pages
41+
check-links: linkcheck
42+
@echo "\033[0;33mWarning:\033[0;31m 'make check-links' \033[0;33mis deprecated, use\033[0;32m 'make linkcheck' \033[0;33malias instead\033[0m"
3843

3944
## clean to remove the venv and build files
4045
.PHONY: clean

docs/build.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Check the validity of links within PEP sources (runs the `Sphinx linkchecker
8282
.. code-block:: shell
8383
8484
python build.py --check-links
85-
make check-links
85+
make linkcheck
8686
8787
8888
``build.py`` usage

readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build:
66
python: "3.11"
77

88
commands:
9-
- make dirhtml JOBS=$(nproc) OUTPUT_DIR=_readthedocs/html
9+
- make dirhtml JOBS=$(nproc) BUILDDIR=_readthedocs/html
1010

1111
sphinx:
1212
builder: dirhtml

0 commit comments

Comments
 (0)