Skip to content

Commit

Permalink
Merge branch 'python:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan authored Nov 18, 2024
2 parents 7c4e040 + a159185 commit dc267d3
Show file tree
Hide file tree
Showing 56 changed files with 4,217 additions and 1,895 deletions.
32 changes: 17 additions & 15 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ peps/pep-0012.rst @brettcannon @warsaw
peps/pep-0012/ @brettcannon
# peps/pep-0013.rst is owned by the entire core team.
# ...
#peps/pep-0020.rst
peps/pep-0020.rst @tim-one
# ...
peps/pep-0042.rst @jeremyhylton
# ...
Expand Down Expand Up @@ -79,7 +79,7 @@ peps/pep-0218.rst @rhettinger
# peps/pep-0220.rst
peps/pep-0221.rst @Yhg1s
# peps/pep-0222.rst
# peps/pep-0223.rst
peps/pep-0223.rst @tim-one
peps/pep-0224.rst @malemburg
# peps/pep-0225.rst
peps/pep-0226.rst @jeremyhylton
Expand All @@ -91,8 +91,8 @@ peps/pep-0231.rst @warsaw
peps/pep-0232.rst @warsaw
# peps/pep-0233.rst
peps/pep-0234.rst @gvanrossum
# peps/pep-0235.rst
# peps/pep-0236.rst
peps/pep-0235.rst @tim-one
peps/pep-0236.rst @tim-one
peps/pep-0237.rst @gvanrossum
peps/pep-0238.rst @gvanrossum
# peps/pep-0239.rst
Expand All @@ -111,7 +111,7 @@ peps/pep-0251.rst @warsaw @gvanrossum
peps/pep-0252.rst @gvanrossum
peps/pep-0253.rst @gvanrossum
peps/pep-0254.rst @gvanrossum
peps/pep-0255.rst @nascheme
peps/pep-0255.rst @nascheme @tim-one
# peps/pep-0256.rst
peps/pep-0257.rst @gvanrossum
# peps/pep-0258.rst
Expand Down Expand Up @@ -162,7 +162,7 @@ peps/pep-0302.rst @pfmoore
# peps/pep-0304.rst
# peps/pep-0305.rst
peps/pep-0306.rst @jackdied @ncoghlan @benjaminp
peps/pep-0307.rst @gvanrossum
peps/pep-0307.rst @gvanrossum @tim-one
peps/pep-0308.rst @gvanrossum @rhettinger
# peps/pep-0309.rst
peps/pep-0310.rst @pfmoore
Expand Down Expand Up @@ -354,17 +354,17 @@ peps/pep-0490.rst @vstinner
peps/pep-0492.rst @1st1
peps/pep-0493.rst @ncoghlan @malemburg
peps/pep-0494.rst @ned-deily
peps/pep-0495.rst @abalkin
peps/pep-0495-gap.png @abalkin
peps/pep-0495-gap.svg @abalkin
peps/pep-0495-fold.svg @abalkin
peps/pep-0495-fold-2.png @abalkin
peps/pep-0495-daylightsavings.png @abalkin
peps/pep-0495.rst @abalkin @tim-one
peps/pep-0495-gap.png @abalkin @tim-one
peps/pep-0495-gap.svg @abalkin @tim-one
peps/pep-0495-fold.svg @abalkin @tim-one
peps/pep-0495-fold-2.png @abalkin @tim-one
peps/pep-0495-daylightsavings.png @abalkin @tim-one
# peps/pep-0496.rst
# peps/pep-0497.rst
peps/pep-0498.rst @ericvsmith
# peps/pep-0499.rst
peps/pep-0500.rst @abalkin
peps/pep-0500.rst @abalkin @tim-one
peps/pep-0501.rst @ncoghlan
# peps/pep-0502.rst
peps/pep-0503.rst @dstufft
Expand Down Expand Up @@ -442,7 +442,7 @@ peps/pep-0568.rst @njsmith
peps/pep-0569.rst @ambv
peps/pep-0570.rst @larryhastings @pablogsal
# peps/pep-0571.rst
peps/pep-0572.rst @gvanrossum
peps/pep-0572.rst @tim-one @gvanrossum
peps/pep-0573.rst @encukou @ncoghlan @ericsnowcurrently
peps/pep-0574.rst @pitrou
# peps/pep-0575.rst
Expand Down Expand Up @@ -640,6 +640,8 @@ peps/pep-0759.rst @warsaw
peps/pep-0760.rst @pablogsal @brettcannon
peps/pep-0761.rst @sethmlarson @hugovk
peps/pep-0762.rst @pablogsal @ambv @lysnikolaou @emilyemorehouse
peps/pep-0763.rst @dstufft
peps/pep-0765.rst @iritkatriel @ncoghlan
# ...
peps/pep-0777.rst @warsaw
# ...
Expand Down Expand Up @@ -718,7 +720,7 @@ peps/pep-3156.rst @gvanrossum
# peps/pep-3333.rst
# ...
peps/pep-8000.rst @warsaw
peps/pep-8001.rst @brettcannon @tiran @dstufft @ericsnowcurrently @gpshead @ambv @Mariatta @njsmith @pablogsal @rhettinger @taleinat @zware
peps/pep-8001.rst @brettcannon @tiran @dstufft @ericsnowcurrently @gpshead @ambv @Mariatta @njsmith @pablogsal @rhettinger @taleinat @tim-one @zware
peps/pep-8002.rst @warsaw @ambv @pitrou @dhellmann @willingc
peps/pep-8010.rst @warsaw
peps/pep-8011.rst @Mariatta @warsaw
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,18 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
uses: tox-dev/action-pre-commit-uv@v1

