summaryrefslogtreecommitdiff
path: root/Doc/Makefile
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
parent5a8516701f5140c8c989c40e261a4f4e20e8af86 (diff)
downloadcpython-git-590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c.tar.gz
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 63bbe1d4d7..307d1e0e7d 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