Skip to content

Commit

Permalink
Merge branch 'main' into warsaw/pep712-reject
Browse files Browse the repository at this point in the history
  • Loading branch information
warsaw authored Jun 6, 2024
2 parents 4cc0321 + 7afb233 commit abf98a6
Show file tree
Hide file tree
Showing 71 changed files with 4,436 additions and 2,312 deletions.
10 changes: 8 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -610,21 +610,27 @@ peps/pep-0727.rst @JelleZijlstra
peps/pep-0728.rst @JelleZijlstra
peps/pep-0729.rst @JelleZijlstra @hauntsaninja
peps/pep-0730.rst @ned-deily
peps/pep-0731.rst @gvanrossum @encukou @vstinner @zooba @iritkatriel
peps/pep-0731.rst @gvanrossum @encukou @vstinner @zooba @erlend-aasland
peps/pep-0732.rst @Mariatta
peps/pep-0733.rst @encukou @vstinner @zooba @iritkatriel
peps/pep-0734.rst @ericsnowcurrently
peps/pep-0735.rst @brettcannon
peps/pep-0736.rst @gvanrossum @Rosuav
peps/pep-0736.rst @Rosuav
peps/pep-0737.rst @vstinner
peps/pep-0738.rst @encukou
peps/pep-0740.rst @dstufft
peps/pep-0741.rst @vstinner
peps/pep-0742.rst @JelleZijlstra
peps/pep-0743.rst @vstinner
peps/pep-0744.rst @brandtbucher
peps/pep-0745.rst @hugovk
peps/pep-0746.rst @JelleZijlstra
peps/pep-0749.rst @JelleZijlstra
# ...
# peps/pep-0754.rst
# ...
peps/pep-0789.rst @njsmith
# ...
peps/pep-0801.rst @warsaw
# ...
peps/pep-3000.rst @gvanrossum
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ jobs:
- "windows-latest"
- "macos-latest"
- "ubuntu-latest"
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.9", os: "macos-13" }


steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ build:
python: "3"

commands:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- make dirhtml JOBS=$(nproc) BUILDDIR=_readthedocs/html

sphinx:
Expand Down
43 changes: 31 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
BUILDER = html
JOBS = auto
SOURCES =
SPHINXERRORHANDLING = -W --keep-going -w sphinx-warnings.txt
SPHINXERRORHANDLING = --fail-on-warning --keep-going --warning-file sphinx-warnings.txt

ALLSPHINXOPTS = -b $(BUILDER) \
-j $(JOBS) \
ALLSPHINXOPTS = --builder $(BUILDER) \
--jobs $(JOBS) \
$(SPHINXOPTS) $(SPHINXERRORHANDLING) \
peps $(BUILDDIR) $(SOURCES)

Expand All @@ -26,11 +26,17 @@ html: venv
htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/index.html'))"

.PHONY: ensure-sphinx-autobuild
ensure-sphinx-autobuild: venv
$(call ensure_package,sphinx-autobuild)

## htmllive to rebuild and reload HTML files in your browser
.PHONY: htmllive
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
htmllive: SPHINXERRORHANDLING = --re-ignore="/\.idea/|/venv/|/pep-0000.rst|/topic/" --open-browser --delay 0
htmllive: html
# Arbitrarily selected ephemeral port between 49152–65535
# to avoid conflicts with other processes:
htmllive: SPHINXERRORHANDLING = --re-ignore="/\.idea/|/venv/|/pep-0000.rst|/topic/" --open-browser --delay 0 --port 55302
htmllive: ensure-sphinx-autobuild html

## dirhtml to render PEPs to "index.html" files within "pep-NNNN" directories
.PHONY: dirhtml
Expand All @@ -39,8 +45,8 @@ dirhtml: html

## linkcheck to check validity of links within PEP sources
.PHONY: linkcheck
check-links: BUILDER = linkcheck
check-links: html
linkcheck: BUILDER = linkcheck
linkcheck: html

## check-links (deprecated: use 'make linkcheck' alias instead)
.PHONY: pages
Expand All @@ -65,16 +71,29 @@ venv:
echo "To recreate it, remove it first with \`make clean-venv'."; \
else \
echo "Creating venv in $(VENVDIR)"; \
$(PYTHON) -m venv $(VENVDIR); \
$(VENVDIR)/bin/python3 -m pip install -U pip wheel; \
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
if uv --version > /dev/null; then \
uv venv $(VENVDIR); \
VIRTUAL_ENV=$(VENVDIR) uv pip install -r requirements.txt; \
else \
$(PYTHON) -m venv $(VENVDIR); \
$(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
fi; \
echo "The venv has been created in the $(VENVDIR) directory"; \
fi

define ensure_package
if uv --version > /dev/null; then \
$(VENVDIR)/bin/python3 -m $(1) --version > /dev/null || VIRTUAL_ENV=$(VENVDIR) uv pip install $(1); \
else \
$(VENVDIR)/bin/python3 -m $(1) --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install $(1); \
fi
endef

## lint to lint all the files
.PHONY: lint
lint: venv
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
$(call ensure_package,pre_commit)
$(VENVDIR)/bin/python3 -m pre_commit run --all-files

## test to test the Sphinx extensions for PEPs
Expand All @@ -85,7 +104,7 @@ test: venv
## spellcheck to check spelling
.PHONY: spellcheck
spellcheck: venv
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
$(call ensure_package,pre_commit)
$(VENVDIR)/bin/python3 -m pre_commit run --all-files --hook-stage manual codespell

.PHONY: help
Expand Down
11 changes: 5 additions & 6 deletions pep_sphinx_extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
from sphinx.application import Sphinx


def _depart_maths():
pass # No-op callable for the type checker


def _update_config_for_builder(app: Sphinx) -> None:
app.env.document_ids = {} # For PEPReferenceRoleTitleText
app.env.settings["builder"] = app.builder.name
Expand Down Expand Up @@ -75,14 +71,17 @@ def setup(app: Sphinx) -> dict[str, bool]:
"canonical-pypa-spec", pep_banner_directive.CanonicalPyPASpecBanner)
app.add_directive(
"canonical-typing-spec", pep_banner_directive.CanonicalTypingSpecBanner)
app.add_directive("rejected", pep_banner_directive.RejectedBanner)
app.add_directive("superseded", pep_banner_directive.SupersededBanner)
app.add_directive("withdrawn", pep_banner_directive.WithdrawnBanner)

# Register event callbacks
app.connect("builder-inited", _update_config_for_builder) # Update configuration values for builder used
app.connect("env-before-read-docs", create_pep_zero) # PEP 0 hook

# Mathematics rendering
inline_maths = HTMLTranslator.visit_math, _depart_maths
block_maths = HTMLTranslator.visit_math_block, _depart_maths
inline_maths = HTMLTranslator.visit_math, None
block_maths = HTMLTranslator.visit_math_block, None
app.add_html_math_renderer("maths_to_html", inline_maths, block_maths) # Render maths to HTML

# Parallel safety: https://www.sphinx-doc.org/en/master/extdev/index.html#extension-metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,34 @@ class CanonicalTypingSpecBanner(PEPBanner):
admonition_class = nodes.attention

css_classes = ["canonical-typing-spec", "sticky-banner"]


class DeprecatedBanner(PEPBanner):
"""Generic admonition for deprecated PEPs."""

admonition_class = nodes.warning
admonition_pre_template = "{link_content}"
admonition_pre_text = "This PEP has been deprecated."
css_classes = ["sticky-banner", "deprecated"]


class RejectedBanner(DeprecatedBanner):
"""Insert an admonition for rejected PEPs."""

admonition_pre_text = "This PEP has been rejected."
css_classes = ["sticky-banner", "deprecated", "rejected"]


class SupersededBanner(PEPBanner):
"""Insert an admonition for superseded PEPs."""

admonition_pre_template = "This PEP has been superseded by :pep:`{link_content}`."
admonition_pre_text = "This PEP has been superseded."
css_classes = ["sticky-banner", "deprecated", "superseded"]


class WithdrawnBanner(PEPBanner):
"""Insert an admonition for withdrawn PEPs."""

admonition_pre_text = "This PEP has been withdrawn."
css_classes = ["sticky-banner", "deprecated", "withdrawn"]
10 changes: 10 additions & 0 deletions peps/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Add any Sphinx extension module names here, as strings.
extensions = [
"pep_sphinx_extensions",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.githubpages",
]
Expand Down Expand Up @@ -53,12 +54,21 @@
'python': ('https://docs.python.org/3/', None),
'packaging': ('https://packaging.python.org/en/latest/', None),
'typing': ('https://typing.readthedocs.io/en/latest/', None),
'trio': ('https://trio.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),
}
intersphinx_disabled_reftypes = []

# sphinx.ext.extlinks
# This config is a dictionary of external sites,
# mapping unique short aliases to a base URL and a prefix.
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extlinks = {
"pypi": ("https://pypi.org/project/%s/", "%s"),
}

