]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport Doc build venv fixes (#3979) 4047/head
authorNed Deily <nad@python.org>
Thu, 12 Oct 2017 21:06:51 +0000 (17:06 -0400)
committerGitHub <noreply@github.com>
Thu, 12 Oct 2017 21:06:51 +0000 (17:06 -0400)
Doc/Makefile
Doc/conf.py

index 8e70b21bec72e13963c2dbeb680c37465c2932c5..7f3e216c70e8fd772470c6395cda4274098dba50 100644 (file)
@@ -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
+       $(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
index f803de238e7ca98e1258818727b955624c76cab7..f606a2c52b5a7a206783ae56deda709c28960b8e 100644 (file)
@@ -36,6 +36,10 @@ highlight_language = 'python3'
 # Require Sphinx 1.2 for build.
 needs_sphinx = '1.2'
 
+# Ignore any .rst files in the venv/ directory.
+venvdir = os.getenv('VENVDIR', 'venv')
+exclude_patterns = [venvdir+'/*', 'README.rst']
+
 
 # Options for HTML output
 # -----------------------