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

View File

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