PEP 612: Mark as Final (#3575)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
parent
6b226b1ae9
commit
f7f9f2d68a
|
@ -9,4 +9,6 @@ If you're unsure about something, just leave it blank and we'll take a look.
|
|||
* [ ] Any substantial changes since the accepted version approved by the SC/PEP delegate
|
||||
* [ ] Pull request title in appropriate format (``PEP 123: Mark Final``)
|
||||
* [ ] ``Status`` changed to ``Final`` (and ``Python-Version`` is correct)
|
||||
* [ ] Canonical docs/spec linked with a ``canonical-doc`` directive (or ``canonical-pypa-spec``, for packaging PEPs)
|
||||
* [ ] Canonical docs/spec linked with a ``canonical-doc`` directive
|
||||
(or ``canonical-pypa-spec`` for packaging PEPs,
|
||||
or ``canonical-typing-spec`` for typing PEPs)
|
||||
|
|
|
@ -73,6 +73,8 @@ def setup(app: Sphinx) -> dict[str, bool]:
|
|||
"canonical-doc", pep_banner_directive.CanonicalDocBanner)
|
||||
app.add_directive(
|
||||
"canonical-pypa-spec", pep_banner_directive.CanonicalPyPASpecBanner)
|
||||
app.add_directive(
|
||||
"canonical-typing-spec", pep_banner_directive.CanonicalTypingSpecBanner)
|
||||
|
||||
# Register event callbacks
|
||||
app.connect("builder-inited", _update_config_for_builder) # Update configuration values for builder used
|
||||
|
|
|
@ -6,6 +6,7 @@ from docutils import nodes
|
|||
from docutils.parsers import rst
|
||||
|
||||
PYPA_SPEC_BASE_URL = "https://packaging.python.org/en/latest/specifications/"
|
||||
TYPING_SPEC_BASE_URL = "https://typing.readthedocs.io/en/latest/spec/"
|
||||
|
||||
|
||||
class PEPBanner(rst.Directive):
|
||||
|
@ -24,7 +25,6 @@ class PEPBanner(rst.Directive):
|
|||
admonition_class = nodes.important
|
||||
css_classes = []
|
||||
|
||||
|
||||
def run(self) -> list[nodes.admonition]:
|
||||
|
||||
if self.arguments:
|
||||
|
@ -81,7 +81,6 @@ class CanonicalDocBanner(PEPBanner):
|
|||
css_classes = ["canonical-doc", "sticky-banner"]
|
||||
|
||||
|
||||
|
||||
class CanonicalPyPASpecBanner(PEPBanner):
|
||||
"""Insert a specialized admonition for PyPA packaging specifications."""
|
||||
|
||||
|
@ -103,3 +102,26 @@ class CanonicalPyPASpecBanner(PEPBanner):
|
|||
admonition_class = nodes.attention
|
||||
|
||||
css_classes = ["canonical-pypa-spec", "sticky-banner"]
|
||||
|
||||
|
||||
class CanonicalTypingSpecBanner(PEPBanner):
|
||||
"""Insert a specialized admonition for the typing specification."""
|
||||
|
||||
admonition_pre_template = (
|
||||
"This PEP is a historical document. "
|
||||
"The up-to-date, canonical spec, {link_content}, is maintained on "
|
||||
f"the `typing specs site <{TYPING_SPEC_BASE_URL}>`__."
|
||||
)
|
||||
admonition_pre_text = (
|
||||
"This PEP is a historical document. "
|
||||
"The up-to-date, canonical specifications are maintained on "
|
||||
f"the `typing specs site <{TYPING_SPEC_BASE_URL}>`__."
|
||||
)
|
||||
admonition_post_text = (
|
||||
"See the `typing specification update process "
|
||||
"<https://typing.readthedocs.io/en/latest/spec/meta.html>`__ "
|
||||
"for how to propose changes."
|
||||
)
|
||||
admonition_class = nodes.attention
|
||||
|
||||
css_classes = ["canonical-typing-spec", "sticky-banner"]
|
||||
|
|
|
@ -52,6 +52,7 @@ nitpicky = True
|
|||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/3/', None),
|
||||
'packaging': ('https://packaging.python.org/en/latest/', None),
|
||||
'typing': ('https://typing.readthedocs.io/en/latest/', None),
|
||||
'devguide': ('https://devguide.python.org/', None),
|
||||
'py3.11': ('https://docs.python.org/3.11/', None),
|
||||
'py3.12': ('https://docs.python.org/3.12/', None),
|
||||
|
|
|
@ -653,9 +653,11 @@ Canonical Documentation and Intersphinx
|
|||
As :pep:`PEP 1 describes <1#pep-maintenance>`,
|
||||
PEPs are considered historical documents once marked Final,
|
||||
and their canonical documentation/specification should be moved elsewhere.
|
||||
To indicate this, use the ``canonical-docs`` directive
|
||||
or an appropriate subclass
|
||||
(currently ``canonical-pypa-spec`` for packaging standards).
|
||||
To indicate this, use the ``canonical-doc`` directive
|
||||
or an appropriate subclass:
|
||||
|
||||
* ``canonical-pypa-spec`` for packaging standards
|
||||
* ``canonical-typing-spec`` for typing standards
|
||||
|
||||
Furthermore, you can use
|
||||
`Intersphinx references
|
||||
|
|
|
@ -4,14 +4,14 @@ Author: Mark Mendoza <mendoza.mark.a@gmail.com>
|
|||
Sponsor: Guido van Rossum <guido@python.org>
|
||||
BDFL-Delegate: Guido van Rossum <guido@python.org>
|
||||
Discussions-To: typing-sig@python.org
|
||||
Status: Accepted
|
||||
Status: Final
|
||||
Type: Standards Track
|
||||
Topic: Typing
|
||||
Content-Type: text/x-rst
|
||||
Created: 18-Dec-2019
|
||||
Python-Version: 3.10
|
||||
Post-History: 18-Dec-2019, 13-Jul-2020
|
||||
|
||||
.. canonical-typing-spec:: :ref:`typing:paramspec`
|
||||
|
||||
Abstract
|
||||
--------
|
||||
|
|
Loading…
Reference in New Issue