Infra: Call sphinx-build directly in Makefile instead of via build.py wrapper (#3195)

This commit is contained in:
Hugo van Kemenade 2023-07-12 18:28:43 +03:00 committed by GitHub
parent d2d7f5af93
commit 97984aa29a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 10 deletions

View File

@ -1,15 +1,22 @@
# Builds PEP files to HTML using sphinx # Builds PEP files to HTML using sphinx
PYTHON=python3 # You can set these variables from the command line.
VENVDIR=.venv PYTHON = python3
JOBS=8 VENVDIR = .venv
OUTPUT_DIR=build SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS) -o $(OUTPUT_DIR) BUILDER = html
JOBS = 8
SOURCES =
OUTPUT_DIR = build
SPHINXERRORHANDLING =
ALLSPHINXOPTS = -b $(BUILDER) -j $(JOBS) \
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . $(OUTPUT_DIR) $(SOURCES)
## html to render PEPs to "pep-NNNN.html" files ## html to render PEPs to "pep-NNNN.html" files
.PHONY: html .PHONY: html
html: venv html: venv
$(RENDER_COMMAND) $(SPHINXBUILD) $(ALLSPHINXOPTS)
## htmlview to open the index page built by the html target in your browser ## htmlview to open the index page built by the html target in your browser
.PHONY: htmlview .PHONY: htmlview
@ -18,18 +25,20 @@ htmlview: html
## dirhtml to render PEPs to "index.html" files within "pep-NNNN" directories ## dirhtml to render PEPs to "index.html" files within "pep-NNNN" directories
.PHONY: dirhtml .PHONY: dirhtml
dirhtml: BUILDER = dirhtml
dirhtml: venv rss dirhtml: venv rss
$(RENDER_COMMAND) --build-dirs $(SPHINXBUILD) $(ALLSPHINXOPTS)
## fail-warning to render PEPs to "pep-NNNN.html" files and fail the Sphinx build on any warning ## fail-warning to render PEPs to "pep-NNNN.html" files and fail the Sphinx build on any warning
.PHONY: fail-warning .PHONY: fail-warning
fail-warning: venv fail-warning: venv
$(RENDER_COMMAND) --fail-on-warning $(SPHINXBUILD) $(ALLSPHINXOPTS) -W
## check-links to check validity of links within PEP sources ## check-links to check validity of links within PEP sources
.PHONY: check-links .PHONY: check-links
check-links: BUILDER = linkcheck
check-links: venv check-links: venv
$(RENDER_COMMAND) --check-links $(SPHINXBUILD) $(ALLSPHINXOPTS)
## rss to generate the peps.rss file ## rss to generate the peps.rss file
.PHONY: rss .PHONY: rss

View File

@ -6,7 +6,7 @@
from pathlib import Path from pathlib import Path
import sys import sys
sys.path.append(str(Path("pep_sphinx_extensions").absolute())) sys.path.append(str(Path(".").absolute()))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------