Skip to content

Commit

Permalink
Infra: Call sphinx-build directly in Makefile instead of via build.py…
Browse files Browse the repository at this point in the history
… wrapper (#3195)
  • Loading branch information
hugovk authored Jul 12, 2023
1 parent d2d7f5a commit 97984aa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Builds PEP files to HTML using sphinx

PYTHON=python3
VENVDIR=.venv
JOBS=8
OUTPUT_DIR=build
RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS) -o $(OUTPUT_DIR)
# 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
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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------

Expand Down

0 comments on commit 97984aa

Please sign in to comment.