Skip to content

Commit adf9512

Browse files
authored
Build Instructions: Fix to work with the latest Makefile (python#2485)
1 parent f163a0b commit adf9512

File tree

1 file changed

+40
-25
lines changed

1 file changed

+40
-25
lines changed

docs/build.rst

+40-25
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,40 @@ This can also be used to check that the PEP is valid reStructuredText before
1010
submission to the PEP editors.
1111

1212
The rest of this document assumes you are working from a local clone of the
13-
`PEPs repository <https://github.com/python/peps>`__, with Python 3.9 or later
14-
installed.
13+
`PEPs repository <https://github.com/python/peps>`__, with
14+
**Python 3.9 or later** installed.
1515

1616

1717
Render PEPs locally
1818
-------------------
1919

20-
1. Create a virtual environment and install requirements.
20+
1. Create a virtual environment and install requirements:
2121

22-
The rest of these instructions assume an active virtual environment named
23-
``venv``.
24-
The Python Packaging User Guide contains
25-
`instructions on creating a virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment>`__
26-
for reference.
22+
.. code-block:: shell
2723
28-
.. code-block:: console
24+
make venv
2925
30-
(venv) $ python -m pip install --upgrade pip
31-
(venv) $ python -m pip install -r requirements.txt
26+
If you don't have access to ``make``, run:
27+
28+
.. code-block:: ps1con
29+
30+
PS> python -m venv .venv
31+
PS> .\.venv\Scripts\activate
32+
(venv) PS> python -m pip install --upgrade pip
33+
(venv) PS> python -m pip install -r requirements.txt
3234
3335
2. **(Optional)** Delete prior build files.
3436
Generally only needed when making changes to the rendering system itself.
3537

36-
.. code-block:: console
38+
.. code-block:: shell
3739
38-
$ rm -rf build
40+
rm -rf build
3941
4042
3. Run the build script:
4143

42-
.. code-block:: console
44+
.. code-block:: shell
4345
44-
(venv) $ make render
46+
make render
4547
4648
If you don't have access to ``make``, run:
4749

@@ -63,17 +65,30 @@ Render PEPs locally
6365

6466
Several additional tools can be run through ``build.py``, or the Makefile.
6567

68+
Note that before using ``build.py`` you must activate the virtual environment
69+
created earlier:
70+
71+
.. code-block:: shell
72+
73+
source .venv/bin/activate
74+
75+
Or on Windows:
76+
77+
.. code-block:: ps1con
78+
79+
PS> .\.venv\Scripts\activate
80+
6681
6782
Check links
6883
'''''''''''
6984

7085
Check the validity of links within PEP sources (runs the `Sphinx linkchecker
7186
<https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.linkcheck.CheckExternalLinksBuilder>`__).
7287

73-
.. code-block:: console
88+
.. code-block:: shell
7489
75-
(venv) $ python build.py --check-links
76-
(venv) $ make check-links
90+
python build.py --check-links
91+
make check-links
7792
7893
7994
Stricter rendering
@@ -83,24 +98,24 @@ Run in `nit-picky <https://www.sphinx-doc.org/en/master/usage/configuration.html
8398
mode.
8499
This generates warnings for all missing references.
85100

86-
.. code-block:: console
101+
.. code-block:: shell
87102
88-
(venv) $ python build.py --nitpicky
103+
python build.py --nitpicky
89104
90105
Fail the build on any warning.
91106
As of January 2022, there are around 250 warnings when building the PEPs.
92107

93-
.. code-block:: console
108+
.. code-block:: shell
94109
95-
(venv) $ python build.py --fail-on-warning
96-
(venv) $ make fail-warning
110+
python build.py --fail-on-warning
111+
make fail-warning
97112
98113
99114
``build.py`` usage
100115
------------------
101116

102117
For details on the command-line options to the ``build.py`` script, run:
103118

104-
.. code-block:: console
119+
.. code-block:: shell
105120
106-
(venv) $ python build.py --help
121+
python build.py --help

0 commit comments

Comments
 (0)