summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2014-12-05 15:17:31 -0500
committerBrett Cannon <brett@python.org>2014-12-05 15:17:31 -0500
commitd5ea39d1b86ce8ba0db8ea919797adb29b137add (patch)
tree8e49c8782d6eb45b7b77cd2a6411a9bf7454166f
parent1a7b8d143965c281467379123187e0ef323380c3 (diff)
downloadcpython-git-d5ea39d1b86ce8ba0db8ea919797adb29b137add.tar.gz
Issue #22394: Add a 'venv' command to Doc/Makefile.
This will create a venv using the interpreter specified by the PYTHON variable for the Makefile that also install Sphinx. Typical usage is expected to be: cd Doc make venv PYTHON=../python make html PYTHON=venv/bin/python3
-rw-r--r--.gitignore6
-rw-r--r--.hgignore1
-rw-r--r--Doc/Makefile10
-rw-r--r--Misc/NEWS4
4 files changed, 13 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index c7db0c7687..2343e9430e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,11 +9,7 @@
*~
.gdb_history
Doc/build/
-Doc/tools/docutils/
-Doc/tools/jinja/
-Doc/tools/jinja2/
-Doc/tools/pygments/
-Doc/tools/sphinx/
+Doc/venv/
Lib/lib2to3/*.pickle
Lib/test/data/*
Lib/_sysconfigdata.py
diff --git a/.hgignore b/.hgignore
index e22a8f7c4c..d22a58af46 100644
--- a/.hgignore
+++ b/.hgignore
@@ -9,6 +9,7 @@ TAGS$
autom4te.cache$
^build/
^Doc/build/
+^Doc/venv/
buildno$
config.cache
config.log
diff --git a/Doc/Makefile b/Doc/Makefile
index 5b5f68a0f3..93e59efe62 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -15,11 +15,12 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
.PHONY: help build html htmlhelp latex text changes linkcheck \
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
- autobuild-dev autobuild-stable
+ autobuild-dev autobuild-stable venv
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " clean to remove build files"
+ @echo " venv to create a venv with necessary tools"
@echo " html to make standalone HTML files"
@echo " htmlview to open the index page built by the html target in your browser"
@echo " htmlhelp to make HTML files and a HTML help project"
@@ -102,7 +103,11 @@ htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
clean:
- -rm -rf build/*
+ -rm -rf build/* venv/*
+
+venv:
+ $(PYTHON) -m venv venv
+ ./venv/bin/python3 -m pip install -U Sphinx
dist:
rm -rf dist
@@ -172,4 +177,3 @@ autobuild-stable:
exit 1;; \
esac
@make autobuild-dev
-
diff --git a/Misc/NEWS b/Misc/NEWS
index 496be4eaf7..c7c8f8daf0 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1348,6 +1348,10 @@ C API
Documentation
-------------
+- Issue #22394: Doc/Makefile now supports ``make venv PYTHON=../python`` to
+ create a venv for generating the documentation, e.g.,
+ ``make html PYTHON=venv/bin/python3``.
+
- Issue #21514: The documentation of the json module now refers to new JSON RFC
7159 instead of obsoleted RFC 4627.