mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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 d8d6b91221
.
This commit is contained in:
parent
9522a218f7
commit
122fc136b3
3 changed files with 22 additions and 31 deletions
|
@ -36,7 +36,7 @@ matrix:
|
||||||
# (Updating the version is fine as long as no warnings are raised by doing so.)
|
# (Updating the version is fine as long as no warnings are raised by doing so.)
|
||||||
- python -m pip install sphinx~=1.6.1 blurb
|
- python -m pip install sphinx~=1.6.1 blurb
|
||||||
script:
|
script:
|
||||||
- make check suspicious html SPHINXBUILD="sphinx-build" SPHINXOPTS="-q -W -j4"
|
- make check suspicious html SPHINXOPTS="-q -W -j4"
|
||||||
- os: linux
|
- os: linux
|
||||||
language: c
|
language: c
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
|
12
Doc/Makefile
12
Doc/Makefile
|
@ -17,7 +17,7 @@ ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PA
|
||||||
|
|
||||||
.PHONY: help build html htmlhelp latex text changes linkcheck \
|
.PHONY: help build html htmlhelp latex text changes linkcheck \
|
||||||
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
|
suspicious coverage doctest pydoc-topics htmlview clean dist check serve \
|
||||||
autobuild-dev autobuild-stable
|
autobuild-dev autobuild-stable venv
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Please use \`make <target>' where <target> is one of"
|
@echo "Please use \`make <target>' where <target> is one of"
|
||||||
|
@ -39,7 +39,7 @@ help:
|
||||||
@echo " check to run a check for frequent markup errors"
|
@echo " check to run a check for frequent markup errors"
|
||||||
@echo " serve to serve the documentation on the localhost (8000)"
|
@echo " serve to serve the documentation on the localhost (8000)"
|
||||||
|
|
||||||
build: venv
|
build:
|
||||||
-mkdir -p build
|
-mkdir -p build
|
||||||
# Look first for a Misc/NEWS file (building from a source release tarball
|
# Look first for a Misc/NEWS file (building from a source release tarball
|
||||||
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
|
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
|
||||||
|
@ -122,11 +122,9 @@ clean:
|
||||||
-rm -rf build/* $(VENVDIR)/*
|
-rm -rf build/* $(VENVDIR)/*
|
||||||
|
|
||||||
venv:
|
venv:
|
||||||
@if [ "$(SPHINXBUILD)" == "PATH=$(VENVDIR)/bin:$$PATH sphinx-build" ]; then \
|
$(PYTHON) -m venv $(VENVDIR)
|
||||||
$(PYTHON) -m venv $(VENVDIR); \
|
$(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb
|
||||||
echo "A virtual environment for Docs has been made in the $(VENVDIR) directory"; \
|
@echo "The venv has been created in the $(VENVDIR) directory"
|
||||||
$(VENVDIR)/bin/python3 -m pip install Sphinx blurb; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
rm -rf dist
|
rm -rf dist
|
||||||
|
|
|
@ -21,16 +21,21 @@ tree but are maintained separately and are available from
|
||||||
* `Sphinx <https://pypi.org/project/Sphinx/>`_
|
* `Sphinx <https://pypi.org/project/Sphinx/>`_
|
||||||
* `blurb <https://pypi.org/project/blurb/>`_
|
* `blurb <https://pypi.org/project/blurb/>`_
|
||||||
|
|
||||||
You could manually create a virtual environment and install them, but there is
|
The easiest way to install these tools is to create a virtual environment and
|
||||||
a ``Makefile`` already set up to do this for you, as long as you have a working
|
install the tools into there.
|
||||||
Python 3 interpreter available.
|
|
||||||
|
|
||||||
|
|
||||||
Using make
|
Using make
|
||||||
----------
|
----------
|
||||||
|
|
||||||
A Makefile has been prepared so that (on Unix), after you change into the
|
To get started on UNIX, you can create a virtual environment with the command ::
|
||||||
``Doc/`` directory you can simply run ::
|
|
||||||
|
make venv
|
||||||
|
|
||||||
|
That will install all the tools necessary to build the documentation. Assuming
|
||||||
|
the virtual environment was created in the ``env`` directory (the default;
|
||||||
|
configurable with the VENVDIR variable), you can run the following command to
|
||||||
|
build the HTML output files::
|
||||||
|
|
||||||
make html
|
make html
|
||||||
|
|
||||||
|
@ -39,17 +44,8 @@ look for instances of sphinxbuild and blurb installed on your process PATH
|
||||||
(configurable with the SPHINXBUILD and BLURB variables).
|
(configurable with the SPHINXBUILD and BLURB variables).
|
||||||
|
|
||||||
On Windows, we try to emulate the Makefile as closely as possible with a
|
On Windows, we try to emulate the Makefile as closely as possible with a
|
||||||
``make.bat`` file.
|
``make.bat`` file. If you need to specify the Python interpreter to use,
|
||||||
|
set the PYTHON environment variable instead.
|
||||||
To use a Python interpreter that's not called ``python3``, use the standard
|
|
||||||
way to set Makefile variables, using e.g. ::
|
|
||||||
|
|
||||||
make html PYTHON=python
|
|
||||||
|
|
||||||
On Windows, set the PYTHON environment variable instead.
|
|
||||||
|
|
||||||
To use a specific sphinx-build (something other than ``sphinx-build``), set
|
|
||||||
the SPHINXBUILD variable.
|
|
||||||
|
|
||||||
Available make targets are:
|
Available make targets are:
|
||||||
|
|
||||||
|
@ -108,14 +104,11 @@ Available make targets are:
|
||||||
Without make
|
Without make
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Install the Sphinx package and its dependencies from PyPI. In this situation,
|
First, install the tool dependencies from PyPI.
|
||||||
you'll have to create a virtual environment manually, and install Sphinx into
|
|
||||||
it. Change into the ``Doc`` directory and run ::
|
|
||||||
|
|
||||||
$ python3 -m venv venv
|
Then, from the ``Doc`` directory, run ::
|
||||||
$ source venv/bin/activate
|
|
||||||
(venv) $ pip install Sphinx
|
sphinx-build -b<builder> . build/<builder>
|
||||||
(venv) $ sphinx-build -b<builder> . build/<builder>
|
|
||||||
|
|
||||||
where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
|
where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
|
||||||
see the make targets above).
|
see the make targets above).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue