Skip to content

Commit

Permalink
Issue python#22394: Add a 'venv' command to Doc/Makefile.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
brettcannon committed Dec 5, 2014
1 parent 1a7b8d1 commit d5ea39d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ TAGS$
autom4te.cache$
^build/
^Doc/build/
^Doc/venv/
buildno$
config.cache
config.log
Expand Down
10 changes: 7 additions & 3 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -172,4 +177,3 @@ autobuild-stable:
exit 1;; \
esac
@make autobuild-dev

4 changes: 4 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit d5ea39d

Please sign in to comment.