diff --git a/Doc/Makefile b/Doc/Makefile index 8e70b21bec72e1..7f3e216c70e8fd 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 + $(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 diff --git a/Doc/conf.py b/Doc/conf.py index f803de238e7ca9..f606a2c52b5a7a 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -36,6 +36,10 @@ # 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 # -----------------------