- name: Check spelling
uses: pre-commit/action@v3.0.1
uses: tox-dev/action-pre-commit-uv@v1
with:
extra_args: --all-files --hook-stage manual codespell || true

check-peps:
name: Run check-peps
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3"

- name: Run check-peps
run: python check-peps.py --detailed
25 changes: 10 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,27 @@ 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
with:
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
allow-prereleases: true

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install -U tox
- name: Install uv
uses: hynek/setup-cached-uv@v2
with:
cache-dependency-path: |
requirements.txt
- name: Run tests
- name: Run tests with tox
run: |
tox -e py -- -v --cov-report term
uvx --with tox-uv tox -e py -- -v --cov-report term
- name: Upload coverage
uses: codecov/codecov-action@v4
Expand Down
150 changes: 13 additions & 137 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ minimum_pre_commit_version: '2.8.2'
default_language_version:
python: python3

default_stages: [commit]
default_stages: [pre-commit]


repos:
# General file checks and fixers
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: mixed-line-ending
name: "Normalize mixed line endings"
Expand Down Expand Up @@ -43,7 +43,7 @@ repos:
name: "Check YAML"

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
name: "Format with Black"
Expand All @@ -53,7 +53,7 @@ repos:
files: '^(peps/conf\.py|pep_sphinx_extensions/tests/.*)$'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
rev: v0.7.0
hooks:
- id: ruff
name: "Lint with Ruff"
Expand All @@ -62,13 +62,13 @@ repos:
files: '^pep_sphinx_extensions/tests/'

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
rev: 1.4.1
hooks:
- id: tox-ini-fmt
name: "Format tox.ini"

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
rev: v1.0.0
hooks:
- id: sphinx-lint
name: "Sphinx lint"
Expand Down Expand Up @@ -98,134 +98,10 @@ repos:
# Local checks for PEP headers and more
- repo: local
hooks:
# # Hook to run "check-peps.py"
# - id: "check-peps"
# name: "Check PEPs for metadata and content enforcement"
# entry: "python check-peps.py"
# language: "system"
# files: "^pep-\d{4}\.(rst|txt)$"
# require_serial: true

- id: check-required-headers
name: "PEPs must have all required headers"
language: pygrep
entry: '(?-m:^PEP:(?=[\s\S]*\nTitle:)(?=[\s\S]*\nAuthor:)(?=[\s\S]*\nStatus:)(?=[\s\S]*\nType:)(?=[\s\S]*\nCreated:))'
args: ['--negate', '--multiline']
files: '^peps/pep-\d+\.rst$'

- id: check-header-order
name: "PEP header order must follow PEP 12"
language: pygrep
entry: '^PEP:[^\n]+\nTitle:[^\n]+\n(Version:[^\n]+\n)?(Last-Modified:[^\n]+\n)?Author:[^\n]+\n( +\S[^\n]+\n)*(Sponsor:[^\n]+\n)?((PEP|BDFL)-Delegate:[^\n]*\n)?(Discussions-To:[^\n]*\n)?Status:[^\n]+\nType:[^\n]+\n(Topic:[^\n]+\n)?(Content-Type:[^\n]+\n)?(Requires:[^\n]+\n)?Created:[^\n]+\n(Python-Version:[^\n]*\n)?(Post-History:[^\n]*\n( +\S[^\n]*\n)*)?(Replaces:[^\n]+\n)?(Superseded-By:[^\n]+\n)?(Resolution:[^\n]*\n)?\n'
args: ['--negate', '--multiline']
files: '^peps/pep-\d+\.rst$'

- id: validate-pep-number
name: "'PEP' header must be a number 1-9999"
language: pygrep
entry: '(?-m:^PEP:(?:(?! +(0|[1-9][0-9]{0,3})\n)))'
args: ['--multiline']
files: '^peps/pep-\d+\.rst$'

- id: validate-title
name: "'Title' must be 1-79 characters"
language: pygrep
entry: '(?<=\n)Title:(?:(?! +\S.{1,78}\n(?=[A-Z])))'
args: ['--multiline']
files: '^peps/pep-\d+\.rst$'
exclude: '^peps/pep-(0499)\.rst$'

