Skip to content
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

PEP 612: Mark as Final #3575

Merged
merged 6 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE/Mark a PEP Final.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions pep_sphinx_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
"canonical-doc", pep_banner_directive.CanonicalDocBanner)
app.add_directive(
"canonical-pypa-spec", pep_banner_directive.CanonicalPyPASpecBanner)
app.add_directive(

Check warning on line 76 in pep_sphinx_extensions/__init__.py

View check run for this annotation

Codecov / codecov/patch

pep_sphinx_extensions/__init__.py#L76

Added line #L76 was not covered by tests
"canonical-typing-spec", pep_banner_directive.CanonicalTypingSpecBanner)

# Register event callbacks
app.connect("builder-inited", _update_config_for_builder) # Update configuration values for builder used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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):
Expand All @@ -24,7 +25,6 @@ class PEPBanner(rst.Directive):
admonition_class = nodes.important
css_classes = []


def run(self) -> list[nodes.admonition]:

if self.arguments:
Expand Down Expand Up @@ -81,7 +81,6 @@ class CanonicalDocBanner(PEPBanner):
css_classes = ["canonical-doc", "sticky-banner"]



class CanonicalPyPASpecBanner(PEPBanner):
"""Insert a specialized admonition for PyPA packaging specifications."""

Expand All @@ -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"]
1 change: 1 addition & 0 deletions peps/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
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),
Expand Down
8 changes: 5 additions & 3 deletions peps/pep-0012.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions peps/pep-0612.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
hugovk marked this conversation as resolved.
Show resolved Hide resolved

Abstract
--------
Expand Down
Loading