diff options
author | Benjamin Peterson <benjamin@python.org> | 2019-10-08 03:57:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-08 03:57:05 (GMT) |
commit | 0bd59d655280ad4c4aff2d327789815b89caee18 (patch) | |
tree | 323c080d62cb4b59add8a4957ba5069fb1ce875a | |
parent | e78d79c15cc53bdf8161d41c627cbfb551d8ee96 (diff) | |
download | cpython-0bd59d655280ad4c4aff2d327789815b89caee18.zip cpython-0bd59d655280ad4c4aff2d327789815b89caee18.tar.gz cpython-0bd59d655280ad4c4aff2d327789815b89caee18.tar.bz2 |
[2.7] bpo-31036: Allow sphinx and blurb to be found automatically (GH-16638)
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..
(cherry picked from commit 590665c399fc4aa3c4a9f8e7104d43a02e9f3a0c)
Co-authored-by: Ned Deily <nad@python.org>
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Doc/Makefile | 13 |
2 files changed, 14 insertions, 7 deletions
@@ -16,10 +16,10 @@ *.profraw *.dyn Doc/build/ -Doc/tools/docutils/ -Doc/tools/jinja2/ -Doc/tools/pygments/ -Doc/tools/sphinx/ +Doc/venv/ +Doc/.venv/ +Doc/env/ +Doc/.env/ Lib/lib2to3/*.pickle Lib/test/data/* Makefile diff --git a/Doc/Makefile b/Doc/Makefile index 7ca4c7a..3d7e4ac 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -5,7 +5,9 @@ # You can set these variables from the command line. PYTHON = python -SPHINXBUILD = sphinx-build +VENVDIR = ./venv +SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build +BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb PAPER = SOURCES = DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py) @@ -102,7 +104,12 @@ htmlview: html $(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')" clean: - -rm -rf build/* + -rm -rf build/* $(VENVDIR)/* + +venv: + $(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 @@ -148,7 +155,7 @@ dist: cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub check: - $(PYTHON)2 tools/rstlint.py -i tools + $(PYTHON)2 tools/rstlint.py -i tools -i $(VENVDIR) serve: ../Tools/scripts/serve.py build/html |