- id: validate-author
name: "'Author' must be list of 'Name <email@example.com>, ...'"
language: pygrep
entry: '(?<=\n)Author:(?:(?!((( +|\n {1,8})[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?)(,|(?=\n[^ ])))+\n(?=[A-Z])))'
args: ["--multiline"]
files: '^peps/pep-\d+\.rst$'

- id: validate-sponsor
name: "'Sponsor' must have format 'Name <email@example.com>'"
language: pygrep
entry: '^Sponsor:(?: (?! *[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-delegate
name: "'Delegate' must have format 'Name <email@example.com>'"
language: pygrep
entry: '^(PEP|BDFL)-Delegate: (?:(?! *[^!#$%&()*+,/:;<=>?@\[\\\]\^_`{|}~]+( <[\w!#$%&''*+\-/=?^_{|}~.]+(@| at )[\w\-.]+\.[A-Za-z0-9]+>)?$))'
files: '^peps/pep-\d+\.rst$'
exclude: '^peps/pep-(0451)\.rst$'

- id: validate-discussions-to
name: "'Discussions-To' must be a thread URL"
language: pygrep
entry: '^Discussions-To: (?:(?!([\w\-]+@(python\.org|googlegroups\.com))|https://((discuss\.python\.org/t/([\w\-]+/)?\d+/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?))$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-status
name: "'Status' must be a valid PEP status"
language: pygrep
entry: '^Status:(?:(?! +(Draft|Withdrawn|Rejected|Accepted|Final|Active|Provisional|Deferred|Superseded|April Fool!)$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-type
name: "'Type' must be a valid PEP type"
language: pygrep
entry: '^Type:(?:(?! +(Standards Track|Informational|Process)$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-topic
name: "'Topic' must be for a valid sub-index"
language: pygrep
entry: '^Topic:(?:(?! +(Governance|Packaging|Typing|Release)(, (Governance|Packaging|Typing|Release))*$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-content-type
name: "'Content-Type' must be 'text/x-rst'"
language: pygrep
entry: '^Content-Type:(?:(?! +text/x-rst$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-pep-references
name: "`Requires`/`Replaces`/`Superseded-By` must be 'NNN' PEP IDs"
language: pygrep
entry: '^(Requires|Replaces|Superseded-By):(?:(?! *( (0|[1-9][0-9]{0,3})(,|$))+$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-created
name: "'Created' must be a 'DD-mmm-YYYY' date"
language: pygrep
entry: '^Created:(?:(?! +([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-python-version
name: "'Python-Version' must be a 'X.Y[.Z]` version"
language: pygrep
entry: '^Python-Version:(?:(?! *( [1-9]\.([0-9][0-9]?|x)(\.[1-9][0-9]?)?(,|$))+$))'
files: '^peps/pep-\d+\.rst$'

- id: validate-post-history
name: "'Post-History' must be '`DD-mmm-YYYY <Thread URL>`__, ...'"
language: pygrep
entry: '(?<=\n)Post-History:(?:(?! ?\n|((( +|\n {1,14})(([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])|`([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9]) <https://((discuss\.python\.org/t/([\w\-]+/)?\d+(?:/\d+/|/?))|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))>`__)(,|(?=\n[^ ])))+\n(?=[A-Z\n]))))'
args: [--multiline]
files: '^peps/pep-\d+\.rst$'

- id: validate-resolution
name: "'Resolution' must be a direct thread/message URL"
language: pygrep
entry: '(?<!\n\n)(?<=\n)Resolution: (?:(?!https://((discuss\.python\.org/t/([\w\-]+/)?\d+(/\d+)?/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/(message|thread)/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))\n))'
args: ['--multiline']
files: '^peps/pep-\d+\.rst$'

- id: check-direct-pep-links
name: "Check that PEPs aren't linked directly"
language: pygrep
entry: '(dev/peps|peps\.python\.org)/pep-\d+'
files: '^peps/pep-\d+\.rst$'
exclude: '^peps/pep-(0009|0287|0676|0684|8001)\.rst$'

- id: check-direct-rfc-links
name: "Check that RFCs aren't linked directly"
language: pygrep
entry: '(rfc-editor\.org|ietf\.org)/[\.\-_\?\&\#\w/]*[Rr][Ff][Cc][\-_]?\d+'
types: ['rst']
# Hook to run "check-peps.py"
- id: "check-peps"
name: "Check PEPs for metadata and content enforcement"
entry: "python check-peps.py"
language: "python"
files: '^peps/pep-\d{4}\.rst$'
require_serial: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ htmlview: html
htmllive: SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-autobuild
# 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: SPHINXERRORHANDLING = --re-ignore="/\.idea/|/venv/|/numerical.rst|/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
Expand Down
Loading

0 comments on commit dc267d3

Please sign in to comment.