Skip to content

Commit 122fc13

Browse files
authored
Revert "bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346)" (#4592)
Fix breakage documented in bpo-32149. This reverts commit d8d6b91.
1 parent 9522a21 commit 122fc13

File tree

3 files changed

+22
-31
lines changed

3 files changed

+22
-31
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ matrix:
3636
# (Updating the version is fine as long as no warnings are raised by doing so.)
3737
- python -m pip install sphinx~=1.6.1 blurb
3838
script:
39-
- make check suspicious html SPHINXBUILD="sphinx-build" SPHINXOPTS="-q -W -j4"
39+
- make check suspicious html SPHINXOPTS="-q -W -j4"
4040
- os: linux
4141
language: c
4242
compiler: gcc

Doc/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PA
1717

1818
.PHONY: help build html htmlhelp latex text changes linkcheck \
1919
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
20-
autobuild-dev autobuild-stable
20+
autobuild-dev autobuild-stable venv
2121

2222
help:
2323
@echo "Please use \`make <target>' where <target> is one of"
@@ -39,7 +39,7 @@ help:
3939
@echo " check to run a check for frequent markup errors"
4040
@echo " serve to serve the documentation on the localhost (8000)"
4141

42-
build: venv
42+
build:
4343
-mkdir -p build
4444
# Look first for a Misc/NEWS file (building from a source release tarball
4545
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
@@ -122,11 +122,9 @@ clean:
122122
-rm -rf build/* $(VENVDIR)/*
123123

124124
venv:
125-
@if [ "$(SPHINXBUILD)" == "PATH=$(VENVDIR)/bin:$$PATH sphinx-build" ]; then \
126-
$(PYTHON) -m venv $(VENVDIR); \
127-
echo "A virtual environment for Docs has been made in the $(VENVDIR) directory"; \
128-
$(VENVDIR)/bin/python3 -m pip install Sphinx blurb; \
129-
fi
125+
$(PYTHON) -m venv $(VENVDIR)
126+
$(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb
127+
@echo "The venv has been created in the $(VENVDIR) directory"
130128

131129
dist:
132130
rm -rf dist

Doc/README.rst

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ tree but are maintained separately and are available from
2121
* `Sphinx <https://pypi.org/project/Sphinx/>`_
2222
* `blurb <https://pypi.org/project/blurb/>`_
2323

24-
You could manually create a virtual environment and install them, but there is
25-
a ``Makefile`` already set up to do this for you, as long as you have a working
26-
Python 3 interpreter available.
24+
The easiest way to install these tools is to create a virtual environment and
25+
install the tools into there.
2726

2827

2928
Using make
3029
----------
3130

32-
A Makefile has been prepared so that (on Unix), after you change into the
33-
``Doc/`` directory you can simply run ::
31+
To get started on UNIX, you can create a virtual environment with the command ::
32+
33+
make venv
34+
35+
That will install all the tools necessary to build the documentation. Assuming
36+
the virtual environment was created in the ``env`` directory (the default;
37+
configurable with the VENVDIR variable), you can run the following command to
38+
build the HTML output files::
3439

3540
make html
3641

@@ -39,17 +44,8 @@ look for instances of sphinxbuild and blurb installed on your process PATH
3944
(configurable with the SPHINXBUILD and BLURB variables).
4045

4146
On Windows, we try to emulate the Makefile as closely as possible with a
42-
``make.bat`` file.
43-
44-
To use a Python interpreter that's not called ``python3``, use the standard
45-
way to set Makefile variables, using e.g. ::
46-
47-
make html PYTHON=python
48-
49-
On Windows, set the PYTHON environment variable instead.
50-
51-
To use a specific sphinx-build (something other than ``sphinx-build``), set
52-
the SPHINXBUILD variable.
47+
``make.bat`` file. If you need to specify the Python interpreter to use,
48+
set the PYTHON environment variable instead.
5349

5450
Available make targets are:
5551

@@ -108,14 +104,11 @@ Available make targets are:
108104
Without make
109105
------------
110106

111-
Install the Sphinx package and its dependencies from PyPI. In this situation,
112-
you'll have to create a virtual environment manually, and install Sphinx into
113-
it. Change into the ``Doc`` directory and run ::
107+
First, install the tool dependencies from PyPI.
108+
109+
Then, from the ``Doc`` directory, run ::
114110

115-
$ python3 -m venv venv
116-
$ source venv/bin/activate
117-
(venv) $ pip install Sphinx
118-
(venv) $ sphinx-build -b<builder> . build/<builder>
111+
sphinx-build -b<builder> . build/<builder>
119112

120113
where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
121114
see the make targets above).

0 commit comments

Comments
 (0)