-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Document the make venv
documentation build target
#2953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
7440ae9
b4a8111
bdad7bb
d594bd3
bc606b8
58f3915
c54e41c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,45 +7,49 @@ available <https://docs.python.org/dev/download.html>`_. | |
|
||
Documentation on authoring Python documentation, including information about | ||
both style and markup, is available in the "`Documenting Python | ||
<https://docs.python.org/devguide/documenting.html>`_" chapter of the | ||
<https://devguide.python.org/documenting/>`_" chapter of the | ||
developers guide. | ||
|
||
|
||
Building the docs | ||
================= | ||
|
||
You need to have `Sphinx <http://sphinx-doc.org/>`_ installed; it is the toolset | ||
used to build the docs. It is not included in this tree, but maintained | ||
separately and `available from PyPI <https://pypi.python.org/pypi/Sphinx>`_. | ||
The documentation is built with several tools which are not included in this | ||
tree but are maintained separately and are available from | ||
`PyPI <https://pypi.org/>`_. | ||
|
||
* `Sphinx <https://pypi.org/project/Sphinx/>`_ | ||
* `blurb <https://pypi.org/project/blurb/>`_ | ||
|
||
Using make | ||
---------- | ||
The easiest way to install these tools is to create a virtual environment and | ||
install the tools into there. | ||
|
||
A Makefile has been prepared so that on Unix, provided you have installed | ||
Sphinx, you can just run :: | ||
|
||
make html | ||
|
||
to build the HTML output files. | ||
Using make | ||
---------- | ||
|
||
On Windows, we try to emulate the Makefile as closely as possible with a | ||
``make.bat`` file. | ||
To get started on UNIX, you can create a virtual environment with the command :: | ||
|
||
To use a Python interpreter that's not called ``python``, use the standard | ||
way to set Makefile variables, using e.g. :: | ||
make venv | ||
|
||
make html PYTHON=python3 | ||
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:: | ||
|
||
On Windows, set the PYTHON environment variable instead. | ||
make html PYTHON=./env/bin/python | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alas, this is currently insufficient. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Price I pay for wrapping this up before rushing out the door. 😞 But I think I found a better solution than having to activate the venv blindly: setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know I suggested something similar for blurb. But now I'm not sure that was the best choice. It's more problematic with sphinx-build since existing doc builds may have been depending on using an already installed (e.g. system) sphinx-build and have never bothered before to run the Either that or we need to make sure this is documented as an incompatible change and then maybe only for 3.7? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another possibility would be to make the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My worry with the I'm fine with this being a Python 3.7-only thing if that doesn't cause you grief in 3.6 releases. But if you would rather have the |
||
|
||
To use a specific sphinx-build (something other than ``sphinx-build``), set | ||
the SPHINXBUILD variable. | ||
On Windows, we try to emulate the Makefile as closely as possible with a | ||
``make.bat`` file. If you need to specify the Python interpreter to use, | ||
set the PYTHON environment variable instead. | ||
|
||
Available make targets are: | ||
|
||
* "clean", which removes all build files. | ||
|
||
* "venv", which creates a virtual environment with all necessary tools | ||
installed. | ||
|
||
* "html", which builds standalone HTML files for offline viewing. | ||
|
||
* "htmlview", which re-uses the "html" builder, but then opens the main page | ||
|
@@ -96,7 +100,7 @@ Available make targets are: | |
Without make | ||
------------ | ||
|
||
Install the Sphinx package and its dependencies from PyPI. | ||
First, install the tool dependencies from PyPI. | ||
|
||
Then, from the ``Doc`` directory, run :: | ||
|
||
|
@@ -109,11 +113,10 @@ see the make targets above). | |
Contributing | ||
============ | ||
|
||
Bugs in the content should be reported to the | ||
Bugs in the content should be reported to the | ||
`Python bug tracker <https://bugs.python.org>`_. | ||
|
||
Bugs in the toolset should be reported in the | ||
`Sphinx bug tracker <https://github.com/sphinx-doc/sphinx/issues>`_. | ||
Bugs in the toolset should be reported to the tools themselves. | ||
|
||
You can also send a mail to the Python Documentation Team at docs@python.org, | ||
and we will process your request as soon as possible. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's your thinking about changing the name of the venv directory from venv to env? Making the change would introduce a compatibility issue; even though "make venv" wasn't documented, it's likely being used and, besides leaving a stray "venv" directory around, it would also require current doc builders to change their scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just seen more use of
env
instead thanvenv
out in the wild is all. I can put it back.