Skip to content

Commit d286a46

Browse files
authored
PEP 1, 12: Update for adoption of PEP 676, and fix a few related items (#2447)
* PEP 1, 12: Update outdated references to Docutils to point to Sphinx * PEP 1, 12: Update and simplify outdated legacy rendering workflow steps * Readme: Fix minor issues introduced in PR #2399 * Infra: Update contents to include PEP rendering docs and avoid warnings * Lint: Update hardcoded PEP link checker to detect new PEP URLs
1 parent a733297 commit d286a46

File tree

6 files changed

+53
-65
lines changed

6 files changed

+53
-65
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ repos:
136136
- id: check-direct-pep-links
137137
name: "Check that PEPs aren't linked directly"
138138
language: pygrep
139-
entry: 'dev/peps/pep-\d+'
139+
entry: '(dev/peps|peps\.python\.org)/pep-\d+'
140140
files: '^pep-\d+\.(rst|txt)$'
141-
exclude: '^pep-(0009|0287|8001)\.(rst|txt)$'
141+
exclude: '^pep-(0009|0287|0676|8001)\.(rst|txt)$'
142142
types: [text]
143143
- id: check-direct-rfc-links
144144
name: "Check that RFCs aren't linked directly"

README.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Render PEPs locally
2828
-------------------
2929

3030
See the `build documentation <./docs/build.rst>`__ for full
31-
instructions on how to render PEPs locally. In summary:
31+
instructions on how to render PEPs locally.
32+
In summary, run the following in a fresh, activated virtual environment:
3233

3334
.. code-block:: bash
3435
@@ -38,15 +39,14 @@ instructions on how to render PEPs locally. In summary:
3839
# Render the PEPs
3940
make render
4041
41-
# or, if you don't have 'make':
42-
python3 build.py
43-
42+
# Or, if you don't have 'make':
43+
python build.py
4444
4545
The output HTML is found under the ``build`` directory.
4646

4747

48-
Tools to lint PEPs
49-
------------------
48+
Check and lint PEPs
49+
-------------------
5050

5151
You can check for and fix common linting and spelling issues,
5252
either on-demand or automatically as you commit, with our pre-commit suite.

contents.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
Python Enhancement Proposals (PEPs)
55
***********************************
66

7-
8-
This is an internal Sphinx page, please go to the :doc:`PEP Index <pep-0000>`.
7+
This is an internal Sphinx page; please go to the :doc:`PEP Index <pep-0000>`.
98

109

1110
.. toctree::
@@ -15,4 +14,5 @@ This is an internal Sphinx page, please go to the :doc:`PEP Index <pep-0000>`.
1514
:glob:
1615
:caption: PEP Table of Contents (needed for Sphinx):
1716

18-
pep-*
17+
docs/*
18+
pep-*

pep-0001.txt

+13-26
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ documenting dissenting opinions.
2626

2727
Because the PEPs are maintained as text files in a versioned
2828
repository, their revision history is the historical record of the
29-
feature proposal [1]_.
29+
feature proposal. This historical record is available by the normal git
30+
commands for retrieving older revisions, and can also be browsed
31+
`on GitHub <https://github.com/python/peps>`__.
3032

3133

3234
PEP Audience
@@ -285,8 +287,8 @@ the PEP Sponsor and PEP editors can advise them accordingly.
285287

286288
If the chosen venue is not the `Python-Dev`_ mailing list,
287289
a brief announcement should be posted there when the draft PEP is
288-
committed to the PEP repository and available on the PEP website,
289-
with a link to the rendered PEP and to the canonical ``Discussions-To`` thread.
290+
committed to the repository, which should include a link to the rendered PEP
291+
and to the canonical ``Discussions-To`` thread.
290292

291293
If a PEP undergoes a significant re-write or other major, substantive
292294
changes to its proposed specification, a new thread should typically be created
@@ -572,11 +574,11 @@ PEP Formats and Templates
572574
PEPs are UTF-8 encoded text files using the reStructuredText_ format.
573575
reStructuredText allows for rich markup that is still quite easy to
574576
read, but also results in good-looking and functional HTML. :pep:`12`
575-
contains instructions and a :pep:`template <12#suggested-sections>`
576-
for reStructuredText PEPs.
577+
contains instructions and a :pep:`PEP template <12#suggested-sections>`.
577578

578579
The PEP text files are automatically
579580
`converted to HTML <https://peps.python.org/docs/rendering_system/>`__
581+
(via a `Sphinx <https://www.sphinx-doc.org/>`_-based :pep:`build system <676>`)
580582
for easier `online reading <https://peps.python.org/>`__.
581583

582584

@@ -795,22 +797,13 @@ Once the PEP is ready for the repository, a PEP editor will:
795797
("Standards Track", "Informational", or "Process"), and marked its
796798
status as "Draft".
797799

798-
* Add the PEP to a local fork of the `PEP repository`_. For workflow
799-
instructions, follow `The Python Developers Guide <https://devguide.python.org/>`_
800+
* Ensure all CI build and lint checks pass without errors,
801+
and there are no obvious issues in the rendered preview output.
800802

801-
* Run ``./build.py`` to ensure the PEPs are generated without errors. If the
802-
rendering triggers errors, then the web site will not be updated to reflect
803-
the PEP changes.
803+
* Merge the new (or updated) PEP.
804804

805-
* Commit and push the new (or updated) PEP
806-
807-
* Monitor python.org to make sure the PEP gets added to the site
808-
properly. If it fails to appear, running ``make`` will build all of the
809-
current PEPs. If any of these are triggering errors, they must be
810-
corrected before any PEP will update on the site.
811-
812-
* Send email back to the PEP author with next steps (post to
813-
python-list & -dev).
805+
* Inform the author of the next steps (open a discussion thread and
806+
update the PEP with it, post an announcement to Python-Dev, etc).
814807

815808
Updates to existing PEPs should be submitted as a `GitHub pull request`_.
816809

@@ -835,19 +828,13 @@ Resources:
835828
Footnotes
836829
=========
837830

838-
.. [1] This historical record is available by the normal git commands
839-
for retrieving older revisions, and can also be browsed
840-
`on GitHub <https://github.com/python/peps>`__.
841-
842831
.. _.github/CODEOWNERS: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
843832

844833
.. _issue tracker: https://bugs.python.org/
845834

846835
.. _CC0-1.0-Universal: https://choosealicense.com/licenses/cc0-1.0/
847836

848-
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
849-
850-
.. _Docutils: https://docutils.sourceforge.io/
837+
.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
851838

852839
.. _PEP repository: https://github.com/python/peps
853840

pep-0012.rst

+25-24
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,10 @@ directions below.
154154
- Update your Footnotes section, listing any footnotes and
155155
non-inline link targets referenced by the text.
156156

157-
- Create a pull request against the https://github.com/python/peps
158-
repository.
157+
- Run ``./build.py`` to ensure the PEP is rendered without errors,
158+
and check that the output in ``build/pep-9999.html`` looks as you intend.
159+
160+
- Create a pull request against the `PEPs repository`_.
159161

160162
For reference, here are all of the possible header fields (everything
161163
in brackets should either be replaced or have the field removed if
@@ -680,33 +682,32 @@ Various sections are found to be common across PEPs and are outlined in
680682
Resources
681683
=========
682684

683-
Many other constructs and variations are possible. For more details
684-
about the reStructuredText markup, in increasing order of
685-
thoroughness, please see:
686-
687-
* `A ReStructuredText Primer`__, a gentle introduction.
688-
689-
__ https://docutils.sourceforge.io/docs/user/rst/quickstart.html
690-
691-
* `Quick reStructuredText`__, a users' quick reference.
685+
Many other constructs and variations are possible,
686+
both those supported by basic `Docutils <https://docutils.sourceforge.io/>`_
687+
and the extensions added by `Sphinx <https://www.sphinx-doc.org/>`_.
692688

693-
__ https://docutils.sourceforge.io/docs/user/rst/quickref.html
689+
A number of resources are available to learn more about them:
694690

695-
* `reStructuredText Markup Specification`__, the final authority.
691+
* `Sphinx ReStructuredText Primer
692+
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_,
693+
a gentle but fairly detailed introduction.
696694

697-
__ https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html
695+
* `reStructuredText Markup Specification
696+
<https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html>`_,
697+
the authoritative, comprehensive documentation of the basic reST syntax,
698+
directives, roles and more.
698699

699-
The processing of reStructuredText PEPs is done using Docutils_. If
700-
you have a question or require assistance with reStructuredText or
701-
Docutils, please `post a message`_ to the `Docutils-users mailing
702-
list`_. The `Docutils project web site`_ has more information.
700+
* `Sphinx Roles
701+
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html>`_
702+
and `Sphinx Directives
703+
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html>`_,
704+
the extended constructs added by the Sphinx documentation system used to
705+
render the PEPs to HTML.
703706

704-
.. _Docutils:
705-
.. _Docutils project web site: https://docutils.sourceforge.io/
706-
.. _post a message:
707-
mailto:[email protected]?subject=PEPs
708-
.. _Docutils-users mailing list:
709-
https://docutils.sourceforge.io/docs/user/mailing-lists.html#docutils-users
707+
If you have questions or require assistance with writing a PEP that the above
708+
resources don't address, ping ``@python/pep-editors`` on GitHub, open an
709+
`issue on the PEPs repository <https://github.com/python/peps/issues>`_
710+
or reach out to a PEP editor directly.
710711

711712

712713
Copyright

pep-0685.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ Specification
7777
=============
7878

7979
When comparing extra names, tools MUST normalize the names being compared
80-
using the semantics outlined in `PEP 503 for names <https://peps.python.org/pep-0503/#normalized-names>`__::
80+
using the semantics outlined in :pep:`PEP 503 <0503#normalized-names>`
81+
for names::
8182

8283
re.sub(r"[-_.]+", "-", name).lower()
8384

@@ -89,8 +90,8 @@ metadata version increase to ``2.3``.
8990

9091
For tools writing `core metadata`_,
9192
they MUST write out extra names in their normalized form.
92-
This applies to the `Provides-Extra`_ field and the `extra marker`_
93-
when used in the `Requires-Dist`_ field.
93+
This applies to the `Provides-Extra`_ field and the
94+
:pep:`extra marker <0508#extras>` when used in the `Requires-Dist`_ field.
9495

9596
Tools generating metadata MUST raise an error if a user specified
9697
two or more extra names which would normalize to the same name.
@@ -186,7 +187,6 @@ CC0-1.0-Universal license, whichever is more permissive.
186187

187188

188189
.. _core metadata: https://packaging.python.org/en/latest/specifications/core-metadata/
189-
.. _extra marker: https://peps.python.org/pep-0508/#extras
190190
.. _Name: https://packaging.python.org/en/latest/specifications/core-metadata/#name
191191
.. _packaging project: https://packaging.pypa.io
192192
.. _Provides-Extra: https://packaging.python.org/en/latest/specifications/core-metadata/#provides-extra-multiple-use

0 commit comments

Comments
 (0)