summaryrefslogtreecommitdiffstats
path: root/Doc/Makefile
diff options
context:
space:
mode:
authorCaleb Hattingh <caleb.hattingh@gmail.com>2017-11-26 21:18:30 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2017-11-26 21:18:30 (GMT)
commitd8d6b9122134f040cd5a4f15f40f6c9e3386db4d (patch)
tree66c4c733fcc7873b0d931384403c638142571f8c /Doc/Makefile
parenta6fba9b827e395fc9583c07bc2d15cd11f684439 (diff)
downloadcpython-d8d6b9122134f040cd5a4f15f40f6c9e3386db4d.zip
cpython-d8d6b9122134f040cd5a4f15f40f6c9e3386db4d.tar.gz
cpython-d8d6b9122134f040cd5a4f15f40f6c9e3386db4d.tar.bz2
bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346)
Diffstat (limited to 'Doc/Makefile')
-rw-r--r--Doc/Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/Makefile b/Doc/Makefile
index 307d1e0..69e7e2e 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -17,7 +17,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PA
.PHONY: help build html htmlhelp latex text changes linkcheck \
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
- autobuild-dev autobuild-stable venv
+ autobuild-dev autobuild-stable
help:
@echo "Please use \`make <target>' where <target> is one of"
@@ -39,7 +39,7 @@ help:
@echo " check to run a check for frequent markup errors"
@echo " serve to serve the documentation on the localhost (8000)"
-build:
+build: venv
-mkdir -p build
# Look first for a Misc/NEWS file (building from a source release tarball
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
@@ -122,9 +122,11 @@ clean:
-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"
+ @if [ "$(SPHINXBUILD)" == "PATH=$(VENVDIR)/bin:$$PATH sphinx-build" ]; then \
+ $(PYTHON) -m venv $(VENVDIR); \
+ echo "A virtual environment for Docs has been made in the $(VENVDIR) directory"; \
+ $(VENVDIR)/bin/python3 -m pip install Sphinx blurb; \
+ fi
dist:
rm -rf dist