# -- Options for HTML output -------------------------------------------------

_PSE_PATH = _ROOT / "pep_sphinx_extensions"
Expand Down
24 changes: 7 additions & 17 deletions peps/pep-0003.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,17 @@ Title: Guidelines for Handling Bug Reports
Author: Jeremy Hylton <[email protected]>
Status: Withdrawn
Type: Process
Content-Type: text/x-rst
Created: 25-Sep-2000
Post-History:

.. withdrawn::

Introduction
============

This PEP contained guidelines for handling bug reports in the Python
bug tracker. It has been replaced by the Developer's Guide
description of issue triaging at

::

https://docs.python.org/devguide/triaging.html

Guidelines for people submitting Python bugs are at

::

http://docs.python.org/bugs.html
This PEP contained guidelines for handling bug reports in the Python
bug tracker. It has been replaced by the
`Developer's Guide description of issue triaging
<https://devguide.python.org/triage/triaging/index.html>`_.
Guidelines for people submitting Python bugs are `in the Python docs
<http://docs.python.org/bugs.html>`__.

Original Guidelines
===================
Expand Down
27 changes: 6 additions & 21 deletions peps/pep-0009.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
PEP: 9
Title: Sample Plaintext PEP Template
Version: $Revision$
Last-Modified: $Date$
Author: Barry Warsaw <[email protected]>
Status: Withdrawn
Type: Process
Content-Type: text/x-rst
Created: 14-Aug-2001
Post-History:
Resolution: https://mail.python.org/archives/list/[email protected]/thread/2YMHVPRDWGQLA5A2FKXE2JMLM2HQEEGW/

.. withdrawn::

::

Update
As of 05-Jan-2016, this PEP is officially deprecated and replaced
by :pep:`12`. All PEPs should now use the reStructuredText format
described by :pep:`12`, and plaintext PEPs will no longer be
accepted.

As of 05-Jan-2016, this PEP is officially deprecated and replaced
by PEP 12. All PEPs should now use the reStructuredText format
described by PEP 12, and plaintext PEPs will no longer be
accepted.
::

Abstract

Expand Down Expand Up @@ -225,14 +221,3 @@ Resolution: https://mail.python.org/archives/list/[email protected]/thread/2
Copyright

This document has been placed in the public domain.


..
Local Variables:
mode: indented-text
indent-tabs-mode: nil
sentence-end-double-space: t
fill-column: 70
coding: utf-8
End:
2 changes: 2 additions & 0 deletions peps/pep-0011.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ Tier 3
Target Triple Notes Contacts
================================ =========================== ========
aarch64-pc-windows-msvc Steve Dower
arm64-apple-ios iOS on device Ned Deily
arm64-apple-ios-simulator iOS on M1 macOS simulator Ned Deily
armv7l-unknown-linux-gnueabihf Raspberry Pi OS, glibc, gcc Gregory P. Smith
powerpc64le-unknown-linux-gnu glibc, clang Victor Stinner

Expand Down
21 changes: 6 additions & 15 deletions peps/pep-0042.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
PEP: 42
Title: Feature Requests
Version: $Revision$
Last-Modified: $Date$
Author: Jeremy Hylton <[email protected]>
Status: Withdrawn
Type: Process
Content-Type: text/x-rst
Created: 12-Sep-2000
Post-History:

.. withdrawn::

.. note:: This PEP has been `withdrawn as obsolete`_.
It is `obsolete`_.
All new feature requests should either go to the `Python bug tracker`_
for very simple requests or the `python-ideas`_ mailing list for
for very simple requests or the `Ideas Discourse category`_ for
everything else. The rest of this document is retained for historical
purposes only.

Expand Down Expand Up @@ -332,13 +330,6 @@ Building and Installing

http://bugs.python.org/issue588756

.. _`Python bug tracker`: https://bugs.python.org
.. _`python-ideas`: https://mail.python.org/mailman/listinfo/python-ideas
.. _`withdrawn as obsolete`: https://github.com/python/peps/pull/108#issuecomment-249603204


..
Local Variables:
mode: indented-text
indent-tabs-mode: nil
End:
.. _`Python bug tracker`: https://github.com/python/cpython/issues
.. _`Ideas Discourse category`: https://discuss.python.org/c/ideas/6
.. _`obsolete`: https://github.com/python/peps/pull/108#issuecomment-249603204
Loading

0 comments on commit abf98a6

Please sign in to comment.