aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Deily <nad@python.org>2017-09-07 17:17:53 -0700
committerGitHub <noreply@github.com>2017-09-07 17:17:53 -0700
commit590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c (patch)
treea4bc5681706799eb6b457336b510aa0d0200e5d5 /Doc/Makefile
parentbpo-31344: Per-frame control of trace events (GH-3417) (diff)
downloadcpython-590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c.tar.gz
cpython-590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c.tar.bz2
cpython-590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c.zip
bpo-31036: Allow sphinx and blurb to be found automatically (#3440)
Rather than requiring the path to blurb and/or sphinx-build to be specified to the make rule, enhance the Doc/Makefile to look for each first in a virtual environment created by make venv and, if not found, look on the normal process PATH. This allows the Doc/Makefile to take advantage of an installed spinx-build or blurb and, thus, do the right thing most of the time. Also, make the directory for the venv be configurable and document the `make venv` target.
Diffstat (limited to 'Doc/Makefile')
-rw-r--r--Doc/Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/Makefile b/Doc/Makefile
index 63bbe1d4d71..307d1e0e7de 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -5,8 +5,9 @@
# You can set these variables from the command line.
PYTHON = python3
-SPHINXBUILD = sphinx-build
-BLURB = $(PYTHON) -m blurb
+VENVDIR = ./venv
+SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
+BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
PAPER =
SOURCES =
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
@@ -118,11 +119,12 @@ htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
clean:
- -rm -rf build/* venv/*
+ -rm -rf build/* $(VENVDIR)/*
venv:
- $(PYTHON) -m venv venv
- ./venv/bin/python3 -m pip install -U Sphinx blurb
+ $(PYTHON) -m venv $(VENVDIR)
+ $(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb
+ @echo "The venv has been created in the $(VENVDIR) directory"
dist:
rm -rf dist
@@ -168,7 +170,7 @@ dist:
cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
check:
- $(PYTHON) tools/rstlint.py -i tools -i venv -i README.rst
+ $(PYTHON) tools/rstlint.py -i tools -i $(VENVDIR) -i README.rst
serve:
../Tools/scripts/serve.py build/html