diff --git a/.editorconfig b/.editorconfig
index 0169eed95..5230b7695 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,5 +11,5 @@ indent_size = 4
[*.rst]
indent_size = 3
-[*.yml]
+[*.{css,yml}]
indent_size = 2
diff --git a/.flake8 b/.flake8
deleted file mode 100644
index f4546adb4..000000000
--- a/.flake8
+++ /dev/null
@@ -1,2 +0,0 @@
-[flake8]
-max_line_length = 88
diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
index 45402ea7f..235382276 100644
--- a/.github/CODE_OF_CONDUCT.md
+++ b/.github/CODE_OF_CONDUCT.md
@@ -4,9 +4,9 @@ Code of Conduct
Please note that all interactions on
[Python Software Foundation](https://www.python.org/psf-landing/)-supported
infrastructure is [covered](https://www.python.org/psf/records/board/minutes/2014-01-06/#management-of-the-psfs-web-properties)
-by the [PSF Code of Conduct](https://www.python.org/psf/conduct/),
+by the [PSF Code of Conduct](https://policies.python.org/python.org/code-of-conduct/),
which includes all infrastructure used in the development of Python itself
-(e.g. mailing lists, issue trackers, GitHub, etc.).
+(for example, mailing lists, issue trackers, GitHub, etc.).
In general this means everyone is expected to be open, considerate, and
respectful of others no matter what their position is within the project.
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index c54abaedc..028715319 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -29,17 +29,17 @@ our workflow that are not covered by a bot or status check are:
## Setting Expectations
-Due to the fact that this project is entirely volunteer-run (i.e. no one is paid
+Due to the fact that this project is entirely volunteer-run (that is, no one is paid
to work on Python full-time), we unfortunately can make no guarantees as to if
or when a core developer will get around to reviewing your pull request.
If no core developer has done a review or responded to changes made because of a
-"changes requested" review, please feel free to email [python-dev](https://mail.python.org/mailman3/lists/python-dev.python.org/) to ask if
-someone could take a look at your pull request.
+"changes requested" review, please consider seeking assistance through the
+[Core Development Discourse category](https://discuss.python.org/c/core-dev/23).
## Code of Conduct
All interactions for this project are covered by the
-[PSF Code of Conduct](https://www.python.org/psf/conduct/). Everyone is
+[PSF Code of Conduct](https://policies.python.org/python.org/code-of-conduct/). Everyone is
expected to be open, considerate, and respectful of others no matter their
position within the project.
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index 78aa34d6b..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
-
----
-
-> Note: This repo is for the Python devguide. If you are requesting an
-enhancement for the Python language or CPython interpreter,
-then the CPython issue tracker is better
-suited for this report: https://github.com/python/cpython/issues
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Screenshots**
-If applicable, add screenshots to help explain your problem.
-
-**Additional context**
-Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..b160c6ea1
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,39 @@
+name: "Bug report"
+description: Create a report to help us improve the Python devguide
+title: "Bug:
"
+labels: ["bug"]
+assignees: []
+
+body:
+ - type: markdown
+ attributes:
+ value: |
+ > [!NOTE]
+ > This repo is for the [Python developer's guide](https://devguide.python.org/).
+ > If you are reporting a bug for the Python language or
+ > CPython interpreter, then use the
+ > [CPython issue tracker](https://github.com/python/cpython/issues) instead.
+
+ - type: textarea
+ id: bug_description
+ attributes:
+ label: "Describe the bug"
+ description: A clear and concise description of what the bug is and, optionally, what you expected to happen.
+ validations:
+ required: true
+
+ - type: textarea
+ id: screenshots
+ attributes:
+ label: "Screenshots"
+ description: If applicable, add screenshots to help explain your problem.
+ validations:
+ required: false
+
+ - type: textarea
+ id: additional_context
+ attributes:
+ label: "Additional context"
+ description: Add any other context about the problem here.
+ validations:
+ required: false
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..cd8c31d2a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,14 @@
+blank_issues_enabled: false
+contact_links:
+ - name: CPython Documentation
+ url: https://docs.python.org/
+ about: Official CPython documentation - please check here before opening an issue.
+ - name: Python Website
+ url: https://python.org/
+ about: For all things Python
+ - name: PyPI Issues / Support
+ url: https://github.com/pypi/support
+ about: For issues with PyPI itself, PyPI accounts, or with packages hosted on PyPI.
+ - name: CPython Issues
+ url: https://github.com/python/cpython/issues
+ about: For issues with the CPython interpreter itself.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index eff8cb8f7..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,22 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: ''
-assignees: ''
-
----
-
-> Note: This repo is for the Python devguide. If you are requesting an
-enhancement for the Python language or CPython interpreter,
-then the CPython issue tracker is better
-suited for this report: https://github.com/python/cpython/issues
-
-**Describe the enhancement or feature you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..a4413c137
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,39 @@
+name: "Feature request"
+description: Suggest an idea for the Python devguide
+title: "Feature: "
+labels: ["enhancement"]
+assignees: []
+
+body:
+ - type: markdown
+ attributes:
+ value: |
+ > [!NOTE]
+ > This repo is for the [Python developer's guide](https://devguide.python.org/).
+ > If you are requesting an enhancement for the Python language or
+ > CPython interpreter, then use the
+ > [CPython issue tracker](https://github.com/python/cpython/issues) instead.
+
+ - type: textarea
+ id: feature_description
+ attributes:
+ label: "Describe the enhancement or feature you would like"
+ description: A clear and concise description of what you want to happen.
+ validations:
+ required: true
+
+ - type: textarea
+ id: alternatives
+ attributes:
+ label: "Describe alternatives you have considered"
+ description: A clear and concise description of any alternative solutions or features you have considered.
+ validations:
+ required: false
+
+ - type: textarea
+ id: additional_context
+ attributes:
+ label: "Additional context"
+ description: Add any other context or screenshots about the feature request here.
+ validations:
+ required: false
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3f798d074..22ad254eb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,10 +13,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
with:
python-version: "3"
- cache: pip
+ - name: Install uv
+ uses: hynek/setup-cached-uv@v2
- name: Build docs
run: make html
- name: Link check
diff --git a/.gitignore b/.gitignore
index df4dc9415..b71249201 100644
--- a/.gitignore
+++ b/.gitignore
@@ -91,3 +91,4 @@ celerybeat-schedule
include/branches.csv
include/end-of-life.csv
include/release-cycle.svg
+include/release-cycle-all.svg
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 60ea4bc4b..ae27fd1f2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,33 +1,13 @@
repos:
- - repo: https://github.com/asottile/pyupgrade
- rev: v3.15.0
- hooks:
- - id: pyupgrade
- args: [--py38-plus]
-
- - repo: https://github.com/psf/black-pre-commit-mirror
- rev: 23.12.1
- hooks:
- - id: black
- args: [--skip-string-normalization]
-
- - repo: https://github.com/PyCQA/isort
- rev: 5.13.2
- hooks:
- - id: isort
- args: [--profile=black]
-
- - repo: https://github.com/PyCQA/flake8
- rev: 6.1.0
- hooks:
- - id: flake8
- additional_dependencies:
- [flake8-2020, flake8-implicit-str-concat]
-
- - repo: https://github.com/pre-commit/pygrep-hooks
- rev: v1.10.0
- hooks:
- - id: python-check-blanket-noqa
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.5.7
+ hooks:
+ - id: ruff
+ name: Run Ruff (lint)
+ args: [--exit-non-zero-on-fix]
+ - id: ruff-format
+ name: Run Ruff (format)
+ args: [--check]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
diff --git a/.readthedocs.yml b/.readthedocs.yml
index 5d8884584..26e5be967 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -14,5 +14,8 @@ build:
python: "3"
commands:
+ - asdf plugin add uv
+ - asdf install uv latest
+ - asdf global uv latest
- make dirhtml BUILDDIR=_readthedocs
- mv _readthedocs/dirhtml _readthedocs/html
diff --git a/.ruff.toml b/.ruff.toml
new file mode 100644
index 000000000..af448e5b6
--- /dev/null
+++ b/.ruff.toml
@@ -0,0 +1,35 @@
+target-version = "py310"
+fix = true
+output-format = "full"
+line-length = 88
+
+[lint]
+preview = true
+select = [
+ "C4", # flake8-comprehensions
+ "B", # flake8-bugbear
+ "E", # pycodestyle
+ "F", # pyflakes
+ "FA", # flake8-future-annotations
+ "FLY", # flynt
+ "FURB", # refurb
+ "G", # flake8-logging-format
+ "I", # isort
+ "ISC", # flake8-implicit-str-concat
+ "LOG", # flake8-logging
+ "PERF", # perflint
+ "PGH", # pygrep-hooks
+ "PT", # flake8-pytest-style
+ "TCH", # flake8-type-checking
+ "UP", # pyupgrade
+ "W", # pycodestyle
+ "YTT", # flake8-2020
+]
+ignore = [
+ "E501", # Ignore line length errors (we use auto-formatting)
+]
+
+[format]
+preview = true
+quote-style = "preserve"
+docstring-code-format = true
diff --git a/Makefile b/Makefile
index 76f5b9df5..9817feb15 100644
--- a/Makefile
+++ b/Makefile
@@ -2,56 +2,45 @@
#
# You can set these variables from the command line.
-PYTHON = python3
-VENVDIR = ./venv
-SPHINXBUILD = $(VENVDIR)/bin/sphinx-build
-SPHINXOPTS = -W --keep-going
-BUILDDIR = _build
-BUILDER = html
-JOBS = auto
-PAPER =
-SPHINXLINT = $(VENVDIR)/bin/sphinx-lint
+PYTHON = python3
+VENVDIR = ./venv
+UV = uv
+SPHINXBUILD = $(VENVDIR)/bin/sphinx-build
+# Temporary: while we are using ..include:: to show the reorganization,
+# there are duplicate labels. These cause warnings, which prevent the
+# build from finishing. Turn off --fail-on-warning so we can see the
+# finished results.
+#SPHINXOPTS = --fail-on-warning
+SPHINXOPTS =
+BUILDDIR = _build
+BUILDER = html
+JOBS = auto
+SPHINXLINT = $(VENVDIR)/bin/sphinx-lint
+REQUIREMENTS = requirements.txt
# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -b $(BUILDER) \
- -d $(BUILDDIR)/doctrees \
- -j $(JOBS) \
- $(PAPEROPT_$(PAPER)) \
- $(SPHINXOPTS) \
- . $(BUILDDIR)/$(BUILDER)
+_ALL_SPHINX_OPTS = --jobs $(JOBS) $(SPHINXOPTS)
+_RELEASE_CYCLE = include/branches.csv \
+ include/end-of-life.csv \
+ include/release-cycle-all.svg \
+ include/release-cycle.svg
.PHONY: help
help:
@echo "Please use \`make ' where is one of"
@echo " venv to create a venv with necessary tools"
@echo " html to make standalone HTML files"
+ @echo " linkcheck to check all external links for integrity"
@echo " htmlview to open the index page built by the html target in your browser"
@echo " htmllive to rebuild and reload HTML files in your browser"
@echo " clean to remove the venv and build files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " check to run a check for frequent markup errors"
@echo " lint to lint all the files"
- @echo " versions to update release cycle after changing release-cycle.json"
.PHONY: clean
clean: clean-venv
-rm -rf $(BUILDDIR)/*
+ -rm -rf $(_RELEASE_CYCLE)
.PHONY: clean-venv
clean-venv:
@@ -70,102 +59,26 @@ venv:
ensure-venv:
@if [ ! -d $(VENVDIR) ] ; then \
echo "Creating venv in $(VENVDIR)"; \
- $(PYTHON) -m venv $(VENVDIR); \
- $(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
- $(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
+ if $(UV) --version >/dev/null 2>&1; then \
+ $(UV) venv --python=$(PYTHON) $(VENVDIR); \
+ VIRTUAL_ENV=$(VENVDIR) $(UV) pip install -r $(REQUIREMENTS); \
+ else \
+ $(PYTHON) -m venv $(VENVDIR); \
+ $(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
+ $(VENVDIR)/bin/python3 -m pip install -r $(REQUIREMENTS); \
+ fi; \
echo "The venv has been created in the $(VENVDIR) directory"; \
fi
-.PHONY: html
-html: ensure-venv versions
- $(SPHINXBUILD) $(ALLSPHINXOPTS)
-
-.PHONY: dirhtml
-dirhtml: BUILDER = dirhtml
-dirhtml: html
-
-.PHONY: singlehtml
-singlehtml: BUILDER = singlehtml
-singlehtml: html
-
-.PHONY: pickle
-pickle: BUILDER = pickle
-pickle: html
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-.PHONY: json
-json: BUILDER = json
-json: html
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-.PHONY: htmlhelp
-htmlhelp: BUILDER = htmlhelp
-htmlhelp: html
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/$(BUILDER)."
-
-.PHONY: qthelp
-qthelp: BUILDER = qthelp
-qthelp: html
-
-.PHONY: devhelp
-devhelp: BUILDER = devhelp
-devhelp: html
-
-.PHONY: epub
-epub: BUILDER = epub
-epub: html
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/$(BUILDER)."
-
-.PHONY: latex
-latex: BUILDER = latex
-latex: html
-
-.PHONY: latexpdf
-latexpdf: BUILDER = latex
-latexpdf: html
- @echo "Running LaTeX files through pdflatex..."
- make -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/$(BUILDER)."
-
-.PHONY: text
-text: BUILDER = text
-text: html
-
-.PHONY: man
-man: BUILDER = man
-man: html
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/$(BUILDER)."
-
-.PHONY: changes
-changes: BUILDER = changes
-changes: html
-
-.PHONY: linkcheck
-linkcheck: BUILDER = linkcheck
-linkcheck: html
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/$(BUILDER)/output.txt."
-
-.PHONY: doctest
-doctest: BUILDER = doctest
-doctest: html
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/$(BUILDER)/output.txt."
-
.PHONY: htmlview
htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))"
.PHONY: htmllive
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
-htmllive: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" --open-browser --delay 0
+# Arbitrarily selected ephemeral port between 49152β65535
+# to avoid conflicts with other processes:
+htmllive: SPHINXOPTS = --open-browser --delay 0 --port 55301
htmllive: html
.PHONY: check
@@ -173,25 +86,33 @@ check: ensure-venv
# Ignore the tools and venv dirs and check that the default role is not used.
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
-.PHONY: lint
-lint: venv
- $(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
- $(VENVDIR)/bin/python3 -m pre_commit run --all-files
+.PHONY: _ensure-package
+_ensure-package: venv
+ if $(UV) --version >/dev/null 2>&1; then \
+ VIRTUAL_ENV=$(VENVDIR) $(UV) pip install $(PACKAGE); \
+ else \
+ $(VENVDIR)/bin/python3 -m pip install $(PACKAGE); \
+ fi
-.PHONY: serve
-serve:
- @echo "The 'serve' target was removed, use 'htmlview' instead" \
- "(see https://github.com/python/cpython/issues/80510)"
+.PHONY: _ensure-pre-commit
+_ensure-pre-commit:
+ make _ensure-package PACKAGE=pre-commit
-include/branches.csv: include/release-cycle.json
- $(VENVDIR)/bin/python3 _tools/generate_release_cycle.py
+.PHONY: lint
+lint: _ensure-pre-commit
+ $(VENVDIR)/bin/python3 -m pre_commit run --all-files
-include/end-of-life.csv: include/release-cycle.json
- $(VENVDIR)/bin/python3 _tools/generate_release_cycle.py
+# Defined so that "include/release-cycle.json"
+# doesn't fall through to the catch-all target.
+include/release-cycle.json:
+ @exit
-include/release-cycle.svg: include/release-cycle.json
+$(_RELEASE_CYCLE): include/release-cycle.json
$(VENVDIR)/bin/python3 _tools/generate_release_cycle.py
-
-.PHONY: versions
-versions: venv include/branches.csv include/end-of-life.csv include/release-cycle.svg
@echo Release cycle data generated.
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option.
+.PHONY: Makefile
+%: Makefile ensure-venv $(_RELEASE_CYCLE)
+ $(SPHINXBUILD) -M $@ "." "$(BUILDDIR)" $(_ALL_SPHINX_OPTS)
diff --git a/_extensions/custom_roles.py b/_extensions/custom_roles.py
deleted file mode 100644
index f8c9bb895..000000000
--- a/_extensions/custom_roles.py
+++ /dev/null
@@ -1,43 +0,0 @@
-"""Sphinx extension to add custom roles.
-
-Based on https://protips.readthedocs.io/link-roles.html
-"""
-import urllib.parse
-
-from docutils import nodes
-
-
-def setup(app):
- # role to link to cpython files
- app.add_role(
- "cpy-file",
- autolink("https://github.com/python/cpython/blob/main/{}"),
- )
- # role to link to cpython labels
- app.add_role(
- "gh-label",
- autolink("https://github.com/python/cpython/labels/{}"),
- )
- # Parallel safety:
- # https://www.sphinx-doc.org/en/master/extdev/index.html#extension-metadata
- return {"parallel_read_safe": True, "parallel_write_safe": True}
-
-
-def autolink(pattern):
- def role(name, rawtext, text, lineno, inliner, _options=None, _content=None):
- """Combine literal + reference (unless the text is prefixed by a !)."""
- if " " in text:
- url_text = urllib.parse.quote(text)
- else:
- url_text = text
- url = pattern.format(url_text)
- # don't create a reference if the text starts with !
- if text.startswith('!'):
- node = nodes.literal(rawtext, text[1:])
- else:
- node = nodes.reference(
- rawtext, '', nodes.literal(rawtext, text), refuri=url, internal=False
- )
- return [node], []
-
- return role
diff --git a/_static/devguide_overrides.css b/_static/devguide_overrides.css
index e86b6c177..5b6d67b09 100644
--- a/_static/devguide_overrides.css
+++ b/_static/devguide_overrides.css
@@ -38,7 +38,7 @@
.release-cycle-chart .release-cycle-blob {
stroke-width: 1.6px;
- /* default colours, overriden below for individual statuses */
+ /* default colours, overridden below for individual statuses */
fill: var(--color-background-primary);
stroke: var(--color-foreground-primary);
}
@@ -48,35 +48,58 @@
fill: white;
}
-.release-cycle-chart .release-cycle-blob-label.release-cycle-blob-security,
-.release-cycle-chart .release-cycle-blob-label.release-cycle-blob-bugfix {
+.release-cycle-chart .release-cycle-blob-label.release-cycle-status-security,
+.release-cycle-chart .release-cycle-blob-label.release-cycle-status-bugfix {
/* but use black to improve contrast for lighter backgrounds */
fill: black;
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-end-of-life {
- fill: #DD2200;
- stroke: #FF8888;
+.release-cycle-chart .release-cycle-blob-label.release-cycle-status-end-of-life,
+.release-cycle-chart .release-cycle-blob-label.release-cycle-status-prerelease,
+.release-cycle-chart .release-cycle-blob-label.release-cycle-status-feature {
+ /* and FG when it's not in a blob */
+ fill: var(--color-foreground-primary);
+}
+
+.release-cycle-chart .release-cycle-status-end-of-life {
+ --status-bg-color: #DD2200;
+ --status-border-color: #FF8888;
+}
+
+.release-cycle-chart .release-cycle-status-security {
+ --status-bg-color: #FFDD44;
+ --status-border-color: #FF8800;
+}
+
+.release-cycle-chart .release-cycle-status-bugfix {
+ --status-bg-color: #00DD22;
+ --status-border-color: #008844;
+}
+
+.release-cycle-chart .release-cycle-status-prerelease {
+ --status-bg-color: teal;
+ --status-border-color: darkgreen;
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-security {
- fill: #FFDD44;
- stroke: #FF8800;
+.release-cycle-chart .release-cycle-status-feature {
+ --status-bg-color: #2222EE;
+ --status-border-color: #008888;
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-bugfix {
- fill: #00DD22;
- stroke: #008844;
+.release-cycle-chart .release-cycle-blob {
+ fill: var(--status-bg-color);
+ stroke: transparent;
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-prerelease {
- fill: teal;
- stroke: darkgreen;
+.release-cycle-chart .release-cycle-blob-full {
+ fill: var(--status-bg-color);
+ stroke: var(--status-border-color);
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-feature {
- fill: #2222EE;
- stroke: #008888;
+.release-cycle-chart .release-cycle-border {
+ fill: transparent;
+ stroke: var(--status-border-color);
+ stroke-width: 1.6px;
}
.good pre {
@@ -85,3 +108,18 @@
.bad pre {
border-left: 3px solid rgb(244, 76, 78);
}
+
+.extlink-cpy-file,
+.extlink-gh-label {
+ border: 1px solid var(--color-background-border);
+ border-radius: .2em;
+ font-family: var(--font-stack--monospace);
+ font-size: var(--font-size--small--2);
+ padding: .1em .2em;
+}
+
+/* Table cells should always top-align */
+
+table.docutils td {
+ vertical-align: top;
+}
diff --git a/_tools/generate_release_cycle.py b/_tools/generate_release_cycle.py
index 27b5cc3ec..63d98cfce 100644
--- a/_tools/generate_release_cycle.py
+++ b/_tools/generate_release_cycle.py
@@ -1,11 +1,11 @@
"""Read in a JSON and generate two CSVs and an SVG file."""
+
from __future__ import annotations
import argparse
import csv
import datetime as dt
import json
-import sys
import jinja2
@@ -25,30 +25,67 @@ def parse_date(date_str: str) -> dt.date:
return dt.date.fromisoformat(date_str)
+def parse_version(ver: str) -> list[int]:
+ return [int(i) for i in ver["key"].split(".")]
+
+
class Versions:
"""For converting JSON to CSV and SVG."""
- def __init__(self) -> None:
+ def __init__(self, *, limit_to_active=False, special_py27=False) -> None:
with open("include/release-cycle.json", encoding="UTF-8") as in_file:
self.versions = json.load(in_file)
# Generate a few additional fields
for key, version in self.versions.items():
version["key"] = key
- version["first_release_date"] = parse_date(version["first_release"])
+ ver_info = parse_version(version)
+ if ver_info >= [3, 13]:
+ full_years = 2
+ else:
+ full_years = 1.5
+ version["first_release_date"] = r1 = parse_date(version["first_release"])
+ version["start_security_date"] = r1 + dt.timedelta(days=full_years * 365)
version["end_of_life_date"] = parse_date(version["end_of_life"])
+
+ self.cutoff = min(ver["first_release_date"] for ver in self.versions.values())
+
+ if limit_to_active:
+ self.cutoff = min(
+ version["first_release_date"]
+ for version in self.versions.values()
+ if version["status"] != "end-of-life"
+ )
+ self.versions = {
+ key: version
+ for key, version in self.versions.items()
+ if version["end_of_life_date"] >= self.cutoff
+ or (special_py27 and key == "2.7")
+ }
+ if special_py27:
+ self.cutoff = min(self.cutoff, dt.date(2019, 8, 1))
+ self.id_key = "active"
+ else:
+ self.id_key = "all"
+
self.sorted_versions = sorted(
self.versions.values(),
- key=lambda v: [int(i) for i in v["key"].split(".")],
+ key=parse_version,
reverse=True,
)
+ # Set the row (Y coordinate) for the chart, to allow a gap between 2.7
+ # and the rest
+ y = len(self.sorted_versions) + (1 if special_py27 else 0)
+ for version in self.sorted_versions:
+ if special_py27 and version["key"] == "2.7":
+ y -= 1
+ version["y"] = y
+ y -= 1
+
def write_csv(self) -> None:
"""Output CSV files."""
- if sys.version_info >= (3, 11):
- now_str = str(dt.datetime.now(dt.UTC))
- else:
- now_str = str(dt.datetime.utcnow())
+ now_str = str(dt.datetime.now(dt.timezone.utc))
versions_by_category = {"branches": {}, "end-of-life": {}}
headers = None
@@ -71,7 +108,7 @@ def write_csv(self) -> None:
csv_file.writeheader()
csv_file.writerows(versions.values())
- def write_svg(self, today: str) -> None:
+ def write_svg(self, today: str, out_path: str) -> None:
"""Output SVG file."""
env = jinja2.Environment(
loader=jinja2.FileSystemLoader("_tools/"),
@@ -88,6 +125,8 @@ def write_svg(self, today: str) -> None:
# CSS.
# (Ideally we'd actually use `em` units, but SVG viewBox doesn't take
# those.)
+
+ # Uppercase sizes are un-scaled
SCALE = 18
# Width of the drawing and main parts
@@ -99,7 +138,7 @@ def write_svg(self, today: str) -> None:
# some positioning numbers in the template as well.
LINE_HEIGHT = 1.5
- first_date = min(ver["first_release_date"] for ver in self.sorted_versions)
+ first_date = self.cutoff
last_date = max(ver["end_of_life_date"] for ver in self.sorted_versions)
def date_to_x(date: dt.date) -> float:
@@ -108,7 +147,7 @@ def date_to_x(date: dt.date) -> float:
total_days = (last_date - first_date).days
ratio = num_days / total_days
x = ratio * (DIAGRAM_WIDTH - LEGEND_WIDTH - RIGHT_MARGIN)
- return x + LEGEND_WIDTH
+ return (x + LEGEND_WIDTH) * SCALE
def year_to_x(year: int) -> float:
"""Convert year number to an SVG X coordinate of 1st January"""
@@ -118,20 +157,21 @@ def format_year(year: int) -> str:
"""Format year number for display"""
return f"'{year % 100:02}"
- with open(
- "include/release-cycle.svg", "w", encoding="UTF-8", newline="\n"
- ) as f:
+ with open(out_path, "w", encoding="UTF-8", newline="\n") as f:
template.stream(
SCALE=SCALE,
- diagram_width=DIAGRAM_WIDTH,
- diagram_height=(len(self.sorted_versions) + 2) * LINE_HEIGHT,
+ diagram_width=DIAGRAM_WIDTH * SCALE,
+ diagram_height=(self.sorted_versions[0]["y"] + 2) * LINE_HEIGHT * SCALE,
years=range(first_date.year, last_date.year + 1),
- LINE_HEIGHT=LINE_HEIGHT,
+ line_height=LINE_HEIGHT * SCALE,
+ legend_width=LEGEND_WIDTH * SCALE,
+ right_margin=RIGHT_MARGIN * SCALE,
versions=list(reversed(self.sorted_versions)),
today=dt.datetime.strptime(today, "%Y-%m-%d").date(),
year_to_x=year_to_x,
date_to_x=date_to_x,
format_year=format_year,
+ id_key=self.id_key,
).dump(f)
@@ -148,8 +188,12 @@ def main() -> None:
args = parser.parse_args()
versions = Versions()
+ assert len(versions.versions) > 10
versions.write_csv()
- versions.write_svg(args.today)
+ versions.write_svg(args.today, "include/release-cycle-all.svg")
+
+ versions = Versions(limit_to_active=True, special_py27=True)
+ versions.write_svg(args.today, "include/release-cycle.svg")
if __name__ == "__main__":
diff --git a/_tools/release_cycle_template.svg.jinja b/_tools/release_cycle_template.svg.jinja
index 5d39d307a..d3d5866a0 100644
--- a/_tools/release_cycle_template.svg.jinja
+++ b/_tools/release_cycle_template.svg.jinja
@@ -2,20 +2,26 @@
+
+
+
+
+
+
{% for version in versions %}
- {% set y = loop.index * LINE_HEIGHT %}
+ {% set y = version.y * line_height %}
- {% if loop.index % 2 %}
+ {% if version.y % 2 %}
{% endif %}
{% endfor %}
@@ -23,8 +29,8 @@
{% for year in years %}
@@ -33,59 +39,159 @@
{% if not loop.last %}
{% endif %}
{% endfor %}
+
+
+
+
+
+
+
{% for version in versions %}
- {% set y = loop.index * LINE_HEIGHT %}
+
+
+ {% set top_y = version.y * line_height - 1 * SCALE %}
+ {% set height = 1.25 * SCALE %}
+ {% set start_x = date_to_x(version.first_release_date) %}
+ {% set end_x = date_to_x(version.end_of_life_date) %}
+ {% set radius = 0.25 * SCALE %}
+
+ {% set small_text_y = version.y * line_height - 0.1 * SCALE %}
+
+
+ {% set middle_x = ([end_x, date_to_x(version.start_security_date)]|min) %}
+ {% set left_width = (middle_x - start_x) %}
+ {% set right_width = (end_x - middle_x) %}
+
+ {% if version.status != "end-of-life" %}
+
+
+
+
+
+ {% else %}
+
+
+ {% endif %}
+
+
+
+ {{ version.status }}
+
Python {{ version.key }}
-
-
- {% set start_x = date_to_x(version.first_release_date) %}
- {% set end_x = date_to_x(version.end_of_life_date) %}
- {% set mid_x = (start_x + end_x) / 2 %}
-
-
- {{ version.status }}
-
{% endfor %}
diff --git a/conf.py b/conf.py
index 6de594b23..5050f5c45 100644
--- a/conf.py
+++ b/conf.py
@@ -1,12 +1,6 @@
-import os
-import sys
-import time
-
-# Location of custom extensions.
-sys.path.insert(0, os.path.abspath(".") + "/_extensions")
+import json
extensions = [
- 'custom_roles',
'notfound.extension',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
@@ -22,7 +16,7 @@
# General information about the project.
project = "Python Developer's Guide"
-copyright = f'2011-{time.strftime("%Y")}, Python Software Foundation'
+copyright = '2011 Python Software Foundation'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
@@ -69,6 +63,7 @@
# Login page
r"https://github.com/python/buildmaster-config/issues/new.*": r"https://github.com/login.*", # noqa: E501
r"https://github.com/python/core-workflow/issues/new.*": r"https://github.com/login.*", # noqa: E501
+ r"https://github.com/orgs/python/teams.*": r"https://github.com/login.*", # noqa: E501
# Archive redirect
r"https://github.com/python/cpython/archive/main.zip": r"https://codeload.github.com/python/cpython/zip/refs/heads/main", # noqa: E501
# Blob to tree
@@ -92,40 +87,45 @@
]
linkcheck_ignore = [
- # The voters repo is private and appears as a 404
- 'https://github.com/python/voters',
- # The python-core team link is private, redirects to login
- 'https://github.com/orgs/python/teams/python-core',
+ # Checks fail due to rate limits
+ r'https://github.com/.*',
+ r'https://www.gnu.org/software/autoconf/',
# The Discourse groups are private unless you are logged in
'https://discuss.python.org/groups/staff',
'https://discuss.python.org/groups/moderators',
'https://discuss.python.org/groups/admins',
- # The crawler gets "Anchor not found" for GitHub anchors
- r'https://github.com.+?#L\d+',
- r'https://github.com/cli/cli#installation',
- r'https://github.com/github/renaming#renaming-existing-branches',
- r'https://github.com/python/bedevere/#pr-state-machine',
# "Anchor not found":
r'https://packaging.python.org/.*#',
+ # "-rate limited-", causing a timeout
+ r'https://stackoverflow.com/.*',
# Discord doesn't allow robot crawlers: "403 Client Error: Forbidden"
r'https://support.discord.com/hc/en-us/articles/219070107-Server-Nicknames',
+ # Patreon also gives 403 to the GHA linkcheck runner
+ r'https://www.patreon.com/.*',
]
rediraffe_redirects = {
# Development Tools
"clang.rst": "development-tools/clang.rst",
- "coverity.rst": "development-tools/coverity.rst",
"gdb.rst": "development-tools/gdb.rst",
# Advanced Tools was renamed Development Tools in gh-1149
"advanced-tools/clang.rst": "development-tools/clang.rst",
- "advanced-tools/coverity.rst": "development-tools/coverity.rst",
"advanced-tools/gdb.rst": "development-tools/gdb.rst",
- # Core Developers
- "coredev.rst": "core-developers/become-core-developer.rst",
- "committing.rst": "core-developers/committing.rst",
- "developers.rst": "core-developers/developer-log.rst",
- "experts.rst": "core-developers/experts.rst",
- "motivations.rst": "core-developers/motivations.rst",
+ # Core team
+ "coredev.rst": "core-team/join-team.rst",
+ "committing.rst": "core-team/committing.rst",
+ "developers.rst": "core-team/team-log.rst",
+ "experts.rst": "core-team/experts.rst",
+ "motivations.rst": "core-team/motivations.rst",
+ # core-developers/ -> core-team/
+ "core-developers/become-core-developer.rst": "core-team/join-team.rst",
+ "core-developers/committing.rst": "core-team/committing.rst",
+ "core-developers/developer-log.rst": "core-team/team-log.rst",
+ "core-developers/experts.rst": "core-team/experts.rst",
+ "core-developers/index.rst": "core-team/index.rst",
+ "core-developers/memorialization.rst": "core-team/memorialization.rst",
+ "core-developers/motivations.rst": "core-team/motivations.rst",
+ "core-developers/responsibilities.rst": "core-team/responsibilities.rst",
# Developer Workflow
"c-api.rst": "developer-workflow/c-api.rst",
"communication.rst": "developer-workflow/communication-channels.rst",
@@ -138,6 +138,10 @@
# Documentation
"docquality.rst": "documentation/help-documenting.rst",
"documenting.rst": "documentation/start-documenting.rst",
+ # Translating
+ "documentation/translating.rst": "documentation/translations/translating.rst",
+ "translating.rst": "documentation/translations/translating.rst",
+ "coordinating.rst": "documentation/translations/coordinating.rst",
# Getting Started
"fixingissues.rst": "getting-started/fixing-issues.rst",
"help.rst": "getting-started/getting-help.rst",
@@ -172,14 +176,49 @@
# sphinx-notfound-page
notfound_urls_prefix = "/"
+# Dynamically expose the Python version associated with the "main" branch.
+# Exactly one entry in ``release-cycle.json`` should have ``"branch": "main"``.
+with open("include/release-cycle.json", encoding="UTF-8") as _f:
+ _cycle = json.load(_f)
+
+_main_version = next(
+ version for version, data in _cycle.items() if data.get("branch") == "main"
+)
+
+# prolog and epilogs
+rst_prolog = f"""
+.. |draft| replace::
+ This is part of a **Draft** of the Python Contributor's Guide.
+ Text in square brackets are notes about content to fill in.
+ Currently, the devguide and this new Contributor's Guide co-exist in the
+ repo. We are using Sphinx include directives to demonstrate the re-organization.
+ The final Contributor's Guide will replace the devguide with content in only one
+ place.
+ We welcome help with this!
+
+.. |purpose| replace::
+ The :ref:`contrib-plan` page has more details about the current state of this draft
+ and **how you can help**. See more info about the Contributor Guide in the
+ discussion forum: `Refactoring the DevGuide`_.
+
+.. _Refactoring the DevGuide: https://discuss.python.org/t/refactoring-the-devguide-into-a-contribution-guide/63409
+
+.. |main_version| replace:: {_main_version}
+
+"""
+
# 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
+_repo = "https://github.com/python/cpython"
extlinks = {
+ "cpy-file": (f"{_repo}/blob/main/%s", "%s"),
+ "gh-label": (f"{_repo}/labels/%s", "%s"),
"github": ("https://github.com/%s", "%s"),
"github-user": ("https://github.com/%s", "@%s"),
"pypi": ("https://pypi.org/project/%s/", "%s"),
+ "pypi-org": ("https://pypi.org/org/%s/", "%s"),
}
# sphinxext-opengraph config
diff --git a/contrib/code/developer-workflow.rst b/contrib/code/developer-workflow.rst
new file mode 100644
index 000000000..416ca2c02
--- /dev/null
+++ b/contrib/code/developer-workflow.rst
@@ -0,0 +1,25 @@
+====================
+Development workflow
+====================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`dev-workflow` page from the devguide]
+
+.. toctree::
+ :maxdepth: 5
+
+ ../../developer-workflow/communication-channels
+ ../../developer-workflow/development-cycle
+ ../../developer-workflow/stdlib
+ ../../developer-workflow/extension-modules
+ ../../developer-workflow/c-api
+ ../../developer-workflow/lang-changes
+ ../../developer-workflow/grammar
+ ../../developer-workflow/porting
+ ../../developer-workflow/sbom
+ ../../developer-workflow/psrt
diff --git a/contrib/code/development-tools.rst b/contrib/code/development-tools.rst
new file mode 100644
index 000000000..348ceb95a
--- /dev/null
+++ b/contrib/code/development-tools.rst
@@ -0,0 +1,19 @@
+=================
+Development tools
+=================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`development-tools` page from the devguide.]
+
+.. toctree::
+ :maxdepth: 5
+
+ ../../development-tools/clinic
+ ../../development-tools/gdb
+ ../../development-tools/clang
+ ../../development-tools/warnings
diff --git a/contrib/code/git.rst b/contrib/code/git.rst
new file mode 100644
index 000000000..7c7aaa57b
--- /dev/null
+++ b/contrib/code/git.rst
@@ -0,0 +1,11 @@
+========
+Git tips
+========
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[More git help for advanced things needed by code contributors.]
diff --git a/contrib/code/index.rst b/contrib/code/index.rst
new file mode 100644
index 000000000..768095066
--- /dev/null
+++ b/contrib/code/index.rst
@@ -0,0 +1,30 @@
+.. _c_code:
+
+==================
+Code contributions
+==================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[The main page for code contributors.]
+
+[We'll include code-focused content from the :ref:`main devguide page `: Quick
+reference, Quick links, Proposing changes, and so on.]
+
+[The existing :ref:`internals` section of the devguide will be fully
+migrated into the Python repo.]
+
+
+.. toctree::
+ :maxdepth: 5
+
+ setup
+ git
+ pull-request-lifecycle
+ developer-workflow
+ testing
+ development-tools
diff --git a/contrib/code/pull-request-lifecycle.rst b/contrib/code/pull-request-lifecycle.rst
new file mode 100644
index 000000000..30c0fd590
--- /dev/null
+++ b/contrib/code/pull-request-lifecycle.rst
@@ -0,0 +1,21 @@
+.. _code-pull-request-lifecycle:
+
+======================
+Pull request lifecycle
+======================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[Details of pull requests for code contributions. The existing
+:ref:`pull-request-lifecycle` page is long and includes many details.
+Some only apply to code contributions, but many are common to all
+contributions. Should we keep a common page, with extra steps here, or
+should this page have all of the details even if they are duplicated
+elsewhere?]
+
+[See :ref:`docs-pull-request-lifecycle` for the documentation half of this conundrum.]
diff --git a/contrib/code/setup.rst b/contrib/code/setup.rst
new file mode 100644
index 000000000..2d14bb0d9
--- /dev/null
+++ b/contrib/code/setup.rst
@@ -0,0 +1,12 @@
+==================
+Setup and building
+==================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[More setup and build instructions specifically for code contributors, building
+on the basics from the :ref:`Getting Started ` section.]
diff --git a/contrib/code/testing.rst b/contrib/code/testing.rst
new file mode 100644
index 000000000..575d1477a
--- /dev/null
+++ b/contrib/code/testing.rst
@@ -0,0 +1,20 @@
+=====================
+Testing and buildbots
+=====================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`testing` page from the devguide.]
+
+.. toctree::
+ :maxdepth: 5
+
+ ../../testing/run-write-tests
+ ../../testing/silence-warnings
+ ../../testing/coverage
+ ../../testing/buildbots
+ ../../testing/new-buildbot-worker
diff --git a/contrib/contrib-plan.rst b/contrib/contrib-plan.rst
new file mode 100644
index 000000000..65e386e2b
--- /dev/null
+++ b/contrib/contrib-plan.rst
@@ -0,0 +1,47 @@
+.. _contrib-plan:
+
+==================================
+[Plan for the Contributor's Guide]
+==================================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+We are in the process of updating and refactoring the devguide to be a
+Contributor's Guide. It will highlight the different kinds of contribution
+possible, and how to succeed at each kind.
+
+Currently, the Contibutor's Guide is a draft in this new last section of the
+devguide. We welcome feedback, but please understand that some of the current
+content is moving or skeletal.
+
+Repo structure
+==============
+
+While the reorganization is happening, we are keeping the old devguide as it
+is. The new Contributor's Guide is represented in this last section, but will
+eventually be the only content in the guide. To avoid copying content, we're
+using Sphinx include directives to display existing devguide content in its new
+Contributor's Guide location. That is not how the eventual Guide will be
+built. Once we are ready to make the Contributor's Guide real, we will
+rearrange content into its new location.
+
+How to help
+===========
+
+To help, you can:
+
+- `Write an issue`_ detailing a change you'd like to see here.
+- `Make a pull request`_ in this repo to add content.
+- Join us in the `Python Docs Discord`_ to collaborate with other docs-minded
+ community members.
+- Get in touch with the `Docs Editorial Board`_ to discuss larger documentation
+ concerns.
+
+.. _Write an issue: https://github.com/python/devguide/issues
+.. _Make a pull request: https://github.com/python/devguide/pulls
+.. _Python Docs Discord: https://discord.gg/qcfPbnM2zH
+.. _Docs Editorial Board: https://python.github.io/editorial-board/
diff --git a/contrib/core-team/committing.rst b/contrib/core-team/committing.rst
new file mode 100644
index 000000000..5b639cd5a
--- /dev/null
+++ b/contrib/core-team/committing.rst
@@ -0,0 +1,11 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core developers :ref:`committing` page from the devguide. We'll
+adjust "core developer" to "core team" where appropriate.]
+
+.. include:: ../../core-team/committing.rst
diff --git a/contrib/core-team/experts.rst b/contrib/core-team/experts.rst
new file mode 100644
index 000000000..73a9431c0
--- /dev/null
+++ b/contrib/core-team/experts.rst
@@ -0,0 +1,11 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core developers :ref:`experts` page from the devguide. We'll
+adjust "core developer" to "core team" where appropriate.]
+
+.. include:: ../../core-team/experts.rst
diff --git a/contrib/core-team/index.rst b/contrib/core-team/index.rst
new file mode 100644
index 000000000..d51a8a4e8
--- /dev/null
+++ b/contrib/core-team/index.rst
@@ -0,0 +1,25 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+.. _c_core-team:
+
+=========
+Core team
+=========
+
+[This is mostly re-organized from the :ref:`core-team` section of the devguide,
+but with "core developer" language changed to "core team" where possible.]
+
+.. toctree::
+ :maxdepth: 5
+
+ responsibilities
+ committing
+ experts
+ team-log
+ motivations
+ join-team
diff --git a/contrib/core-team/join-team.rst b/contrib/core-team/join-team.rst
new file mode 100644
index 000000000..70557589d
--- /dev/null
+++ b/contrib/core-team/join-team.rst
@@ -0,0 +1,11 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core developers :ref:`join-core-team` page from the devguide. We'll
+adjust "core developer" to "core team" where appropriate.]
+
+.. include:: ../../core-team/join-team.rst
diff --git a/contrib/core-team/motivations.rst b/contrib/core-team/motivations.rst
new file mode 100644
index 000000000..8fc6f94db
--- /dev/null
+++ b/contrib/core-team/motivations.rst
@@ -0,0 +1,11 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core developers :ref:`motivations` page from the devguide. We'll
+adjust "core developer" to "core team" where appropriate.]
+
+.. include:: ../../core-team/motivations.rst
diff --git a/contrib/core-team/responsibilities.rst b/contrib/core-team/responsibilities.rst
new file mode 100644
index 000000000..973385a15
--- /dev/null
+++ b/contrib/core-team/responsibilities.rst
@@ -0,0 +1,11 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core developers :ref:`responsibilities` page from the devguide. We'll
+adjust "core developer" to "core team" where appropriate.]
+
+.. include:: ../../core-team/responsibilities.rst
diff --git a/contrib/core-team/team-log.rst b/contrib/core-team/team-log.rst
new file mode 100644
index 000000000..d6b480d25
--- /dev/null
+++ b/contrib/core-team/team-log.rst
@@ -0,0 +1,11 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core team :ref:`team-log` page from the devguide. We'll
+adjust "core developer" to "core team" where appropriate.]
+
+.. include:: ../../core-team/team-log.rst
diff --git a/contrib/doc/devguide.rst b/contrib/doc/devguide.rst
new file mode 100644
index 000000000..2c83e5200
--- /dev/null
+++ b/contrib/doc/devguide.rst
@@ -0,0 +1,12 @@
+==================================
+Helping with the Developer's Guide
+==================================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing :ref:`devguide` page from the devguide.]
diff --git a/contrib/doc/help-documenting.rst b/contrib/doc/help-documenting.rst
new file mode 100644
index 000000000..befb4b246
--- /dev/null
+++ b/contrib/doc/help-documenting.rst
@@ -0,0 +1,12 @@
+==========================
+Helping with documentation
+==========================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing :ref:`help-documenting` page from the devguide.]
diff --git a/contrib/doc/index.rst b/contrib/doc/index.rst
new file mode 100644
index 000000000..dc8ec9307
--- /dev/null
+++ b/contrib/doc/index.rst
@@ -0,0 +1,29 @@
+.. _c_docs:
+
+===========================
+Documentation contributions
+===========================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[The main page for documentation contributors.]
+
+[We'll include docs-focused content from the :ref:`main devguide page `: Quick
+reference, Quick links, and so on.]
+
+
+.. toctree::
+ :maxdepth: 5
+
+ start-documenting
+ help-documenting
+ style-guide
+ markup
+ pull-request-lifecycle
+ translating
+ devguide
diff --git a/contrib/doc/markup.rst b/contrib/doc/markup.rst
new file mode 100644
index 000000000..96b9faad5
--- /dev/null
+++ b/contrib/doc/markup.rst
@@ -0,0 +1,12 @@
+=======================
+reStructuredText markup
+=======================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing :ref:`markup` page from the devguide.]
diff --git a/contrib/doc/pull-request-lifecycle.rst b/contrib/doc/pull-request-lifecycle.rst
new file mode 100644
index 000000000..a62e63728
--- /dev/null
+++ b/contrib/doc/pull-request-lifecycle.rst
@@ -0,0 +1,21 @@
+.. _docs-pull-request-lifecycle:
+
+======================
+Pull request lifecycle
+======================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[Details of pull requests for documentation contributions. The existing
+:ref:`pull-request-lifecycle` page is long and includes many details.
+Some only apply to code contributions, but many are common to all
+contributions. Should we keep a common page, with documentation tweaks here, or
+should this page have only the documentation details even if they are duplicated
+elsewhere?]
+
+[See :ref:`code-pull-request-lifecycle` for the code half of this conundrum.]
diff --git a/contrib/doc/start-documenting.rst b/contrib/doc/start-documenting.rst
new file mode 100644
index 000000000..c5cf96161
--- /dev/null
+++ b/contrib/doc/start-documenting.rst
@@ -0,0 +1,12 @@
+===============
+Getting started
+===============
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing documentation :ref:`start-documenting` page from the devguide.]
diff --git a/contrib/doc/style-guide.rst b/contrib/doc/style-guide.rst
new file mode 100644
index 000000000..87762f3e0
--- /dev/null
+++ b/contrib/doc/style-guide.rst
@@ -0,0 +1,12 @@
+===========
+Style guide
+===========
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing documentation :ref:`style-guide` page from the devguide.]
diff --git a/contrib/doc/translating.rst b/contrib/doc/translating.rst
new file mode 100644
index 000000000..baface2f0
--- /dev/null
+++ b/contrib/doc/translating.rst
@@ -0,0 +1,12 @@
+===========
+Translating
+===========
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing :ref:`translating` page from the devguide.]
diff --git a/contrib/index.rst b/contrib/index.rst
new file mode 100644
index 000000000..0b5a3edc6
--- /dev/null
+++ b/contrib/index.rst
@@ -0,0 +1,119 @@
+.. _c_root:
+
+==================================
+Python Contributor's Guide (draft)
+==================================
+
+.. raw:: html
+
+
+
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[Open question: how to divide content between this Introduction and the
+:ref:`introduction `?]
+
+This guide is a comprehensive resource for :ref:`contributing `
+to Python_ -- for both new and experienced contributors. It is :ref:`maintained
+` by the same community that maintains Python. We welcome your
+contributions to Python!
+
+We encourage everyone to contribute to Python. This guide should have
+everything you need to get started and be productive. If you still have
+questions after reviewing the material in this guide, the `Core Python
+Mentorship`_ group is available to help you through the process.
+
+There are a number of ways to contribute including code, documentation, and
+triaging issues. We've organized this guide to provide specifics based on the
+type of activity you'll be engaged in.
+
+
+Using this guide
+================
+
+We recommend reading this guide as needed. You can stop where you feel
+comfortable and begin contributing immediately without reading and
+understanding everything. If you do choose to skip around this guide, be aware
+that it is written assuming preceding sections have been read so you may need
+to backtrack to fill in missing concepts and terminology.
+
+No matter what kind of contribution you'll be making, you should start with
+these common sections:
+
+* :ref:`c_intro`
+* :ref:`c_project`
+
+Then choose a path based on your type of activity:
+
+*[The original table on the devguide home had a fourth column for Core
+Developers. That made the table wider and more confusing. I don't think core
+team members need a quick intro path since they will have been through the
+devguide before.]*
+
+*[I haven't adjusted the links in the table yet other than to add a link to the
+major section at the top of each column.]*
+
+.. list-table::
+ :widths: 10 10 10
+ :header-rows: 1
+
+ * - :ref:`Documentation `
+ - :ref:`Code `
+ - :ref:`Triaging `
+ * -
+ * :ref:`docquality`
+ * :ref:`documenting`
+ * :ref:`style-guide`
+ * :ref:`rst-primer`
+ * :doc:`documentation/translations`
+ * :ref:`devguide`
+ -
+ * :ref:`setup`
+ * :ref:`help`
+ * :ref:`pullrequest`
+ * :ref:`runtests`
+ * :ref:`fixingissues`
+ * :ref:`communication`
+ * :ref:`gitbootcamp`
+ * :ref:`devcycle`
+ -
+ * :ref:`tracker`
+ * :ref:`triaging`
+ * :ref:`helptriage`
+ * :ref:`experts`
+ * :ref:`labels`
+ * :ref:`gh-faq`
+ * :ref:`triage-team`
+
+Core team members will find guidance in the :ref:`c_core-team` section.
+
+Contents
+========
+
+.. toctree::
+ :maxdepth: 3
+
+ contrib-plan
+ intro/index
+ project/index
+ triage/index
+ doc/index
+ code/index
+ core-team/index
+ user-success
+ security
+ workflows/index
+
+
+.. _Python: https://www.python.org/
+.. _Core Python Mentorship: https://www.python.org/dev/core-mentorship/
diff --git a/contrib/intro/index.rst b/contrib/intro/index.rst
new file mode 100644
index 000000000..c5ba303df
--- /dev/null
+++ b/contrib/intro/index.rst
@@ -0,0 +1,53 @@
+.. _c_intro:
+
+============
+Introduction
+============
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+
+[Open question: how to divide content between this Introduction and the
+:ref:`home page `?]
+
+Welcome!
+
+New to open source?
+===================
+
+Python is an open source project, with culture and techniques from the broader
+open source world. You might find it helpful to read about open source in
+general. A number of individuals from the Python community have contributed to
+a series of excellent guides at `Open Source Guides
+ `_.
+
+Anyone will find the following guides useful:
+
+* `How to Contribute to Open Source `_
+* `Building Welcoming Communities `_
+
+
+Healthy collaboration
+=====================
+
+[Importance of healthy inclusive collaboration]
+
+[While code is a large part of the project's success, project management, documentation, governance, sprint outreach, etc. matter.]
+
+[We respect the individual skills people bring to the project and strive to create and maintain a culture of inclusion.]
+
+About this guide
+================
+
+Types of contribution
+=====================
+
+[Pathways for contributors]
+
+Helping with this guide
+=======================
diff --git a/contrib/project/channels.rst b/contrib/project/channels.rst
new file mode 100644
index 000000000..711dbe587
--- /dev/null
+++ b/contrib/project/channels.rst
@@ -0,0 +1,16 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+======================
+Communication channels
+======================
+
+* Repos
+* Discourse
+* Discord
+* Mailing lists (deprioritize)
+* Where to get help
diff --git a/contrib/project/conduct.rst b/contrib/project/conduct.rst
new file mode 100644
index 000000000..37fe3bbfa
--- /dev/null
+++ b/contrib/project/conduct.rst
@@ -0,0 +1,16 @@
+===============
+Code of Conduct
+===============
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[Brief summary of the code of conduct, with links to official source.]
+
+* Standard for communication
+* How to report
+* Enforcement details
diff --git a/contrib/project/directory-structure.rst b/contrib/project/directory-structure.rst
new file mode 100644
index 000000000..0cebb25f7
--- /dev/null
+++ b/contrib/project/directory-structure.rst
@@ -0,0 +1,17 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_directory_structure:
+
+===================
+Directory structure
+===================
+
+[This is the :ref:`build_directory_structure` section from the devguide.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_directory_structure_start
+ :end-before: c_directory_structure_end
diff --git a/contrib/project/generative-ai.rst b/contrib/project/generative-ai.rst
new file mode 100644
index 000000000..6cb5b62ff
--- /dev/null
+++ b/contrib/project/generative-ai.rst
@@ -0,0 +1,10 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing :ref:`generative-ai` page from the devguide.]
+
+.. include:: ../../getting-started/generative-ai.rst
diff --git a/contrib/project/github.rst b/contrib/project/github.rst
new file mode 100644
index 000000000..fe45c6b8b
--- /dev/null
+++ b/contrib/project/github.rst
@@ -0,0 +1,15 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+======
+GitHub
+======
+
+[Where are the actual artifacts?]
+
+* Main CPython repos
+* Core workflow repos
+* Infrastructure repos
diff --git a/contrib/project/governance.rst b/contrib/project/governance.rst
new file mode 100644
index 000000000..a4bc66ff1
--- /dev/null
+++ b/contrib/project/governance.rst
@@ -0,0 +1,25 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+==========
+Governance
+==========
+
+[How decisions are made, who is involved, how to participate.]
+
+Steering Council
+================
+
+Documentation Editorial Board
+=============================
+
+Typing Council
+==============
+
+
+Others?
+=======
diff --git a/contrib/project/index.rst b/contrib/project/index.rst
new file mode 100644
index 000000000..9d3c89b9a
--- /dev/null
+++ b/contrib/project/index.rst
@@ -0,0 +1,29 @@
+.. _c_project:
+
+===================
+The CPython project
+===================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[Give the reader an understanding of the project as a whole. What are the
+moving parts, who is involved, how do they interact?]
+
+* Structure
+
+.. toctree::
+ :maxdepth: 5
+
+ conduct
+ roles
+ governance
+ generative-ai.rst
+ github
+ directory-structure.rst
+ channels
+ outreach
diff --git a/contrib/project/outreach.rst b/contrib/project/outreach.rst
new file mode 100644
index 000000000..d43aa8e9d
--- /dev/null
+++ b/contrib/project/outreach.rst
@@ -0,0 +1,12 @@
+========
+Outreach
+========
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+* Sprints
diff --git a/contrib/project/roles.rst b/contrib/project/roles.rst
new file mode 100644
index 000000000..8336fe465
--- /dev/null
+++ b/contrib/project/roles.rst
@@ -0,0 +1,17 @@
+=====
+Roles
+=====
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[Quick overview of the roles people play. Core team has its own section.]
+
+* Core team
+* Triager
+* Contributors
+ * types of contributions
diff --git a/contrib/security.rst b/contrib/security.rst
new file mode 100644
index 000000000..db40b4a16
--- /dev/null
+++ b/contrib/security.rst
@@ -0,0 +1,13 @@
+=========================================
+Security and infrastructure contributions
+=========================================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+* Security
+* Infrastructure
+* Core workflow
diff --git a/contrib/triage/index.rst b/contrib/triage/index.rst
new file mode 100644
index 000000000..0a547d9d7
--- /dev/null
+++ b/contrib/triage/index.rst
@@ -0,0 +1,14 @@
+.. _c_triage:
+
+===================
+Issues and triaging
+===================
+
+.. toctree::
+ :maxdepth: 5
+
+ issue-tracker
+ triaging
+ labels
+ reviewing
+ triage-team
diff --git a/contrib/triage/issue-tracker.rst b/contrib/triage/issue-tracker.rst
new file mode 100644
index 000000000..a5777bc81
--- /dev/null
+++ b/contrib/triage/issue-tracker.rst
@@ -0,0 +1,9 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`issue-tracker` page from the devguide]
+
+.. include:: ../../triage/issue-tracker.rst
diff --git a/contrib/triage/labels.rst b/contrib/triage/labels.rst
new file mode 100644
index 000000000..c36481733
--- /dev/null
+++ b/contrib/triage/labels.rst
@@ -0,0 +1,9 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`labels` page from the devguide]
+
+.. include:: ../../triage/labels.rst
diff --git a/contrib/triage/reviewing.rst b/contrib/triage/reviewing.rst
new file mode 100644
index 000000000..060f6b78d
--- /dev/null
+++ b/contrib/triage/reviewing.rst
@@ -0,0 +1,13 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+=========
+Reviewing
+=========
+
+* How? Etiquette?
+* How to request a review?
diff --git a/contrib/triage/triage-team.rst b/contrib/triage/triage-team.rst
new file mode 100644
index 000000000..a9b59056a
--- /dev/null
+++ b/contrib/triage/triage-team.rst
@@ -0,0 +1,9 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`triage-team` page from the devguide]
+
+.. include:: ../../triage/triage-team.rst
diff --git a/contrib/triage/triaging.rst b/contrib/triage/triaging.rst
new file mode 100644
index 000000000..22e1ccc65
--- /dev/null
+++ b/contrib/triage/triaging.rst
@@ -0,0 +1,9 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+[This is the existing :ref:`triaging` page from the devguide]
+
+.. include:: ../../triage/triaging.rst
diff --git a/contrib/user-success.rst b/contrib/user-success.rst
new file mode 100644
index 000000000..2a9ef5d4e
--- /dev/null
+++ b/contrib/user-success.rst
@@ -0,0 +1,14 @@
+=======================================
+Accessibility, design, and user success
+=======================================
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+* Accessibility
+* Design
+* User success
diff --git a/contrib/workflows/codespaces.rst b/contrib/workflows/codespaces.rst
new file mode 100644
index 000000000..eb97ef7c2
--- /dev/null
+++ b/contrib/workflows/codespaces.rst
@@ -0,0 +1,17 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_using_codespaces:
+
+=======================
+Using GitHub Codespaces
+=======================
+
+[This is the :ref:`using-codespaces` section from the devguide.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_codespaces_start
+ :end-before: c_codespaces_end
diff --git a/contrib/workflows/compile.rst b/contrib/workflows/compile.rst
new file mode 100644
index 000000000..18157b717
--- /dev/null
+++ b/contrib/workflows/compile.rst
@@ -0,0 +1,22 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_compiling:
+
+=================
+Compile and build
+=================
+
+.. note::
+ [This is the :ref:`compiling` section from the devguide. I think this page
+ is too long and could be split by build target, but we can leave that for a
+ later time.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_compile_and_build_start
+ :end-before: c_compile_and_build_end
+
+.. include:: ../../links.rst
diff --git a/contrib/workflows/get-source.rst b/contrib/workflows/get-source.rst
new file mode 100644
index 000000000..ed56fe4e1
--- /dev/null
+++ b/contrib/workflows/get-source.rst
@@ -0,0 +1,19 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_checkout:
+
+===================
+Get the source code
+===================
+
+.. note::
+ [This is the :ref:`checkout` section from the devguide. We might need to edit
+ it to clarify that some steps are only needed for code contribution.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_get_source_code_start
+ :end-before: c_get_source_code_end
diff --git a/contrib/workflows/index.rst b/contrib/workflows/index.rst
new file mode 100644
index 000000000..2c6ccf2bc
--- /dev/null
+++ b/contrib/workflows/index.rst
@@ -0,0 +1,25 @@
+.. _c_workflows:
+
+=========
+Workflows
+=========
+
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+This section contains details of workflows needed for all kinds of
+contribution.
+
+.. toctree::
+
+ install-git.rst
+ get-source.rst
+ install-dependencies.rst
+ compile.rst
+ regenerate.rst
+ troubleshooting.rst
+ codespaces.rst
diff --git a/contrib/workflows/install-dependencies.rst b/contrib/workflows/install-dependencies.rst
new file mode 100644
index 000000000..9a511c6da
--- /dev/null
+++ b/contrib/workflows/install-dependencies.rst
@@ -0,0 +1,17 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_build-dependencies:
+
+====================
+Install Dependencies
+====================
+
+[This is the :ref:`build-dependencies` section from the devguide.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_install_dependencies_start
+ :end-before: c_install_dependencies_end
diff --git a/contrib/workflows/install-git.rst b/contrib/workflows/install-git.rst
new file mode 100644
index 000000000..e3d738b2a
--- /dev/null
+++ b/contrib/workflows/install-git.rst
@@ -0,0 +1,17 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_vcsetup:
+
+===========
+Install Git
+===========
+
+[This is the :ref:`vcsetup` section from the devguide.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_install_git_start
+ :end-before: c_install_git_end
diff --git a/contrib/workflows/regenerate.rst b/contrib/workflows/regenerate.rst
new file mode 100644
index 000000000..b5bca7dca
--- /dev/null
+++ b/contrib/workflows/regenerate.rst
@@ -0,0 +1,28 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_regenerating:
+
+===============================
+Regenerating auto-created files
+===============================
+
+.. note::
+ [These are two similar sections from the is the :ref:`setup-building` section from the devguide.]
+
+Regenerate ``configure``
+========================
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_regenerate_configure_start
+ :end-before: c_regenerate_configure_end
+
+Regenerate the ABI dump
+=======================
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_regenerate_abi_start
+ :end-before: c_regenerate_abi_end
diff --git a/contrib/workflows/troubleshooting.rst b/contrib/workflows/troubleshooting.rst
new file mode 100644
index 000000000..68aa80158
--- /dev/null
+++ b/contrib/workflows/troubleshooting.rst
@@ -0,0 +1,17 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+.. _c_build_troubleshooting:
+
+===========
+Install Git
+===========
+
+[This is the :ref:`build_troubleshooting` section from the devguide.]
+
+.. include:: ../../getting-started/setup-building.rst
+ :start-after: c_build_troubleshooting_start
+ :end-before: c_build_troubleshooting_end
diff --git a/core-developers/become-core-developer.rst b/core-developers/become-core-developer.rst
deleted file mode 100644
index 4c0251933..000000000
--- a/core-developers/become-core-developer.rst
+++ /dev/null
@@ -1,64 +0,0 @@
-.. _become-core-developer:
-.. _coredev:
-
-==============================
-How to become a core developer
-==============================
-
-What it takes
-=============
-
-When you have consistently contributed patches which meet quality standards
-without requiring extensive rewrites prior to being committed,
-you may qualify for commit privileges and become a core developer of Python.
-You must also work well with other core developers (and people in general)
-as you become an ambassador for the Python project.
-
-Typically a core developer will offer you the chance to gain commit privilege.
-The person making the offer will become your mentor and watch your commits for
-a while to make sure you understand the development process. If other core
-developers agree that you should gain commit privileges you are then extended
-an official offer. How core developers come to that agreement are outlined in
-:pep:`13`.
-
-
-Gaining commit privileges
-=========================
-
-After a candidate has demonstrated consistent contributions, commit privileges
-are granted through these steps:
-
-#. A core developer (submitter, usually the mentor) starts a poll in the
- `Committers category`_ on the `Python Discourse`_.
-
- - open for 7 days
- - results shown upon close
-
-#. If the candidate receives at least two-thirds positive votes when the poll closes
- (as per :pep:`13`), the submitter `emails the steering council
- `_ with the candidate's email address
- requesting that the council either accept or reject the proposed membership.
-
-#. Assuming the steering council does not object, a member of the council or delegate
- (approver) will email the candidate:
-
- - A request for account details as required by
- `π python/voters `_.
- - A reminder about the `Code of Conduct`_ and guidance on reporting issues
- to the PSF Conduct WG.
-
-#. Once the candidate has provided the pertinent details, the approver will:
-
- - Enable the various new privileges.
- - Remove the new committer from the triage team, if applicable.
- - Add their details to `π python/voters `_.
- - Update the devguide to publicly list their team membership
- at :ref:`developers`.
- - Post an announcement in the `Committers Discourse category
- `_. The past few announcements
- were in the form of a separate post on the already open topic with
- the poll.
-
-.. _Code of Conduct: https://www.python.org/psf/conduct/
-.. _Committers category: https://discuss.python.org/c/committers/5
-.. _Python Discourse: https://discuss.python.org
diff --git a/core-developers/index.rst b/core-developers/index.rst
deleted file mode 100644
index 2b3ac7b79..000000000
--- a/core-developers/index.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-===============
-Core developers
-===============
-
-.. toctree::
- :maxdepth: 5
-
- responsibilities
- committing
- experts
- developer-log
- motivations
- become-core-developer
diff --git a/core-developers/committing.rst b/core-team/committing.rst
similarity index 89%
rename from core-developers/committing.rst
rename to core-team/committing.rst
index 3206d991a..d83d42321 100644
--- a/core-developers/committing.rst
+++ b/core-team/committing.rst
@@ -31,11 +31,11 @@ to enter the public source tree. Ask yourself the following questions:
* **Do the checks on the pull request show that the test suite passes?**
Make sure that all of the status checks are passing.
-* **Is the patch in a good state?**
- Check :ref:`patch` and :ref:`helptriage` to review what is expected of
- a patch.
+* **Is the pull request in a good state?**
+ Check :ref:`pull-request-lifecycle` and :ref:`helptriage` to review what
+ is expected of a pull request.
-* **Does the patch break backwards-compatibility without a strong reason?**
+* **Does the change break backwards-compatibility without a strong reason?**
:ref:`Run the entire test suite ` to make sure that everything
still passes. If there is a change to the semantics, then there needs to
be a strong reason, because it will cause some peoples' code to break.
@@ -44,7 +44,7 @@ to enter the public source tree. Ask yourself the following questions:
`__.
* **Does documentation need to be updated?**
- If the pull request introduces backwards-incompatible changes (e.g.
+ If the pull request introduces backwards-incompatible changes (for example,
deprecating or removing a feature), then make sure that those changes
are reflected in the documentation before you merge the pull request.
@@ -61,14 +61,15 @@ to enter the public source tree. Ask yourself the following questions:
Make sure that the contributor has signed a `Contributor
Licensing Agreement `_
(CLA), unless their change has no possible intellectual property
- associated with it (e.g. fixing a spelling mistake in documentation).
- The `CPython CLA Bot `_
+ associated with it (for example, fixing a spelling mistake in documentation).
+ The `Python Software Foundation Contributor License Agreement Management Bot
+ `_
checks whether the author has signed the CLA, and replies in the PR
if they haven't. For further questions about the CLA
process, write to contributors@python.org.
* **Were** ``What's New in Python`` **and** ``Misc/NEWS.d/next`` **updated?**
- If the change is particularly interesting for end users (e.g. new features,
+ If the change is particularly interesting for end users (for example, new features,
significant improvements, or backwards-incompatible changes), then an
entry in the ``What's New in Python`` document (in ``Doc/whatsnew/``) should
be added as well. Changes that affect only documentation generally do not
@@ -97,7 +98,7 @@ For the last two, note the following:
#. **If a change is reverted prior to release**, then the corresponding
entry is simply removed. Otherwise, a new entry must be added noting
- that the change has been reverted (e.g. when a feature is released in
+ that the change has been reverted (for example, when a feature is released in
an alpha and then cut prior to the first beta).
#. **If a change is a fix (or other adjustment) to an earlier unreleased
@@ -107,7 +108,7 @@ For the last two, note the following:
Changes that require "What's New in Python" entries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-If a change is particularly interesting for end users (e.g. new features,
+If a change is particularly interesting for end users (for example, new features,
significant improvements, or backwards-incompatible changes), add an entry in
the "What's New in Python" document (in :cpy-file:`Doc/whatsnew/`)
in addition to the ``NEWS`` entry.
@@ -130,16 +131,16 @@ or the :pypi:`blurb` tool and its ``blurb add`` command.
If you are unable to use the tool, then you can create the ``NEWS`` entry file
manually. The ``Misc/NEWS.d`` directory contains a sub-directory named
``next``, which contains various sub-directories representing classifications
-for what was affected (e.g. ``Misc/NEWS.d/next/Library`` for changes relating
+for what was affected (for example, ``Misc/NEWS.d/next/Library`` for changes relating
to the standard library). The file name itself should be in the format
``.gh-issue-..rst``:
* ```` is today's date joined with a hyphen (``-``) to your current
- local time, in the ``YYYY-MM-DD-hh-mm-ss`` format (e.g. ``2017-05-27-16-46-23``).
-* ```` is the issue number the change is for (e.g. ``12345``
+ local time, in the ``YYYY-MM-DD-hh-mm-ss`` format (for example, ``2017-05-27-16-46-23``).
+* ```` is the issue number the change is for (for example, ``12345``
for ``gh-issue-12345``).
* ```` is a unique string to guarantee that the file name is
- unique across branches (e.g. ``Yl4gI2``). It is typically six characters
+ unique across branches (for example, ``Yl4gI2``). It is typically six characters
long, but it can be any length of letters and numbers. Its uniqueness
can be satisfied by typing random characters on your keyboard.
@@ -159,13 +160,13 @@ the reader to have read the actual diff for the change.
The contents of a ``NEWS`` file should be valid reStructuredText. An 80 character
column width should be used. There is no indentation or leading marker in the
-file (e.g. ``-``). There is also no need to start the entry with the issue
+file (for example, ``-``). There is also no need to start the entry with the issue
number since it is part of the file name. You can use
:ref:`inline markups ` too. Here is an example of a ``NEWS``
entry::
Fix warning message when :func:`os.chdir` fails inside
- :func:`test.support.temp_cwd`. Patch by Chris Jerdonek.
+ :func:`test.support.temp_cwd`. Contributed by Chris Jerdonek.
The inline Sphinx roles like ``:func:`` can be used help readers
find more information. You can build HTML and verify that the
@@ -182,7 +183,7 @@ As a core developer, you have the ability to push changes to the official
Python repositories, so you need to be careful with your workflow:
* **You should not push new branches to the main repository.** You can
- still use them in the fork that you use for the development of patches.
+ still use them in the fork that you use for your own development.
You can also push these branches to a separate public repository
for maintenance work before it is integrated into the main repository.
@@ -260,7 +261,7 @@ can apply labels to GitHub pull requests).
Reverting a merged pull request
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-To revert a merged pull request, press the ``Revert`` button at the
+To revert a merged pull request, press the :guilabel:`Revert` button at the
bottom of the pull request. That will bring up the page to create a
new pull request where the commit can be reverted. It will also create
a new branch on the main CPython repository. Delete the branch once
diff --git a/core-developers/developers.csv b/core-team/core-team.csv
similarity index 85%
rename from core-developers/developers.csv
rename to core-team/core-team.csv
index d05354b4a..79f2e86f4 100644
--- a/core-developers/developers.csv
+++ b/core-team/core-team.csv
@@ -1,3 +1,14 @@
+Tomas Roun,tomasr8,2025-06-16,,
+Peter Bierma,ZeroIntensity,2025-06-16,,
+Diego Russo,diegorusso,2025-05-13,,
+BΓ©nΓ©dikt Tran,picnixz,2025-01-10,,
+Savannah Bailey,savannahostrowski,2024-11-13,,
+Matt Page,mpage,2024-10-10,,
+Kirill Podoprigora,Eclips4,2024-09-20,,
+Ned Batchelder,nedbat,2024-07-16,,
+Tian Gao,gaogaotiantian,2024-06-06,,
+Michael Droettboom,mdboom,2024-06-06,,
+Russell Keith-Magee,freakboy3742,2024-05-30,,
Sam Gross,colesbury,2024-02-06,,
Nikita Sobolev,sobolevn,2024-02-06,,
Adam Turner,AA-Turner,2023-10-10,,
@@ -23,7 +34,7 @@ Kyle Stanley,aeros,2020-04-14,,
Donghee Na,corona10,2020-04-08,,
Karthikeyan Singaravelan,tirkarthi,2019-12-31,,
Joannah Nanjekye,nanjekyejoannah,2019-09-23,,
-Abhilash Raj,maxking,2019-08-06,,
+Abhilash Raj,maxking,2019-08-06,2022-11-30,Privileges relinquished on 2022-11-30
Paul Ganssle,pganssle,2019-06-15,,
StΓ©phane Wirtel,matrixise,2019-04-08,,
Stefan Behnel,scoder,2019-04-08,,
@@ -44,7 +55,7 @@ Xavier de Gaye,xdegaye,2016-06-03,2018-01-25,Privileges relinquished on 2018-01-
Davin Potts,applio,2016-03-06,,
Martin Panter,vadmium,2015-08-10,2020-11-26,
Paul Moore,pfmoore,2015-03-15,,
-Robert Collins,rbtcollins,2014-10-16,,To work on unittest
+Robert Collins,rbtcollins,2014-10-16,2021-11-30,To work on unittest; privileges relinquished on 2021-11-30
Berker PeksaΔ,berkerpeksag,2014-06-26,,
Steve Dower,zooba,2014-05-10,,
Kushal Das,kushaldas,2014-04-14,,
@@ -61,16 +72,16 @@ Hynek Schlawack,hynek,2012-05-14,,
Richard Oudkerk,,2012-04-29,2017-02-10,For multiprocessing module; did not make GitHub transition
Andrew Svetlov,asvetlov,2012-03-13,,At PyCon sprint
Petri Lehtinen,akheron,2011-10-22,2020-11-12,
-Meador Inge,meadori,2011-09-19,2020-11-26,
+Meador Inge,meadori,2011-09-19,,
Jeremy Kloth,jkloth,2011-09-12,,
Sandro Tosi,sandrotosi,2011-08-01,,
Alex Gaynor,alex,2011-07-18,,For PyPy compatibility (since expanded scope)
Charles-FranΓ§ois Natali,,2011-05-19,2017-02-10,Did not make GitHub transition
Nadeem Vawda,,2011-04-10,2017-02-10,Did not make GitHub transition
-Carl Friedrich Bolz-Tereick,cfbolz,2011-03-21,,for stdlib compatibility work for PyPy
+CF Bolz-Tereick,cfbolz,2011-03-21,,for stdlib compatibility work for PyPy
Jason R. Coombs,jaraco,2011-03-14,,For sprinting on distutils2
Ross Lagerwall,,2011-03-13,2017-02-10,Did not make GitHub transition
-Eli Bendersky,eliben,2011-01-11,2020-11-26,
+Eli Bendersky,eliben,2011-01-11,2020-11-26,Relinquished privileges on 2020-11-26
Ned Deily,ned-deily,2011-01-09,,
David Malcolm,davidmalcolm,2010-10-27,2020-11-12,relinquished privileges on 2020-11-12
Tal Einat,taleinat,2010-10-04,,Initially for IDLE
@@ -92,12 +103,12 @@ Doug Hellmann,dhellmann,2009-09-20,2020-11-11,For documentation; relinquished pr
Frank Wierzbicki,,2009-08-02,2017-02-10,For Jython compatibility; did not make GitHub transition
Ezio Melotti,ezio-melotti,2009-06-07,,For documentation
Philip Jenvey,pjenvey,2009-05-07,2020-11-26,For Jython compatibility
-Michael Foord,voidspace,2009-04-01,,For IronPython compatibility
+Michael Foord,voidspace,2009-04-01,2025-01-24,For IronPython compatibility; deceased
R\. David Murray,bitdancer,2009-03-30,,
Chris Withers,cjw296,2009-03-08,,
Tarek ZiadΓ©,tarekziade,2008-12-21,2017-02-10,For distutils module
Hirokazu Yamamoto,,2008-08-12,2017-02-10,For Windows build; did not make GitHub transition
-Armin Ronacher,mitsuhiko,2008-07-23,2020-11-26,For documentation toolset and ast module
+Armin Ronacher,mitsuhiko,2008-07-23,,For documentation toolset and ast module
Antoine Pitrou,pitrou,2008-07-16,,
Senthil Kumaran,orsenthil,2008-06-16,,
Jesse Noller,,2008-06-16,2017-02-10,For multiprocessing module; did not make GitHub transition
@@ -106,9 +117,9 @@ Guilherme Polo,,2008-04-24,2017-02-10,Did not make GitHub transition
Jeroen Ruigrok van der Werven,,2008-04-12,2017-02-10,For documentation; did not make GitHub transition
Benjamin Peterson,benjaminp,2008-03-25,,For bug triage
David Wolever,wolever,2008-03-17,2020-11-21,For 2to3 module
-Trent Nelson,tpn,2008-03-17,2020-11-26,
-Mark Dickinson,mdickinson,2008-01-06,,For maths-related work
-Amaury Forgeot d'Arc,amauryfa,2007-11-09,2020-11-26,
+Trent Nelson,tpn,2008-03-17,,
+Mark Dickinson,mdickinson,2008-01-06,2024-08-13,For maths-related work
+Amaury Forgeot d'Arc,amauryfa,2007-11-09,2020-11-26,Relinquished privileges on 2020-11-26
Christian Heimes,tiran,2007-10-31,,
Bill Janssen,,2007-08-28,2017-02-10,For ssl module; did not make GitHub transition
Jeffrey Yasskin,,2007-08-09,2017-02-10,Did not make GitHub transition
@@ -134,9 +145,9 @@ Facundo Batista,facundobatista,2004-10-16,,
Sean Reifschneider,,2004-09-17,2017-02-10,Did not make GitHub transition
Johannes Gijsbers,,2004-08-14,2005-07-27,Privileges relinquished on 2005-07-27
Matthias Klose,doko42,2004-08-04,,
-PJ Eby,pjeby,2004-03-24,2020-11-26,
+PJ Eby,pjeby,2004-03-24,2020-11-26,Relinquished privileges on 2020-11-26
Vinay Sajip,vsajip,2004-02-20,,
-Hye-Shik Chang,hyeshik,2003-12-10,,
+Hye-Shik Chang,hyeshik,2003-12-10,2025-02-28,Privileges relinquished on 2025-02-28
Armin Rigo,,2003-10-24,2012-06-01,Privileges relinquished in 2012
Andrew McNamara,,2003-06-09,2017-02-10,Did not make GitHub transition
Samuele Pedroni,,2003-05-16,2017-02-10,Did not make GitHub transition
@@ -149,7 +160,7 @@ Steve Holden,holdenweb,2002-06-14,2017-02-10,"Relinquished privileges on 2005-04
but granted again for Need for Speed sprint; did not make GitHub transition"
Christian Tismer,ctismer,2002-05-17,,For Need for Speed sprint
Jason Tishler,,2002-05-15,2017-02-10,Did not make GitHub transition
-Walter DΓΆrwald,doerwalter,2002-03-21,,
+Walter DΓΆrwald,doerwalter,2002-03-21,2021-11-16,Relinquished privileges on 2021-11-16
Andrew MacIntyre,,2002-02-17,2016-01-02,Privileges relinquished 2016-01-02
Gregory P. Smith,gpshead,2002-01-08,,
Anthony Baxter,,2001-12-21,2017-02-10,Did not make GitHub transition
@@ -182,9 +193,9 @@ Eric S. Raymond,,2000-06-02,2017-02-10,Did not make GitHub transition
Greg Stein,,1999-11-07,2017-02-10,Did not make GitHub transition
Just van Rossum,,1999-01-22,2017-02-10,Did not make GitHub transition
Greg Ward,,1998-12-18,2017-02-10,Did not make GitHub transition
-Andrew Kuchling,akuchling,1998-04-09,,
+Andrew Kuchling,akuchling,1998-04-09,2022-11-09,Privileges relinquished 2022-11-09
Ken Manheimer,,1998-03-03,2005-04-08,Privileges relinquished on 2005-04-08
-Jeremy Hylton,jeremyhylton,1997-08-13,2020-11-26,
+Jeremy Hylton,jeremyhylton,1997-08-13,,
Roger E. Masse,,1996-12-09,2017-02-10,Did not make GitHub transition
Fred Drake,freddrake,1996-07-23,,
Barry Warsaw,warsaw,1994-07-25,,
diff --git a/core-developers/experts.rst b/core-team/experts.rst
similarity index 72%
rename from core-developers/experts.rst
rename to core-team/experts.rst
index d79d5cf8d..5791ff408 100644
--- a/core-developers/experts.rst
+++ b/core-team/experts.rst
@@ -55,26 +55,20 @@ Module Maintainers
__future__
__main__ gvanrossum, ncoghlan
_thread
-_testbuffer
abc
-aifc bitdancer
-argparse
+annotationlib JelleZijlstra*
+argparse savannahostrowski*, serhiy-storchaka*
array
-ast benjaminp, pablogsal, isidentical
+ast benjaminp, pablogsal, isidentical, JelleZijlstra, eclips4
asyncio 1st1, asvetlov, gvanrossum, graingert, kumaraditya303, willingc
atexit
-audioop serhiy-storchaka
base64
bdb
binascii
bisect rhettinger*
builtins
-bz2
calendar
-cgi ethanfurman*
-cgitb ethanfurman*
-chunk
-cmath mdickinson
+cmath
cmd
code
codecs malemburg, doerwalter
@@ -83,21 +77,25 @@ collections rhettinger*
collections.abc rhettinger*, stutzbach^
colorsys
compileall carljm
+compression.bz2
+compression.gzip
+compression.lzma
+compression.zlib Yhg1s, gpshead*
+compression.zstd
concurrent.futures pitrou, brianquinlan, gpshead*
configparser ambv*
contextlib ncoghlan, 1st1
contextvars
-copy avassalotti
-copyreg avassalotti
+copy avassalotti, serhiy-storchaka*
+copyreg avassalotti, serhiy-storchaka*
cProfile
-crypt jafo^*
-csv smontanaro (inactive)
+csv smontanaro (inactive), serhiy-storchaka*
ctypes theller (inactive), abalkin, amauryfa, meadori
curses Yhg1s
dataclasses ericvsmith*, carljm
datetime abalkin, pganssle
dbm
-decimal facundobatista, rhettinger, mdickinson
+decimal facundobatista, rhettinger
difflib tim-one (inactive)
dis 1st1
doctest tim-one (inactive)
@@ -106,68 +104,60 @@ encodings malemburg
ensurepip ncoghlan, dstufft, pradyunsg, pfmoore
enum eliben*, warsaw, ethanfurman*
errno Yhg1s
-faulthandler vstinner, gpshead
+faulthandler vstinner, gpshead, ZeroIntensity*
fcntl Yhg1s
filecmp
fileinput
-fnmatch
-fractions mdickinson
+fnmatch serhiy-storchaka*
+fractions
ftplib giampaolo*
functools rhettinger*
-gc pitrou, pablogsal
-getopt
+gc pitrou, pablogsal, nascheme
+getopt serhiy-storchaka*
+getpath FFY00
getpass
-gettext
-glob
+gettext tomasr8
+glob serhiy-storchaka*
grp
-gzip
-hashlib tiran, gpshead*
+hashlib tiran, gpshead*, picnixz
heapq rhettinger*, stutzbach^
-hmac tiran, gpshead*
+hmac tiran, gpshead*, picnixz
html ezio-melotti*
http
idlelib kbkaiser (inactive), terryjreedy*, serwy (inactive),
taleinat
imaplib
-imghdr
importlib brettcannon
inspect 1st1
io benjaminp, stutzbach^
ipaddress pmoody^
itertools rhettinger*
-json etrepum (inactive), ezio-melotti, rhettinger
+json etrepum (inactive), ezio-melotti, rhettinger,
+ serhiy-storchaka*
keyword
-lib2to3 benjaminp
libmpdec
linecache
locale malemburg
logging vsajip
-lzma
mailbox
-mailcap
marshal
-math mdickinson, rhettinger, stutzbach^
+math rhettinger, stutzbach^
mimetypes
mmap Yhg1s
modulefinder theller (inactive), jvr^
-msilib
msvcrt
multiprocessing applio*, pitrou, jnoller^ (inactive), sbt^ (inactive), gpshead*
netrc
-nis
-nntplib
numbers
operator
-optparse mitsuhiko
+optparse mitsuhiko, serhiy-storchaka*
os
-os.path serhiy-storchaka
-ossaudiodev
+os.path serhiy-storchaka*
parser pablogsal
pathlib barneygale*
-pdb
-pickle avassalotti
-pickletools avassalotti
-pipes
+pdb gaogaotiantian
+pickle avassalotti, serhiy-storchaka*
+pickletools avassalotti, serhiy-storchaka*
pkgutil
platform malemburg
plistlib
@@ -180,11 +170,11 @@ pty Yhg1s*
pwd
py_compile carljm
pyclbr isidentical
-pydoc AA-Turner
+pydoc AA-Turner, serhiy-storchaka*
queue rhettinger*
quopri
-random rhettinger, mdickinson
-re ezio-melotti, serhiy-storchaka
+random rhettinger
+re ezio-melotti, serhiy-storchaka*
readline Yhg1s
reprlib
resource Yhg1s
@@ -200,34 +190,30 @@ shutil tarekziade, giampaolo
signal gpshead
site
smtplib
-sndhdr
socket gpshead
socketserver
-spwd
sqlite3 ghaering^, erlend-aasland*
ssl jackjansen, tiran, dstufft, alex
stat tiran
statistics stevendaprano, rhettinger
string
stringprep
-struct mdickinson, meadori
+struct meadori
subprocess astrand^ (inactive), giampaolo, gpshead*
-sunau
symtable benjaminp
sys
sysconfig FFY00
syslog jafo^*
tabnanny tim-one (inactive)
tarfile gustaebel
-telnetlib
-tempfile
+tempfile serhiy-storchaka*
termios Yhg1s
-test ezio-melotti
+test ezio-melotti, serhiy-storchaka*
textwrap
threading pitrou, gpshead
time abalkin, pganssle
timeit
-tkinter gpolo^, serhiy-storchaka
+tkinter gpolo^, serhiy-storchaka*
token
tokenize meadori
tomllib hauntsaninja*
@@ -236,23 +222,22 @@ traceback iritkatriel
tracemalloc vstinner
tty Yhg1s*
turtle gregorlingl^, willingc
+turtledemo terryjreedy*
types 1st1
typing gvanrossum, JelleZijlstra*, AlexWaygood*, carljm, sobolevn*
unicodedata malemburg, ezio-melotti
-unittest voidspace*, ezio-melotti, rbtcollins, gpshead
-unittest.mock voidspace*
+unittest ezio-melotti, rbtcollins, gpshead, serhiy-storchaka*
+unittest.mock
urllib orsenthil
-uu
uuid
-venv vsajip
+venv vsajip, FFY00
warnings
wave
-weakref freddrake
+weakref freddrake, nascheme
webbrowser
winreg stutzbach^
winsound
wsgiref pjenvey
-xdrlib
xml.dom
xml.dom.minidom
xml.dom.pulldom
@@ -266,7 +251,6 @@ xmlrpc
zipapp pfmoore
zipfile alanmcintyre^, serhiy-storchaka, Yhg1s, gpshead
zipimport Yhg1s*
-zlib Yhg1s, gpshead*
==================== =============================================
@@ -276,7 +260,8 @@ Tools
================== ===========
Tool Maintainers
================== ===========
-Argument Clinic larryhastings, AlexWaygood*, erlend-aasland
+Argument Clinic larryhastings, AlexWaygood*, erlend-aasland,
+ serhiy-storchaka*
Deepfreeze gvanrossum, kumaraditya303
PEG Generator gvanrossum, pablogsal, lysnikolaou
================== ===========
@@ -296,18 +281,20 @@ for βtheirβ platform as a third-party project.
=================== ===========
Platform Maintainers
=================== ===========
-AIX David.Edelsohn^
+AIX edelsohn, ayappanec
+Android mhsmith
Cygwin jlt63^, stutzbach^
Emscripten hoodmane, pmp-p, rdb, rth, ryanking13
FreeBSD
HP-UX
+iOS freakboy3742, ned-deily
+JVM/Java frank.wierzbicki^
Linux
-macOS ronaldoussoren, ned-deily
+macOS ronaldoussoren, ned-deily, freakboy3742
NetBSD1
OS2/EMX aimacintyre^
-Solaris/OpenIndiana jcea
-Windows tjguk, zware, zooba, pfmoore
-JVM/Java frank.wierzbicki^
+Solaris/OpenIndiana jcea, kulikjak
+Windows tjguk, zooba, pfmoore
=================== ===========
@@ -317,19 +304,18 @@ Miscellaneous
================== ==========================================================
Interest Area Maintainers
================== ==========================================================
-algorithms rhettinger*
-argument clinic larryhastings, AlexWaygood*, erlend-aasland
-ast/compiler benjaminp, 1st1, pablogsal, markshannon, isidentical, brandtbucher, carljm, iritkatriel
+algorithms rhettinger*, serhiy-storchaka
+argument clinic larryhastings, AlexWaygood*, erlend-aasland,
+ serhiy-storchaka*
+AST/compiler benjaminp, 1st1, pablogsal, markshannon, isidentical, brandtbucher, carljm, iritkatriel
autoconf/makefiles Yhg1s*
-bsd
issue tracker ezio-melotti
buildbots zware, pablogsal
bytecode benjaminp, 1st1, markshannon, brandtbucher, carljm, iritkatriel
context managers ncoghlan
core workflow Mariatta, ezio-melotti, hugovk, AA-Turner
-coverity scan tiran, Yhg1s
-cryptography gpshead, dstufft
-data formats mdickinson
+cryptography gpshead, dstufft, picnixz
+data formats
database malemburg
devguide merwok, ezio-melotti, willingc, Mariatta, hugovk,
AA-Turner
@@ -341,34 +327,35 @@ filesystem giampaolo
frozen modules ericsnowcurrently, gvanrossum, kumaraditya303
f-strings ericvsmith*
GUI
-i18n malemburg, merwok
-import machinery brettcannon, ncoghlan, ericsnowcurrently
+i18n malemburg, merwok, tomasr8
+import machinery brettcannon, ncoghlan, ericsnowcurrently, FFY00
+initialization FFY00
io benjaminp, stutzbach^, gpshead
-JIT brandtbucher*
+JIT brandtbucher*, savannahostrowski*
locale malemburg
-mathematics mdickinson, malemburg, stutzbach^, rhettinger
-memory management tim-one, malemburg, Yhg1s
+mathematics malemburg, stutzbach^, rhettinger, serhiy-storchaka
+memory management tim-one, malemburg, Yhg1s, nascheme
memoryview
networking giampaolo, gpshead
object model benjaminp, Yhg1s
packaging tarekziade, malemburg, alexis^, merwok, dstufft, pfmoore
pattern matching brandtbucher*
-peg parser gvanrossum, pablogsal, lysnikolaou
-performance vstinner, serhiy-storchaka, 1st1, rhettinger, markshannon, brandtbucher, carljm, Fidget-Spinner,
- AlexWaygood*
+PEG parser gvanrossum, pablogsal, lysnikolaou
+performance vstinner, serhiy-storchaka*, 1st1, rhettinger, markshannon,
+ brandtbucher, carljm, Fidget-Spinner, AlexWaygood*, nascheme
pip ncoghlan, dstufft, pfmoore, Marcus.Smith^, pradyunsg
-py3 transition benjaminp
release management tarekziade, malemburg, benjaminp, warsaw,
gvanrossum, anthonybaxter^, merwok, ned-deily,
- birkenfeld, JulienPalard
-runtime lifecycle ericsnowcurrently, kumaraditya303, zooba
+ birkenfeld, JulienPalard, hugovk
+runtime lifecycle ericsnowcurrently, kumaraditya303, zooba, ZeroIntensity, nascheme
str.format ericvsmith*
-subinterpreters ericsnowcurrently, kumaraditya303
-testing voidspace, ezio-melotti
+subinterpreters ericsnowcurrently, kumaraditya303, ZeroIntensity*
+symbol table JelleZijlstra, carljm
+testing ezio-melotti
test coverage
threads gpshead
time and dates malemburg, abalkin, pganssle
-unicode malemburg, ezio-melotti, benjaminp
+Unicode malemburg, ezio-melotti, benjaminp
version control merwok, ezio-melotti
================== ==========================================================
@@ -376,4 +363,7 @@ version control merwok, ezio-melotti
Documentation translations
==========================
-For a list of translators, see :ref:`this table about translations `.
+Translations are within the charter of
+`Editorial Board `_.
+For a list of translations and their coordinators, see
+:ref:`this table of translations `.
diff --git a/core-team/index.rst b/core-team/index.rst
new file mode 100644
index 000000000..f8dafe05e
--- /dev/null
+++ b/core-team/index.rst
@@ -0,0 +1,17 @@
+.. _core-dev:
+.. _core-team:
+
+=========
+Core team
+=========
+
+.. toctree::
+ :maxdepth: 5
+
+ responsibilities
+ committing
+ experts
+ team-log
+ motivations
+ join-team
+ memorialization
diff --git a/core-team/join-team.rst b/core-team/join-team.rst
new file mode 100644
index 000000000..5735f72a1
--- /dev/null
+++ b/core-team/join-team.rst
@@ -0,0 +1,114 @@
+.. _become-core-developer:
+.. _coredev:
+.. _join-core-team:
+
+=========================
+How to join the core team
+=========================
+
+What it takes
+=============
+
+When you have consistently made contributions which meet quality standards
+without requiring extensive rewrites prior to being committed,
+you may qualify for commit privileges and become a core developer of Python.
+You must also work well with other core developers (and people in general)
+as you become an ambassador for the Python project.
+
+Typically a core developer will offer you the chance to gain commit privilege.
+The person making the offer will become your mentor and watch your commits for
+a while to make sure you understand the development process. If other core
+developers agree that you should gain commit privileges you are then extended
+an official offer. How core developers come to that agreement are outlined in
+:pep:`13`.
+
+
+Gaining commit privileges
+=========================
+
+After a candidate has demonstrated consistent contributions, commit privileges
+are granted through these steps:
+
+#. A core developer (submitter, usually the mentor) starts a poll
+ (see the :ref:`template ` below) in
+ the `Committers category`_ on the `Python Discourse`_.
+
+ - open for 7 days
+ - results shown only upon closing
+
+#. If the candidate receives at least two-thirds positive votes when the poll closes
+ (as per :pep:`13`), the submitter `emails the steering council
+ `_ with the candidate's email address
+ requesting that the council either accept or reject the proposed membership. Technically, the
+ council may only `veto a positive vote `_.
+
+#. Assuming the steering council does not veto the positive vote, a member of the council or its
+ delegate (approver, usually in practice a :ref:`Developer-in-Residence `) will
+ email the candidate:
+
+ - A request for account details as required by
+ `π python/voters `_.
+ - A reminder about the `Code of Conduct`_ and guidance on reporting issues
+ to the PSF Conduct WG.
+
+#. Once the candidate has provided the pertinent details, the approver will:
+
+ - Enable the various new privileges.
+ - Remove the new committer from the triage team, if applicable.
+ - Add their details to `π python/voters `_.
+ - Update the devguide to publicly list their team membership
+ at :ref:`developers`.
+ - Post an announcement in the `Committers Discourse category
+ `_. The past few announcements
+ were in the form of a separate post on the already open topic with
+ the poll.
+
+Getting a python.org email address
+----------------------------------
+
+Members of the core team can get an email address on the python.org domain.
+For more details refer to the `python.org email policy
+ `_.
+
+
+Poll template
+=============
+
+.. _coredev-template:
+
+While Discourse uses Markdown for formatting, the poll functionality is
+custom and somewhat resembles BBcode. There's a creator for polls in the
+UI (click the cog icon in the edit box toolbar and choose "Build Poll").
+Here's what it outputs, you can copy and paste it for your poll:
+
+.. code-block:: bbcode
+
+ [poll type=regular results=on_close public=false chartType=bar groups=committers close=2024-07-15T21:15:00.000Z]
+ * Promote Basil Fawlty
+ * Do not promote
+ [/poll]
+
+The important options in the poll builder set to get this result:
+ - Show who voted: **disabled** (``public=false``)
+ - Limit voting to these groups: **committers** (``groups=committers``)
+ - Automatically close poll: **in 7 days** (``close=...``)
+ - Show results: **When poll is closed** (``results=on_close``)
+
+.. raw:: html
+
+
+
+.. _Code of Conduct: https://policies.python.org/python.org/code-of-conduct/
+.. _Committers category: https://discuss.python.org/c/committers/5
+.. _Python Discourse: https://discuss.python.org
diff --git a/core-team/memorialization.rst b/core-team/memorialization.rst
new file mode 100644
index 000000000..2bcf24ae1
--- /dev/null
+++ b/core-team/memorialization.rst
@@ -0,0 +1,158 @@
+.. _memorialize-core-developer:
+
+===============
+Memorialization
+===============
+
+Rationale
+=========
+
+When a core developer passes away, memorializing accounts helps create
+a space for remembering the contributor and protects against attempted
+logins and fraudulent activity.
+
+The process
+===========
+
+The memorialization process is performed by a member of the PSF staff
+with administrative access to current and historical systems where
+core developers have access.
+
+After the status of the core developer in question is confirmed,
+access to the systems listed below is revoked and some changes are
+made to how the user displays to others.
+
+To respect the choices that someone made while alive, we aim to preserve
+content of their accounts without changes after they've passed away.
+To support the bereaved, in some instances, we may remove or change
+certain content when the legacy contact or family members request it.
+
+GitHub
+------
+
+* The user is removed from the `python/ `_
+ organization on GitHub;
+* The user is removed from the `psf/ `_
+ organization on GitHub;
+* The user is removed from the `pypa/ `_
+ organization on GitHub.
+
+The PSF staff does not follow up with GitHub with regards to GitHub account
+cancellation as this action is reserved for next-of-kin or designated by
+the deceased GitHub user to act as an account successor.
+
+The general policy regarding deceased users on GitHub is described on their
+`Deceased User Policy `_
+page.
+
+Repositories in the organization
+--------------------------------
+
+* The user's GitHub handle is removed from ``/.github/CODEOWNERS``.
+ To see all that need action, perform
+ `this query `_.
+* The user is marked as deceased in the private
+ `voters/python-core.toml `_
+ file with the ``left=`` field set to the day of passing, if known.
+
+discuss.python.org
+------------------
+
+* The user's "custom status" is set to π ``in memoriam``;
+* The user's "about me" is amended with ``$firstname passed away on $date. [In memoriam.]($in_memoriam_post_url)``;
+* In the user's security "recently used devices" the staff member
+ chooses "Log out all";
+* In the user's permissions the staff member chooses "Deactivate account";
+* The user's trust level is reset to ``1: basic user`` (trust level 0
+ doesn't allow links in "About Me");
+* The user's "associated accounts" (like GitHub) that provide an
+ alternative login method, are all disconnected;
+* The user's API keys are revoked;
+* The user's admin or moderator right is revoked;
+* The user's primary email address is reset to
+ ``USERNAME@in-memoriam.invalid`` and secondary email addresses are
+ removed (this step requires the administrator to contact Discourse.org
+ staff via ``team@discourse.org``).
+
+The "in memoriam" Discourse topic mentioned above is best created by
+a community member close to the deceased.
+
+The general best practice for deceased community members on
+Discourse-powered forums is described on their
+`Best practices for deceased community members `_
+page.
+
+python.org email account
+------------------------
+
+The PSF staff member emails ``postmaster@python.org`` to ask the email
+administrator to:
+
+* remove SMTP access from ``USERNAME@python.org``;
+* reset the password to POP3/IMAP for ``USERNAME@python.org``;
+* disable email forwarding, if set up, for ``USERNAME@python.org`` and
+ leave a record permanently as "in memoriam" to avoid future account
+ name reuse;
+* remove this email from all mailing lists under ``@python.org``;
+* remove any known alternate emails for the same user from all mailing
+ lists under ``@python.org``.
+
+In case the email shutdown causes issues for the estate executors, the
+PSF will reasonably try to help if contacted directly.
+
+python.org admin
+----------------
+
+* The user's account (``/admin/users/user``) is deactivated (NOT deleted)
+ and their staff and superuser status is unchecked;
+* The user's password is reset to a long random string;
+* The user's primary email address is set to
+ ``USERNAME@in-memoriam.invalid`` and set as unverified;
+* The user's secondary email addresses are deleted;
+* The user's API keys (both on the account and ``tastypie``) are deleted;
+* The user's "I would like to be a PSF Voting Member" field is cleared.
+
+devguide.python.org
+-------------------
+
+* The user is marked as deceased in `core-team.csv `_;
+* The user is removed from the `experts index `_.
+
+bugs.python.org
+---------------
+
+While the issue tracker was migrated to GitHub, the Roundup instance
+is still up for historical purposes.
+
+* the PSF staff member logs into ``bugs.nyc1.psf.io``;
+* the PSF staff member runs ``roundup-admin`` to set the user's email
+ address to ``USERNAME@in-memoriam.invalid``;
+* the user's alternate emails are removed;
+* the user's password is reset to a long random string;
+* the PSF staff member removes any active login sessions from Postgres.
+
+Other PSF-related infrastructure
+--------------------------------
+
+* The PSF staff member notifies administrators of the Python Core Devs
+ Discord server to remove the user from the server. The PSF staff
+ does not follow up with Discord with regards to Discord account
+ cancellation. The general policy regarding deceased users on Discord
+ is available on their `Deceased or Incapacitated Users `_
+ page.
+
+* The user is removed from Salt configuration for the PSF infrastructure
+ in `/pillar/base/users `_
+ that allows SSH access to PSF-controlled servers.
+
+* The user might have ran a buildbot worker. The PSF staff member will
+ look for that in the
+ `buildmaster-config `_
+ repository.
+
+PyPI
+----
+
+* The PSF staff member notifies PyPI admins by emailing them at
+ ``admin@pypi.org`` to mark the user as inactive, remove their email
+ addresses, prohibit their password resets, and revoke all API keys.
diff --git a/core-developers/motivations.rst b/core-team/motivations.rst
similarity index 90%
rename from core-developers/motivations.rst
rename to core-team/motivations.rst
index c32304962..b19c3062b 100644
--- a/core-developers/motivations.rst
+++ b/core-team/motivations.rst
@@ -80,7 +80,7 @@ participating in the CPython core development process:
country of residence.
Include a "Crowdfunding" bullet point with a link if you'd like to highlight
- crowdfunding services (e.g. Patreon) that folks can use to support your core
+ crowdfunding services (for example, Patreon) that folks can use to support your core
development work.
Include additional bullet points (without links) for any other affiliations
@@ -106,9 +106,11 @@ participating in the CPython core development process:
* Personal site: `Curious Efficiency `_
* `Extended bio `__
* Python Software Foundation (Fellow, Packaging Working Group)
+ * Element Labs/LM Studio (Python deployment engineer)
Alyssa began using Python as a testing and prototyping language while working
- for Boeing Defence Australia, and continues to use it for that purpose today.
+ for Boeing Defence Australia. She now primarily uses it as the lead project
+ maintainer for the open source ``venvstacks`` Python deployment utility.
As a core developer, she is primarily interested in helping to ensure Python's
continued suitability for educational, testing and data analysis use cases,
@@ -116,7 +118,7 @@ participating in the CPython core development process:
applications and test harnesses from open source components.
Note: prior to August 2023, Alyssa used her birth name (Nick Coghlan). Some records
- (e.g. mailing list archives, version control history) will still reference that name.
+ (for example, mailing list archives, version control history) will still reference that name.
.. topic:: Steve Dower (United States/Australia)
@@ -186,7 +188,7 @@ participating in the CPython core development process:
.. topic:: Antoine Pitrou (France)
* LinkedIn: ` `_ (Senior Software Engineer)
- * Voltron Data
+ * QuantStack
* Python Software Foundation (Fellow)
* Email address: antoine@python.org
@@ -197,12 +199,12 @@ participating in the CPython core development process:
world, and by the concrete roadblocks he was hitting in professional
settings. Topics of choice have included interpreter optimizations,
garbage collection, network programming, system programming and
- concurrent programming (such as maintaining ``multiprocessing``).
+ concurrent programming.
As a professional, Antoine has been first specializing in network
programming, and more lately in open source data science infrastructure.
- He is currently working full time on Apache Arrow as a technical leader
- for Voltron Data.
+ He has made numerous contributions to Numba, Dask and is currently working
+ full time on Apache Arrow as a technical leader at QuantStack.
.. topic:: Victor Stinner (France)
@@ -221,25 +223,23 @@ participating in the CPython core development process:
.. topic:: Barry Warsaw (United States)
- * `LinkedIn: `_ (Senior Staff
- Software Engineer - Python Foundation team)
+ * NVIDIA, Principal System Software Engineer, Open Source Python Ecosystem
* Personal site: `barry.warsaw.us `_
* Blog: `We Fear Change `_
+ * `LinkedIn `_
+ * `Bluesky `_
* Email address: barry@python.org
* Python Software Foundation (Fellow)
Barry has been working in, with, and on Python since 1994. He attended the
- first Python workshop at NBS (now `NIST `_) in
- Gaithersburg, MD in 1994, where he met Guido and several other early Python
- adopters. Barry subsequently worked with Guido for 8 years while at `CNRI
- `_. From 2007 until 2017, Barry worked for
- `Canonical `_, corporate sponsor of `Ubuntu
- `_ Linux, primarily on the Python ecosystem, and
- is both an Ubuntu and a `Debian `_ uploading
- developer. Barry has served as Python's postmaster, webmaster, release
- manager, Language Summit co-chair, `Jython `_
- project leader, `GNU Mailman `_ project leader, and
- probably lots of other things he shouldn't admit to.
+ first Python workshop at `NIST `_ in Gaithersburg,
+ MD in 1994, where he met Guido and several other early Python adopters.
+ Barry subsequently worked with Guido for 8 years while at `CNRI
+ `_. Barry has served as Python's postmaster,
+ webmaster, release manager, Language Summit co-chair, `Jython
+ `_ project leader, `GNU Mailman
+ `_ project leader, and Python Steering Council
+ member in 2019, 2020, 2021, 2024, and 2025.
.. topic:: Eric Snow (United States)
@@ -261,7 +261,7 @@ participating in the CPython core development process:
.. topic:: Carol Willing (United States)
- * Noteable: ` `__ (VP Engineering)
+ * Noteable (VP Engineering)
* Personal site: `Willing Consulting `_
* `Extended bio `__
* Project Jupyter (Software Council, Core Team for JupyterHub/Binder)
@@ -279,11 +279,11 @@ Goals of this page
The `issue metrics`_ automatically collected by the CPython issue tracker
strongly suggest that the current core development process is bottlenecked on
-core developer time - this is most clearly indicated in the first metrics graph,
-which shows both the number of open issues and the number of patches awaiting
+core developer time. This is most clearly indicated in the first metrics graph,
+which shows both the number of open issues and the number of pull requests awaiting
review growing steadily over time, despite CPython being one of the most
active open source projects in the world. This bottleneck then impacts not only
-resolving open issues and applying submitted patches, but also the process of
+resolving open issues and accepting submitted pull requests, but also the process of
identifying, nominating and mentoring new core developers.
The core commit statistics monitored by sites like `OpenHub`_ provide a good
diff --git a/core-developers/responsibilities.rst b/core-team/responsibilities.rst
similarity index 94%
rename from core-developers/responsibilities.rst
rename to core-team/responsibilities.rst
index 0638a967e..5cd5ed7bd 100644
--- a/core-developers/responsibilities.rst
+++ b/core-team/responsibilities.rst
@@ -7,8 +7,8 @@ Responsibilities
As contributors to the CPython project, our shared responsibility is to
collaborate constructively with other contributors, including core developers.
This responsibility covers all forms of contribution, whether that's submitting
-patches to the implementation or documentation, reviewing other peoples'
-patches, triaging issues on the issue tracker, or discussing design and
+pull requests to the implementation or documentation, reviewing other peoples'
+pull requests, triaging issues on the issue tracker, or discussing design and
development ideas on the core
:ref:`communication channels `.
@@ -68,7 +68,7 @@ the ability to license your code means it can be put under the PSF license so
it can be legally distributed with Python.
This is a very important step! Hopefully you have already submitted a
-contributor agreement if you have been submitting patches. But if you have not
+contributor agreement if you have been submitting pull requests. But if you have not
done this yet, it is best to do this ASAP, probably before you even do your
first commit so as to not forget. Also do not forget to enter your GitHub
username into your details on the issue tracker.
@@ -127,4 +127,4 @@ And finally, enjoy yourself! Contributing to open source software should be fun
(overall). If you find yourself no longer enjoying the work then either take a
break or figure out what you need to do to make it enjoyable again.
-.. _PSF Code of Conduct: https://www.python.org/psf/conduct/
+.. _PSF Code of Conduct: https://policies.python.org/python.org/code-of-conduct/
diff --git a/core-developers/developer-log.rst b/core-team/team-log.rst
similarity index 85%
rename from core-developers/developer-log.rst
rename to core-team/team-log.rst
index 665ef0700..77639ebf1 100644
--- a/core-developers/developer-log.rst
+++ b/core-team/team-log.rst
@@ -1,16 +1,17 @@
.. _developer-log:
.. _developers:
+.. _team-log:
-Developer log
-=============
+Team log
+========
-This page lists the historical members of the Python development team. (The
+This page lists the historical members of the Python core team. (The
master list is kept in a private repository due to containing sensitive contact
information.)
.. csv-table::
:header: "Name", "GitHub username", "Joined", "Left", "Notes"
- :file: developers.csv
+ :file: core-team.csv
:encoding: "utf-8"
Procedure for granting or dropping access
diff --git a/developer-workflow/c-api.rst b/developer-workflow/c-api.rst
index 8097354c3..90c1d12e4 100644
--- a/developer-workflow/c-api.rst
+++ b/developer-workflow/c-api.rst
@@ -19,8 +19,13 @@ The C API is divided into these tiers:
Each tier has different stability and maintenance requirements to consider
when you add or change definitions in it.
-The compatibility guarantees for public C API are explained in the
-user documentation, ``Doc/c-api/stable.rst`` (:ref:`python:stable`).
+The public backwards compatibility guarantees for public C API are explained
+in the user documentation, ``Doc/c-api/stable.rst`` (:ref:`python:stable`).
+C language compatibility guarantees are in ``Doc/c-api/intro.rst``
+(:ref:`python:api-intro`).
+
+As core developers, we need to be more careful about compatibility than what
+we promise publicly. See :ref:`public-capi` for details.
The internal API
@@ -93,6 +98,17 @@ CPython's public C API is available when ``Python.h`` is included normally
It should be defined in ``Include/cpython/`` (unless part of the Limited API,
see below).
+Before adding new public API, please ask in the `decisions repo`_ of
+the :pep:`C API workgroup <731>`.
+This helps us ensure *newly added* API is consistent and maintainable.
+
+Also check with the C API WG before requiring a C feature not present in C99.
+While the *public* docs only promise compatibility with C11, in practice
+we only intruduce C11 features individually as needed.
+
+.. _decisions repo: https://github.com/capi-workgroup/decisions/issues
+
+
.. _public-api-guidelines:
Guidelines for expanding/changing the public API
@@ -174,7 +190,7 @@ Unstable C API
The unstable C API tier is meant for extensions that need tight integration
with the interpreter, like debuggers and JIT compilers.
-Users of this tier may need to change their code with every minor release.
+Users of this tier may need to change their code with every feature release.
In many ways, this tier is like the general C API:
@@ -189,7 +205,7 @@ The differences are:
- Names of functions structs, macros, etc. start with the ``PyUnstable_``
prefix. This defines what's in the unstable tier.
-- The unstable API can change in minor versions, without any deprecation
+- The unstable API can change in feature releases, without any deprecation
period.
- A stability note appears in the docs.
This happens automatically, based on the name
@@ -198,7 +214,7 @@ The differences are:
Despite being βunstableβ, there are rules to make sure third-party code can
use this API reliably:
-* Changes and removals can be done in minor releases
+* Changes and removals can be done in feature releases
(:samp:`3.{x}.0`, including Alphas and Betas for :samp:`3.{x}.0`).
* Adding a new unstable API *for an existing feature* is allowed even after
Beta feature freeze, up until the first Release Candidate.
@@ -219,7 +235,7 @@ Moving an API from the public tier to Unstable
* Expose the API under its new name, with the ``PyUnstable_`` prefix.
The ``PyUnstable_`` prefix must be used for all symbols (functions, macros,
variables, etc.).
-* Make the old name an alias (e.g. a ``static inline`` function calling the
+* Make the old name an alias (for example, a ``static inline`` function calling the
new function).
* Deprecate the old name, typically using :c:macro:`Py_DEPRECATED`.
* Announce the change in the "What's New".
@@ -255,7 +271,7 @@ Moving an API from unstable to public
-------------------------------------
* Expose the API under its new name, without the ``PyUnstable_`` prefix.
-* Make the old ``PyUnstable_*`` name be an alias (e.g. a ``static inline``
+* Make the old ``PyUnstable_*`` name be an alias (for example, a ``static inline``
function calling the new function).
* Announce the change in What's New.
@@ -393,7 +409,7 @@ Adding a new definition to the Limited API
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03yy0000
- with the ``yy`` corresponding to the target CPython version, e.g.
+ with the ``yy`` corresponding to the target CPython version, for example,
``0x030A0000`` for Python 3.10.
- Append an entry to the Stable ABI manifest, ``Misc/stable_abi.toml``
- Regenerate the autogenerated files using ``make regen-limited-abi``.
@@ -426,7 +442,7 @@ To add a test file:
- Add a C file ``Modules/_testcapi/yourfeature_limited.c``. If that file
already exists but its ``Py_LIMITED_API`` version is too low, add a version
- postfix, e.g. ``yourfeature_limited_3_12.c`` for Python 3.12+.
+ postfix, for example, ``yourfeature_limited_3_12.c`` for Python 3.12+.
- ``#define Py_LIMITED_API`` to the minimum limited API version needed.
- ``#include "parts.h"`` after the ``Py_LIMITED_API`` definition
- Enclose the entire rest of the file in ``#ifdef LIMITED_API_AVAILABLE``,
diff --git a/developer-workflow/communication-channels.rst b/developer-workflow/communication-channels.rst
index 0f7970fad..e9360d201 100644
--- a/developer-workflow/communication-channels.rst
+++ b/developer-workflow/communication-channels.rst
@@ -27,12 +27,13 @@ in return.
Mailing lists
=============
-.. note:: Some mailing lists have been supplanted by categories in the
- Python `Discourse`_. Specifically,
+.. note::
+
+ Mailing lists have generally been replaced by the `Discourse`_ forum.
+ Specifically,
* The python-dev list is superseded by the `Core Development`_
and `PEPs`_ categories on Discourse.
-
* The python-ideas list is superseded by posts in the `Ideas`_
category on Discourse.
@@ -42,17 +43,21 @@ Mailing lists
- Ideas about new functionality should **not** start here, and instead
should be discussed in `Ideas`_.
- Technical support questions should also not be asked here, and instead
- should go to the python-list_ or python-help_ mailing lists, or the
- `Python Help`_ category on Discourse.
+ should go to the `Python Help`_ category on Discourse or the python-list_.
+
+ Previous threads on the python-dev_, python-committers_, and python-ideas_
+ mailing lists can be accessed through the `online archive
+ `__.
-Existing threads on the python-dev_, python-committers_, and python-ideas_ mailing lists
-can be accessed through the `online archive `__.
+ .. _python-committers: https://mail.python.org/mailman3/lists/python-committers.python.org/
+ .. _python-dev: https://mail.python.org/mailman3/lists/python-dev.python.org/
+ .. _python-ideas: https://mail.python.org/mailman3/lists/python-ideas.python.org
General Python questions should go to `python-list`_ or `tutor`_
-or similar resources, such as StackOverflow_ or the ``#python`` IRC channel
+or similar resources, such as `Stack Overflow`_ or the ``#python`` IRC channel
on Libera.Chat_.
-`The core-workflow `_
+The `core-workflow `__
issue tracker is the place to discuss and work on improvements to the CPython
core development workflow.
@@ -62,16 +67,10 @@ https://mail.python.org/mailman3/ (newer lists, using Mailman3). Some lists may
be mirrored at `GMANE `_ and can be read and posted to in various
ways, including via web browsers, NNTP newsreaders, and RSS feed readers.
-.. _issue tracker: https://github.com/python/cpython/issues
-.. _python-committers: https://mail.python.org/mailman3/lists/python-committers.python.org/
-.. _python-dev: https://mail.python.org/mailman3/lists/python-dev.python.org/
-.. _python-help: https://mail.python.org/mailman/listinfo/python-help
-.. _python-ideas: https://mail.python.org/mailman3/lists/python-ideas.python.org
.. _python-list: https://mail.python.org/mailman/listinfo/python-list
.. _tutor: https://mail.python.org/mailman/listinfo/tutor
-.. _StackOverflow: https://stackoverflow.com/
+.. _Stack Overflow: https://stackoverflow.com/
.. _Libera.Chat: https://libera.chat/
-.. _web gateway: https://mail.python.org/archives/
.. _communication-discourse:
@@ -79,11 +78,8 @@ ways, including via web browsers, NNTP newsreaders, and RSS feed readers.
Discourse (discuss.python.org web forum)
========================================
-We have our own `Discourse`_ forum for both developers and users. This forum
-complements the `python-dev`_, `python-ideas`_, `python-help`_, and
-`python-list`_ mailing lists.
-
-This forum has different categories and most core development discussions
+We have our own `Discourse`_ forum for both developers and users.
+It has different categories and most core development discussions
take place in the open forum categories for `PEPs`_ and `Core Development`_
(these are the Discourse equivalents to the python-dev mailing list).
All categories are open for users to read and post with the exception of
@@ -98,8 +94,8 @@ Tutorials for new users
To start a topic or participate in any discussions in the forum, sign up and
create an account using an email address or GitHub account. You can do so by
-clicking the "Sign Up" button on the top right hand corner of the `Discourse`_
-main page.
+clicking the :guilabel:`Sign Up` button on the top right hand corner of the
+`Discourse`_ main page.
The Python Discourse `Quick Start `_
compiled by `Carol Willing `_ gives you
@@ -110,15 +106,18 @@ These tutorials can be activated by replying to a welcome message from "discours
Greetings!" received under Notifications and Messages in your user account.
* Click on your personal account found on the top right hand corner of the page.
-* The dropdown menu will show four different icons: π (Notifications),
- π (Bookmarks), βοΈ (Messages), and π€ (Preferences).
+* The dropdown menu will show four different icons:
+ :guilabel:`π` (Notifications),
+ :guilabel:`π` (Bookmarks),
+ :guilabel:`βοΈ` (Messages), and
+ :guilabel:`π€` (Preferences).
* Select either Notifications or Messages.
* Open the "Greetings!" message sent by Discobot to start the tutorial.
Ensure that you read through the `Python Code of Conduct `_.
We are to be open, considerate and respectful to all users in the community.
You can report messages that don't respect the CoC by clicking on the three
-dots under the message and then on the β icon. You can also mention the
+dots under the message and then on the :guilabel:`β` icon. You can also mention the
`@staff `_,
`@moderators `_, or
`@admins `_ groups in a message.
@@ -126,7 +125,8 @@ dots under the message and then on the β icon. You can also mention the
Reading topics
------------------
+--------------
+
Click a topic title and read down the list of replies in chronological order,
following links or previewing replies and quotes as you go. Use your mouse to
scroll the screen, or use the timeline scroll bar on the right which also shows
@@ -142,10 +142,11 @@ Following categories (category notifications)
Notifications can be set for individual categories and topics. To change any of these
defaults, you can either go to your user preferences, or visit the category
-page, and use the notification button π above the topic list,
-on the top right hand corner of the category page beside the "+ New Topic" button.
+page, and use the notification button :guilabel:`π` above the topic list,
+on the top right hand corner of the category page beside the
+:guilabel:`+ New Topic` button.
-Clicking on the Notification control π will show a drop-down panel with 5
+Clicking on the notification control :guilabel:`π` will show a drop-down panel with 5
different options: Watching, Tracking, Watching First Post, Normal, and Muted.
All categories are set by default in Normal mode where you will only be notified
if someone mentions your @name or replies to you.
@@ -154,7 +155,7 @@ Following individual threads (topic notifications)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To follow any individual topics or threads, you can adjust your notifications
-through the notification button π found on the right of the topic at the end
+through the notification button :guilabel:`π` found on the right of the topic at the end
of the timeline. You can also do so at the bottom of each topic.
Select "Watching" and you will be notified when there is any new updated reply
from that particular thread.
@@ -181,7 +182,7 @@ mailing list mode" and save changes.
.. _Core Development: https://discuss.python.org/c/core-dev/23
.. _Committers: https://discuss.python.org/c/committers/5
.. _Ideas: https://discuss.python.org/c/ideas/6
-.. _Python Help: https://discuss.python.org/c/users/7
+.. _Python Help: https://discuss.python.org/c/help/7
Discord (private chat server)
@@ -235,7 +236,7 @@ Blogs
Several core developers are active bloggers and discuss Python's development
that way. You can find their blogs (and various other developers who use Python)
-at https://planetpython.org/.
+at `Planet Python `__.
Setting expectations for open source participation
@@ -249,16 +250,17 @@ order to make open source pleasant for everyone involved.
Additional repositories
=======================
-`Python Core Workflow`_ hosts the codebase for tools such as :pypi:`blurb`.
+`Python Core Workflow`_ hosts an issue tracker for workflow discussions.
-Other core workflow tools are:
+Some core workflow tools are:
* `cherry_picker`_ (:pypi:`PyPI `)
* `bedevere`_
+* `blurb`_ (:pypi:`PyPI `)
* `blurb_it`_
* `miss-islington`_
-* `cla-bot`_
-* `cpython-emailer-webhook`_
+* `clabot`_
+* `webhook-mailer`_
Python `Performance Benchmark`_ project is intended to be an authoritative
source of benchmarks for all Python implementations.
@@ -266,8 +268,9 @@ source of benchmarks for all Python implementations.
.. _Python Core Workflow: https://github.com/python/core-workflow
.. _cherry_picker: https://github.com/python/cherry-picker
.. _bedevere: https://github.com/python/bedevere
+.. _blurb: https://github.com/python/blurb
.. _blurb_it: https://github.com/python/blurb_it
.. _miss-islington: https://github.com/python/miss-islington
-.. _cla-bot: https://github.com/ambv/cla-bot
-.. _cpython-emailer-webhook: https://github.com/berkerpeksag/cpython-emailer-webhook
+.. _clabot: https://github.com/psf/clabot
+.. _webhook-mailer: https://github.com/python/webhook-mailer
.. _Performance Benchmark: https://github.com/python/pyperformance
diff --git a/developer-workflow/development-cycle.rst b/developer-workflow/development-cycle.rst
index 79a9dced4..d807d74ec 100644
--- a/developer-workflow/development-cycle.rst
+++ b/developer-workflow/development-cycle.rst
@@ -36,8 +36,8 @@ Some examples of release tags: ``v3.7.0a1``, ``v3.6.3``, ``v2.7.14rc1``.
Branches
--------
-There is a branch for each *feature version*, whether released or not (e.g.
-3.7, 3.8).
+There is a branch for each *feature version*, whether released or not (for
+example, 3.12, 3.13).
.. _indevbranch:
@@ -51,13 +51,11 @@ changes, performance improvements, bug fixes.
At some point during the life-cycle of a release, a
new :ref:`maintenance branch ` is created to host all bug fixing
-activity for further micro versions in a feature version (3.8.1, 3.8.2, etc.).
+activity for further micro versions in a feature version (3.12.1, 3.12.2, and so
+on).
-For versions 3.4 and before, this was conventionally done when the final
-release was cut (for example, 3.4.0 final).
-
-Starting with the 3.5 release, we create the release maintenance branch
-(e.g. 3.5) at the time we enter beta (3.5.0 beta 1). This allows
+We create the release maintenance branch
+(``3.14``) at the time we enter beta (3.14.0 beta 1). This allows
feature development for the release 3.n+1 to occur within the main
branch alongside the beta and release candidate stabilization periods
for release 3.n.
@@ -79,7 +77,7 @@ releases; the terms are used interchangeably. These releases have a
The only changes allowed to occur in a maintenance branch without debate are
bug fixes, test improvements, and edits to the documentation.
Also, a general rule for maintenance branches is that compatibility
-must not be broken at any point between sibling micro releases (3.5.1, 3.5.2,
+must not be broken at any point between sibling micro releases (3.12.1, 3.12.2,
etc.). For both rules, only rare exceptions are accepted and **must** be
discussed first.
@@ -89,7 +87,7 @@ since most readers access the `stable documentation
rather than the `development documentation `__.
A new maintenance branch is normally created when the next feature release
-cycle reaches feature freeze, i.e. at its first beta pre-release.
+cycle reaches feature freeze, that is, at its first beta pre-release.
From that point on, changes intended for remaining pre-releases, the final
release (3.x.0), and subsequent bugfix releases are merged to
that maintenance branch.
@@ -97,9 +95,9 @@ that maintenance branch.
Sometime following the final release (3.x.0), the maintenance branch for
the previous minor version will go into :ref:`security mode `,
usually after at least one more bugfix release at the discretion of the
-release manager. For example, the 3.4 maintenance branch was put into
-:ref:`security mode ` after the 3.4.4 bugfix release
-which followed the release of 3.5.1.
+release manager. For example, the 3.11 maintenance branch was put into
+:ref:`security mode ` after the 3.11.9 bugfix release
+which followed the release of 3.12.2.
.. _secbranch:
@@ -120,7 +118,7 @@ Commits to security branches are to be coordinated with the release manager
for the corresponding feature version, as listed in the :ref:`branchstatus`.
Merging of pull requests to security branches is restricted to release managers.
Any release made from a security branch is source-only and done only when actual
-security patches have been applied to the branch. These releases have a
+security fixes have been applied to the branch. These releases have a
**micro version** number greater than the last **bugfix** release.
.. _eolbranch:
@@ -131,7 +129,7 @@ End-of-life branches
The code base for a release cycle which has reached end-of-life status
is frozen and no longer has a branch in the repo. The final state of
the end-of-lifed branch is recorded as a tag with the same name as the
-former branch, e.g. ``3.3`` or ``2.6``.
+former branch, for example, ``3.8`` or ``2.7``.
The :ref:`versions` page contains list of active and end-of-life branches.
@@ -153,8 +151,8 @@ Pre-alpha
The branch is in this stage when no official release has been done since
the latest final release. There are no special restrictions placed on
-commits, although the usual advice applies (getting patches reviewed, avoiding
-breaking the buildbots).
+commits, although the usual advice applies (getting pull requests reviewed,
+avoiding breaking the buildbots).
.. _alpha:
@@ -180,9 +178,6 @@ and beta releases.
Being in beta can be viewed much like being in RC_ but without the extra
overhead of needing commit reviews.
-Please see the note in the `In-development (main) branch`_ section above for
-new information about the creation of the 3.5 maintenance branch during beta.
-
.. _rc:
@@ -191,7 +186,7 @@ Release Candidate (RC)
A branch preparing for an RC release can only have bugfixes applied that have
been reviewed by other core developers. Generally, these issues must be
-severe enough (e.g. crashes) that they deserve fixing before the final release.
+severe enough (for example, crashes) that they deserve fixing before the final release.
All other issues should be deferred to the next development cycle, since
stability is the strongest concern at this point.
@@ -227,13 +222,13 @@ repositories are expected to relate to the Python language, the CPython
reference implementation, their documentation and their development workflow.
This includes, for example:
-* The reference implementation of Python and related repositories (i.e. `CPython `_)
-* Tooling and support around CPython development (e.g. `pyperformance `_, `Bedevere `_)
-* Helpers and backports for Python/CPython features (e.g. `typing_extensions `_, `typeshed `_, `tzdata `_, `pythoncapi-compat `_)
-* Organization-related repositories (e.g. the `Code of Conduct `_, `.github `_)
-* Documentation and websites for all the above (e.g. `python.org repository `_, `PEPs `_, `Devguide `_, docs translations)
-* Infrastructure for all the above (e.g. `docsbuild-scripts `_, `buildmaster-config `_)
-* Discussions and notes around official development-related processes and events (e.g. `steering-council `_, `core-sprint `_)
+* The reference implementation of Python and related repositories: `CPython `_.
+* Tooling and support around CPython development: `pyperformance `_, `Bedevere `_.
+* Helpers and backports for Python/CPython features: `typing_extensions `_, `typeshed `_, `tzdata `_, `pythoncapi-compat `_.
+* Organization-related repositories: the `Code of Conduct `_, `.github `_.
+* Documentation and websites for all the above: `python.org repository `_, `PEPs `_, `Devguide `_, docs translations.
+* Infrastructure for all the above: `docsbuild-scripts `_, `buildmaster-config `_.
+* Discussions and notes around official development-related processes and events: `steering-council `_, `core-sprint `_.
Before adding a new repository to the organization, open a discussion to seek consensus
in the `Committers Discourse category `_.
@@ -248,13 +243,13 @@ accounts or other GitHub orgs. It is relatively easy to move a repository to
the organization once it is mature. For example, this would now apply to
experimental features like `asyncio `_,
`exceptiongroups `_,
-and drafts of new guides and other documentation (e.g. `redistributor-guide
+and drafts of new guides and other documentation (for example, `redistributor-guide
`_).
-General-use tools and libraries (e.g. `mypy `_
+General-use tools and libraries (for example, `mypy `_
or `Black `_) should also be developed outside
the ``python`` organization, unless core devs (as represented by the SC)
-specifically want to βblessβ one implementation (as with e.g.
+specifically want to βblessβ one implementation (as with
`typeshed `_,
`tzdata `_, or
`pythoncapi-compat `_).
@@ -301,7 +296,7 @@ Current owners
+----------------------+--------------------------------+-----------------+
| Ee Durbin | PSF Director of Infrastructure | ewdurbin |
+----------------------+--------------------------------+-----------------+
-| Van Lindberg | PSF General Counsel | VanL |
+| Jacob Coffee | PSF Infrastructure Engineer | JacobCoffee |
+----------------------+--------------------------------+-----------------+
| Εukasz Langa | CPython Developer in Residence | ambv |
+----------------------+--------------------------------+-----------------+
@@ -340,17 +335,15 @@ Current administrators
+-------------------+----------------------------------------------------------+-----------------+
| Name | Role | GitHub Username |
+===================+==========================================================+=================+
-| Pablo Galindo | Python 3.10 and 3.11 Release Manager, | pablogsal |
-| | Maintainer of buildbot.python.org | |
+| Hugo van Kemenade | Python 3.14 and 3.15 Release Manager | hugovk |
+-------------------+----------------------------------------------------------+-----------------+
-| Εukasz Langa | Python 3.8 and 3.9 Release Manager, | ambv |
-| | PSF CPython Developer in Residence 2021-2022 | |
+| Thomas Wouters | Python 3.12 and 3.13 Release Manager | Yhg1s |
+-------------------+----------------------------------------------------------+-----------------+
-| Ned Deily | Python 3.6 and 3.7 Release Manager | ned-deily |
-+-------------------+----------------------------------------------------------+-----------------+
-| Larry Hastings | Retired Release Manager (for Python 3.4 and 3.5) | larryhastings |
+| Pablo Galindo | Python 3.10 and 3.11 Release Manager, | pablogsal |
+| | Maintainer of buildbot.python.org | |
+-------------------+----------------------------------------------------------+-----------------+
-| Berker Peksag | Maintainer of bpo-linkify and cpython-emailer-webhook | berkerpeksag |
+| Εukasz Langa | Python 3.9 Release Manager, | ambv |
+| | PSF CPython Developer in Residence 2021-present | |
+-------------------+----------------------------------------------------------+-----------------+
| Brett Cannon | | brettcannon |
+-------------------+----------------------------------------------------------+-----------------+
@@ -358,6 +351,8 @@ Current administrators
+-------------------+----------------------------------------------------------+-----------------+
| Mariatta Wijaya | Maintainer of bedevere, blurb_it and miss-islington | Mariatta |
+-------------------+----------------------------------------------------------+-----------------+
+| Seth Larson | PSF Security Developer-in-Residence | sethmlarson |
++-------------------+----------------------------------------------------------+-----------------+
Repository release manager role policy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -365,13 +360,37 @@ Repository release manager role policy
Release Managers for :ref:`in-development `, :ref:`maintenance
`, and :ref:`security mode ` Python releases are
granted Administrator privileges on the repository. Once a release branch has
-entered :ref:`end-of-life `, the Release Manager for that branch is
-removed as an Administrator and granted sole privileges (out side of repository
-administrators) to merge changes to that branch.
+entered :ref:`end-of-life `, the Release Manager for that branch
+creates a final tag and deletes the branch. After this, they are
+removed as an Administrator.
Multi-Factor Authentication must be enabled by the user in order to retain
access as a Release Manager of the branch.
+PyPI organization policy
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Python core team owns the :pypi-org:`cpython` and :pypi-org:`python`
+organizations on PyPI for publishing packages.
+The main benefits of adding packages to these organizations:
+
+* Visibility: we can see our packages under a PyPI org page
+* Maintainability: we can share granular PyPI access to improve the bus factor
+
+The general policy on which organization to use:
+
+* :pypi-org:`cpython`:
+ for development tools that are tied fairly closely to CPython development.
+ For example, :pypi:`blurb` and :pypi:`cherry-picker`.
+ Users generally shouldnβt have to care except for developing CPython itself
+ (although that doesnβt mean the tools necessarily have to be unusable for
+ anyone else).
+* :pypi-org:`python`:
+ for general-audience projects that are maintained by the Python core team.
+ For example, :pypi:`pyperformance`, :pypi:`python-docs-theme` and
+ :pypi:`tzdata`.
+
+
Governance
----------
diff --git a/developer-workflow/extension-modules.rst b/developer-workflow/extension-modules.rst
index 0384c2b38..d6be88824 100644
--- a/developer-workflow/extension-modules.rst
+++ b/developer-workflow/extension-modules.rst
@@ -5,13 +5,665 @@
Standard library extension modules
==================================
-In this section, we could explain how to write a CPython extension with the C language, but the topic can take a complete book.
-
-For this reason, we prefer to give you some links where you can read a very good documentation.
-
-Read the following references:
+In this section, we explain how to configure and compile the CPython project
+with a C :term:`extension module`. We will not explain how to write a C
+extension module and prefer to give you some links where you can read good
+documentation:
* https://docs.python.org/dev/c-api/
* https://docs.python.org/dev/extending/
* :pep:`399`
* https://pythonextensionpatterns.readthedocs.io/en/latest/
+
+Some modules in the standard library, such as :mod:`datetime` or :mod:`pickle`,
+have identical implementations in C and Python; the C implementation, when
+available, is expected to improve performance (such extension modules are
+commonly referred to as *accelerator modules*).
+
+Other modules mainly implemented in Python may import a C helper extension
+providing implementation details (for instance, the :mod:`csv` module uses
+the internal :mod:`!_csv` module defined in :cpy-file:`Modules/_csv.c`).
+
+Classifying extension modules
+=============================
+
+Extension modules can be classified into two categories:
+
+* A *built-in* extension module is a module built and shipped with
+ the Python interpreter. A built-in module is *statically* linked
+ into the interpreter, thereby lacking a :attr:`!__file__` attribute.
+
+ .. seealso:: :data:`sys.builtin_module_names` --- names of built-in modules.
+
+ Built-in modules are built with the :c:macro:`!Py_BUILD_CORE_BUILTIN`
+ macro defined.
+
+* A *shared* (or *dynamic*) extension module is built as a shared library
+ (``.so`` or ``.dll`` file) and is *dynamically* linked into the interpreter.
+
+ In particular, the module's :attr:`!__file__` attribute contains the path
+ to the ``.so`` or ``.dll`` file.
+
+ Shared modules are built with the :c:macro:`!Py_BUILD_CORE_MODULE`
+ macro defined. Using the :c:macro:`!Py_BUILD_CORE_BUILTIN` macro
+ instead causes an :exc:`ImportError` when importing the module.
+
+.. note::
+
+ Informally, built-in extension modules can be regarded as *required*
+ while shared extension modules are *optional* in the sense that they
+ might be supplied, overridden or disabled externally.
+
+ Usually, accelerator modules are built as *shared* extension modules,
+ especially if they already have a pure Python implementation.
+
+According to :pep:`399`, *new* extension modules MUST provide a working and
+tested pure Python implementation, unless a special dispensation from
+the :github:`Steering Council ` is given.
+
+Adding an extension module to CPython
+=====================================
+
+Assume that the standard library contains a pure Python module :mod:`!foo`
+with the following :func:`!foo.greet` function:
+
+.. code-block:: python
+ :caption: Lib/foo.py
+
+ def greet():
+ return "Hello World!"
+
+Instead of using the Python implementation of :func:`!foo.greet`, we want to
+use its corresponding C extension implementation exposed in the :mod:`!_foo`
+module. Ideally, we want to modify ``Lib/foo.py`` as follows:
+
+.. code-block:: python
+ :caption: Lib/foo.py
+
+ try:
+ # use the C implementation if possible
+ from _foo import greet
+ except ImportError:
+ # fallback to the pure Python implementation
+ def greet():
+ return "Hello World!"
+
+.. note::
+
+ Accelerator modules should *never* be imported directly. The convention is
+ to mark them as private implementation details with the underscore prefix
+ (namely, :mod:`!_foo` in this example).
+
+In order to incorporate the accelerator module, we need to determine:
+
+- where to update the CPython project tree with the extension module source code,
+- which files to modify to configure and compile the CPython project, and
+- which ``Makefile`` rules to invoke at the end.
+
+Updating the CPython project tree
+---------------------------------
+
+Usually, accelerator modules are added in the :cpy-file:`Modules` directory of
+the CPython project. If more than one file is needed for the extension module,
+it is more convenient to create a sub-directory in :cpy-file:`Modules`.
+
+In the simplest example where the extension module consists of one file, it may
+be placed in :cpy-file:`Modules` as ``Modules/_foomodule.c``. For a non-trivial
+example of the extension module :mod:`!_foo`, we consider the following working
+tree:
+
+- :ref:`Modules/_foo/_foomodule.c` --- the extension module implementation.
+- :ref:`Modules/_foo/helper.h` --- the extension helpers declarations.
+- :ref:`Modules/_foo/helper.c` --- the extension helpers implementations.
+
+By convention, the source file containing the extension module implementation
+is called ``module.c``, where ```` is the name of the module that
+will be later imported (in our case :mod:`!_foo`). In addition, the directory
+containing the implementation should also be named similarly.
+
+.. code-block:: c
+ :caption: Modules/_foo/helper.h
+ :name: Modules/_foo/helper.h
+
+ #ifndef _FOO_HELPER_H
+ #define _FOO_HELPER_H
+
+ #include "Python.h"
+
+ typedef struct {
+ /* ... */
+ } foomodule_state;
+
+ static inline foomodule_state *
+ get_foomodule_state(PyObject *module)
+ {
+ void *state = PyModule_GetState(module);
+ assert(state != NULL);
+ return (foomodule_state *)state;
+ }
+
+ /* Helper used in Modules/_foo/_foomodule.c
+ * but implemented in Modules/_foo/helper.c.
+ */
+ extern PyObject *
+ _Py_greet_fast(void);
+
+ #endif // _FOO_HELPER_H
+
+.. tip::
+
+ Functions or data that do not need to be shared across different C source
+ files should be declared ``static`` to avoid exporting their symbols from
+ ``libpython``.
+
+ If symbols need to be exported, their names must start with ``Py`` or
+ ``_Py``. This can be verified by ``make smelly``. For more details,
+ please refer to the section on :ref:`Changing Python's C API `.
+
+.. code-block:: c
+ :caption: Modules/_foo/helper.c
+ :name: Modules/_foo/helper.c
+
+ #include "_foomodule.h"
+
+ PyObject *_Py_greet_fast(void) {
+ return PyUnicode_FromString("Hello World!");
+ }
+
+.. code-block:: c
+ :caption: Modules/_foo/_foomodule.c
+ :name: Modules/_foo/_foomodule.c
+
+ #include "helper.h"
+ #include "clinic/_foomodule.c.h"
+
+ /* Functions for the extension module's state */
+ static int
+ foomodule_exec(PyObject *module)
+ {
+ // imports, static attributes, exported classes, etc
+ return 0;
+ }
+
+ static int
+ foomodule_traverse(PyObject *m, visitproc visit, void *arg)
+ {
+ foomodule_state *st = get_foomodule_state(m);
+ // call Py_VISIT() on the state attributes
+ return 0;
+ }
+
+ static int
+ foomodule_clear(PyObject *m)
+ {
+ foomodule_state *st = get_foomodule_state(m);
+ // call Py_CLEAR() on the state attributes
+ return 0;
+ }
+
+ static void
+ foomodule_free(void *m) {
+ (void)foomodule_clear((PyObject *)m);
+ }
+
+ /* Implementation of publicly exported functions. */
+
+ /*[clinic input]
+ module foo
+ [clinic start generated code]*/
+ /*[clinic end generated code: output=... input=...]*/
+
+ /*[clinic input]
+ foo.greet -> object
+
+ [clinic start generated code]*/
+
+ static PyObject *
+ foo_greet_impl(PyObject *module)
+ /*[clinic end generated code: output=... input=...]*/
+ {
+ return _Py_greet_fast();
+ }
+
+ /* Exported module's data */
+
+ static PyMethodDef foomodule_methods[] = {
+ // macro in 'clinic/_foomodule.c.h' after running 'make clinic'
+ FOO_GREET_METHODDEF
+ {NULL, NULL}
+ };
+
+ static struct PyModuleDef_Slot foomodule_slots[] = {
+ // 'foomodule_exec' may be NULL if the state is trivial
+ {Py_mod_exec, foomodule_exec},
+ {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+ {Py_mod_gil, Py_MOD_GIL_NOT_USED},
+ {0, NULL},
+ };
+
+ static struct PyModuleDef foomodule = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "_foo",
+ .m_doc = "some doc", // or NULL if not needed
+ .m_size = sizeof(foomodule_state),
+ .m_methods = foomodule_methods,
+ .m_slots = foomodule_slots,
+ .m_traverse = foomodule_traverse, // or NULL if the state is trivial
+ .m_clear = foomodule_clear, // or NULL if the state is trivial
+ .m_free = foomodule_free, // or NULL if the state is trivial
+ };
+
+ PyMODINIT_FUNC
+ PyInit__foo(void)
+ {
+ return PyModuleDef_Init(&foomodule);
+ }
+
+.. tip::
+
+ Recall that the ``PyInit_`` function must be suffixed by the
+ module name ```` used in import statements (here ``_foo``),
+ and which usually coincides with :c:member:`PyModuleDef.m_name`.
+
+ Other identifiers such as those used in :ref:`Argument Clinic `
+ inputs do not have such naming requirements.
+
+Configuring the CPython project
+-------------------------------
+
+Now that we have added our extension module to the CPython source tree,
+we need to update some configuration files in order to compile the CPython
+project on different platforms.
+
+Updating ``Modules/Setup.{bootstrap,stdlib}.in``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Depending on whether the extension module is required to get a functioning
+interpreter or not, we update :cpy-file:`Modules/Setup.bootstrap.in` or
+:cpy-file:`Modules/Setup.stdlib.in`. In the former case, the extension
+module is necessarily built as a built-in extension module.
+
+.. tip::
+
+ For accelerator modules, :cpy-file:`Modules/Setup.stdlib.in` should be
+ preferred over :cpy-file:`Modules/Setup.bootstrap.in`.
+
+For built-in extension modules, update :cpy-file:`Modules/Setup.bootstrap.in`
+by adding the following line after the ``*static*`` marker:
+
+.. code-block:: text
+ :caption: :cpy-file:`Modules/Setup.bootstrap.in`
+ :emphasize-lines: 3
+
+ *static*
+ ...
+ _foo _foo/_foomodule.c _foo/helper.c
+ ...
+
+The syntax is `` `` where ```` is the name of the
+module used in :keyword:`import` statements and ```` is the list
+of space-separated source files.
+
+For other extension modules, update :cpy-file:`Modules/Setup.stdlib.in`
+by adding the following line after the ``*@MODULE_BUILDTYPE@*`` marker
+but before the ``*shared*`` marker:
+
+.. code-block:: text
+ :caption: :cpy-file:`Modules/Setup.stdlib.in`
+ :emphasize-lines: 3
+
+ *@MODULE_BUILDTYPE@*
+ ...
+ @MODULE__FOO_TRUE@_foo _foo/_foomodule.c _foo/helper.c
+ ...
+ *shared*
+
+The ``@MODULE__TRUE@`` marker expects ```` to
+be the upper-cased form of ````, where ```` has the same meaning
+as before (in our case, ```` and ```` are ``_FOO`` and
+``_foo`` respectively). The marker is followed by the list of source files.
+
+If the extension module must be built as a *shared* module, put the
+``@MODULE__FOO_TRUE@_foo`` line after the ``*shared*`` marker:
+
+.. code-block:: text
+ :caption: :cpy-file:`Modules/Setup.stdlib.in`
+ :emphasize-lines: 4
+
+ ...
+ *shared*
+ ...
+ @MODULE__FOO_TRUE@_foo _foo/_foomodule.c _foo/helper.c
+
+Updating :cpy-file:`configure.ac`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. add section about configuration variable afterwards
+
+* Locate the ``SRCDIRS`` variable and add the following line:
+
+ .. code-block:: text
+ :caption: :cpy-file:`configure.ac`
+ :emphasize-lines: 4
+
+ AC_SUBST([SRCDIRS])
+ SRCDIRS="\
+ ...
+ Modules/_foo \
+ ..."
+
+ .. note::
+
+ This step is only needed when adding new source directories to
+ the CPython project.
+
+* Find the section containing ``PY_STDLIB_MOD`` and ``PY_STDLIB_MOD_SIMPLE``
+ usages and add the following line:
+
+ .. code-block:: text
+ :caption: :cpy-file:`configure.ac`
+ :emphasize-lines: 3
+
+ dnl always enabled extension modules
+ ...
+ PY_STDLIB_MOD_SIMPLE([_foo], [-I\$(srcdir)/Modules/_foo], [])
+ ...
+
+ The ``PY_STDLIB_MOD_SIMPLE`` macro takes as arguments:
+
+ * the module name ```` used in :keyword:`import` statements,
+ * the compiler flags (CFLAGS), and
+ * the linker flags (LDFLAGS).
+
+ If the extension module may not be enabled or supported depending on the
+ host configuration, use the ``PY_STDLIB_MOD`` macro instead, which takes
+ as arguments:
+
+ * the module name ```` used in :keyword:`import` statements,
+ * a boolean indicating whether the extension is **enabled** or not,
+ * a boolean indicating whether the extension is **supported** or not,
+ * the compiler flags (CFLAGS), and
+ * the linker flags (LDFLAGS).
+
+ For instance, enabling the :mod:`!_foo` extension on Linux platforms, but
+ only providing support for 32-bit architecture, is achieved as follows:
+
+ .. code-block:: text
+ :caption: :cpy-file:`configure.ac`
+ :emphasize-lines: 2, 3
+
+ PY_STDLIB_MOD([_foo],
+ [test "$ac_sys_system" = "Linux"],
+ [test "$ARCH_RUN_32BIT" = "true"],
+ [-I\$(srcdir)/Modules/_foo], [])
+
+ More generally, the host's configuration status of the extension is
+ determined as follows:
+
+ +-----------+-----------------+----------+
+ | Enabled | Supported | Status |
+ +===========+=================+==========+
+ | true | true | yes |
+ +-----------+-----------------+----------+
+ | true | false | missing |
+ +-----------+-----------------+----------+
+ | false | true or false | disabled |
+ +-----------+-----------------+----------+
+
+ The extension status is ``n/a`` if the extension is marked unavailable
+ by the ``PY_STDLIB_MOD_SET_NA`` macro. To mark an extension as unavailable,
+ find the usages of ``PY_STDLIB_MOD_SET_NA`` in :cpy-file:`configure.ac` and
+ add the following line:
+
+ .. code-block:: text
+ :caption: :cpy-file:`configure.ac`
+ :emphasize-lines: 4
+
+ dnl Modules that are not available on some platforms
+ AS_CASE([$ac_sys_system],
+ ...
+ [PLATFORM_NAME], [PY_STDLIB_MOD_SET_NA([_foo])],
+ ...
+ )
+
+.. tip::
+
+ Consider reading the comments and configurations for existing modules
+ in :cpy-file:`configure.ac` for guidance on adding new external build
+ dependencies for extension modules that need them.
+
+Updating :cpy-file:`Makefile.pre.in`
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If needed, add the following line to the section for module dependencies:
+
+.. code-block:: text
+ :caption: :cpy-file:`Makefile.pre.in`
+ :emphasize-lines: 4
+
+ ##########################################################################
+ # Module dependencies and platform-specific files
+ ...
+ MODULE__FOO_DEPS=$(srcdir)/Modules/_foo/helper.h
+ ...
+
+The ``MODULE__DEPS`` variable follows the same naming
+requirements as the ``@MODULE__TRUE@`` marker.
+
+Updating MSVC project files
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+We describe the minimal steps for compiling on Windows using MSVC.
+
+* Update :cpy-file:`PC/config.c`:
+
+ .. code-block:: c
+ :caption: :cpy-file:`PC/config.c`
+ :emphasize-lines: 3, 8
+
+ ...
+ // add the entry point prototype
+ extern PyObject* PyInit__foo(void);
+ ...
+ // update the entry points table
+ struct _inittab _PyImport_Inittab[] = {
+ ...
+ {"_foo", PyInit__foo},
+ ...
+ {0, 0}
+ };
+ ...
+
+ Each item in ``_PyImport_Inittab`` consists of the module name to import,
+ here :mod:`!_foo`, with the corresponding ``PyInit_*`` function correctly
+ suffixed.
+
+* Update :cpy-file:`PCbuild/pythoncore.vcxproj`:
+
+ .. code-block:: xml
+ :caption: :cpy-file:`PCbuild/pythoncore.vcxproj`
+ :emphasize-lines: 4, 11-12
+
+
+
+ ...
+
+ ...
+
+
+
+
+ ...
+
+
+ ...
+
+
+* Update :cpy-file:`PCbuild/pythoncore.vcxproj.filters`:
+
+ .. code-block:: xml
+ :caption: :cpy-file:`PCbuild/pythoncore.vcxproj.filters`
+ :emphasize-lines: 4-6, 13-18
+
+
+
+ ...
+
+ Modules\_foo
+
+ ...
+
+
+
+
+ ...
+
+ Modules\_foo
+
+
+ Modules\_foo
+
+ ...
+
+
+.. tip::
+
+ Header files use ```` tags, whereas
+ source files use ```` tags.
+
+
+Compiling the CPython project
+-----------------------------
+
+Now that the configuration is in place, it remains to compile the project:
+
+.. code-block:: shell
+
+ make regen-configure
+ ./configure
+ make regen-all
+ make regen-stdlib-module-names
+ make
+
+.. tip::
+
+ Use ``make -jN`` to speed-up compilation by utilizing as many CPU cores
+ as possible, where *N* is as many CPU cores you want to spare (and have
+ memory for). Be careful using ``make -j`` with no argument, as this puts
+ no limit on the number of jobs, and compilation can sometimes use up a
+ lot of memory (like when building with LTO).
+
+* ``make regen-configure`` updates the :cpy-file:`configure` script.
+
+ The :cpy-file:`configure` script must be generated using a specific version
+ of ``autoconf``. To that end, the :cpy-file:`Tools/build/regen-configure.sh`
+ script which the ``regen-configure`` rule is based on either requires Docker
+ or Podman, the latter being assumed by default.
+
+ .. tip::
+
+ We recommend installing `Podman `_
+ instead of Docker since the former does not require a background service
+ and avoids creating files owned by the ``root`` user in some cases.
+
+* ``make regen-all`` is responsible for regenerating header files and
+ invoking other scripts, such as :ref:`Argument Clinic `.
+ Execute this rule if you do not know which files should be updated.
+
+* ``make regen-stdlib-module-names`` updates the standard module names, making
+ :mod:`!_foo` discoverable and importable via ``import _foo``.
+
+* The final ``make`` step is generally not needed since the previous ``make``
+ invokations may completely rebuild the project, but it could be needed in
+ some specific cases.
+
+Troubleshooting
+---------------
+
+This section addresses common issues that you may face when following
+this example of adding an extension module.
+
+No rule to make target ``regen-configure``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This usually happens after running ``make distclean`` (which removes
+the ``Makefile``). The solution is to regenerate the :cpy-file:`configure`
+script as follows:
+
+.. code-block:: shell
+
+ ./configure # for creating the 'Makefile' file
+ make regen-configure # for updating the 'configure' script
+ ./configure # for updating the 'Makefile' file
+
+If missing, the :cpy-file:`configure` script can be regenerated
+by executing :cpy-file:`Tools/build/regen-configure.sh`:
+
+.. code-block:: shell
+
+ ./Tools/build/regen-configure.sh # create an up-to-date 'configure'
+ ./configure # create an up-to-date 'Makefile'
+
+``make regen-configure`` and missing permissions with Docker
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If Docker complains about missing permissions, this Stack Overflow post
+could be useful in solving the issue: `How to fix docker: permission denied
+`_. Alternatively, you may try
+using `Podman `_.
+
+Missing ``Py_BUILD_CORE`` define when using internal headers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+By default, the CPython :ref:`Stable ABI ` is exposed via
+:code:`#include "Python.h"`. In some cases, this may be insufficient
+and internal headers from :cpy-file:`Include/internal` are needed;
+in particular, those headers require the :c:macro:`!Py_BUILD_CORE`
+macro to be defined.
+
+To that end, one should define the :c:macro:`!Py_BUILD_CORE_BUILTIN`
+or the :c:macro:`!Py_BUILD_CORE_MODULE` macro depending on whether the
+extension module is built-in or shared. Using either of the two macros
+implies :c:macro:`!Py_BUILD_CORE` and gives access to CPython internals:
+
+.. code-block:: c
+ :caption: Definition of :c:macro:`!Py_BUILD_CORE_BUILTIN`
+
+ #ifndef Py_BUILD_CORE_MODULE
+ # define Py_BUILD_CORE_BUILTIN 1
+ #endif
+
+.. code-block:: c
+ :caption: Definition of :c:macro:`!Py_BUILD_CORE_MODULE`
+
+ #ifndef Py_BUILD_CORE_BUILTIN
+ # define Py_BUILD_CORE_MODULE 1
+ #endif
+
+Tips
+----
+
+In this section, we give some tips for improving the quality of
+extension modules meant to be included in the standard library.
+
+Restricting to the Limited API
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In order for non-CPython implementations to benefit from new extension modules,
+it is recommended to use the :ref:`Limited API `. Instead of
+exposing the entire Stable ABI, define the :c:macro:`Py_LIMITED_API` macro
+*before* the :code:`#include "Python.h"` directive:
+
+.. code-block:: c
+ :caption: Using the 3.13 Limited API.
+ :emphasize-lines: 3, 6
+
+ #include "pyconfig.h" // Py_GIL_DISABLED
+ #ifndef Py_GIL_DISABLED
+ # define Py_LIMITED_API 0x030d0000
+ #endif
+
+ #include "Python.h"
+
+This makes the extension module non-CPython implementation-friendly by
+removing the dependencies to CPython internals.
diff --git a/developer-workflow/grammar.rst b/developer-workflow/grammar.rst
index ee6bdbaa4..d574dfed7 100644
--- a/developer-workflow/grammar.rst
+++ b/developer-workflow/grammar.rst
@@ -4,67 +4,5 @@
Changing CPython's grammar
==========================
-Abstract
-========
-
-There's more to changing Python's grammar than editing
-:cpy-file:`Grammar/python.gram`. Here's a checklist.
-
-.. note::
- These instructions are for Python 3.9 and beyond. Earlier
- versions use a different parser technology. You probably shouldn't
- try to change the grammar of earlier Python versions, but if you
- really want to, use GitHub to track down the earlier version of this
- file in the devguide.
-
-For more information on how to use the new parser, check the
-:ref:`section on how to use CPython's parser `.
-
-Checklist
-=========
-
-Note: sometimes things mysteriously don't work. Before giving up, try ``make clean``.
-
-* :cpy-file:`Grammar/python.gram`: The grammar, with actions that build AST nodes.
- After changing it, run ``make regen-pegen`` (or ``build.bat --regen`` on Windows),
- to regenerate :cpy-file:`Parser/parser.c`.
- (This runs Python's parser generator, :cpy-file:`Tools/peg_generator`).
-
-* :cpy-file:`Grammar/Tokens` is a place for adding new token types. After
- changing it, run ``make regen-token`` to regenerate
- :cpy-file:`Include/internal/pycore_token.h`, :cpy-file:`Parser/token.c`,
- :cpy-file:`Lib/token.py` and :cpy-file:`Doc/library/token-list.inc`.
- If you change both ``python.gram`` and ``Tokens``,
- run ``make regen-token`` before ``make regen-pegen``.
- On Windows, ``build.bat --regen`` will regenerate both at the same time.
-
-* :cpy-file:`Parser/Python.asdl` may need changes to match the grammar.
- Then run ``make regen-ast`` to regenerate
- :cpy-file:`Include/internal/pycore_ast.h` and :cpy-file:`Python/Python-ast.c`.
-
-* :cpy-file:`Parser/lexer/` contains the tokenization code.
- This is where you would add a new type of comment or string literal, for example.
-
-* :cpy-file:`Python/ast.c` will need changes to validate AST objects
- involved with the grammar change.
-
-* :cpy-file:`Python/ast_unparse.c` will need changes to unparse AST
- involved with the grammar change ("unparsing" is used to turn annotations
- into strings per :pep:`563`).
-
-* The :ref:`compiler` has its own page.
-
-* ``_Unparser`` in the :cpy-file:`Lib/ast.py` file may need changes
- to accommodate any modifications in the AST nodes.
-
-* :cpy-file:`Doc/library/ast.rst` may need to be updated to reflect changes
- to AST nodes.
-
-* Add some usage of your new syntax to ``test_grammar.py``.
-
-* Certain changes may require tweaks to the library module :mod:`pyclbr`.
-
-* :cpy-file:`Lib/tokenize.py` needs changes to match changes to the tokenizer.
-
-* Documentation must be written! Specifically, one or more of the pages in
- :cpy-file:`Doc/reference/` will need to be updated.
+This document is now part of the
+`CPython Internals Docs `_.
diff --git a/developer-workflow/index.rst b/developer-workflow/index.rst
index 7b069021b..e73927f1d 100644
--- a/developer-workflow/index.rst
+++ b/developer-workflow/index.rst
@@ -1,3 +1,5 @@
+.. _dev-workflow:
+
====================
Development workflow
====================
@@ -14,3 +16,4 @@ Development workflow
grammar
porting
sbom
+ psrt
diff --git a/developer-workflow/lang-changes.rst b/developer-workflow/lang-changes.rst
index 70ecd679d..52aabb15d 100644
--- a/developer-workflow/lang-changes.rst
+++ b/developer-workflow/lang-changes.rst
@@ -45,7 +45,7 @@ The `Ideas Discourse category`_
is specifically intended for discussion of new features and language changes.
Please don't be disappointed if your idea isn't met with universal approval:
as the :pep:`long list of Withdrawn and Rejected PEPs
-<0#abandoned-withdrawn-and-rejected-peps>`
+<0#rejected-superseded-and-withdrawn-peps>`
in the :pep:`PEP Index <0>` attests,
and as befits a reasonably mature programming language,
getting significant changes into Python isn't a simple task.
diff --git a/developer-workflow/porting.rst b/developer-workflow/porting.rst
index 26756bc8f..f308e6c14 100644
--- a/developer-workflow/porting.rst
+++ b/developer-workflow/porting.rst
@@ -13,11 +13,11 @@ which it has already been ported; preferably Unix, but Windows will
do, too. The build process for Python, in particular the ``Makefile`` in the
source distribution, will give you a hint on which files to compile
for Python. Not all source files are relevant: some are platform-specific,
-and others are only used in emergencies (e.g. ``getopt.c``).
+and others are only used in emergencies (for example, ``getopt.c``).
It is not recommended to start porting Python without at least a medium-level
-understanding of your target platform; i.e. how it is generally used, how to
-write platform-specific apps, etc. Also, some Python knowledge is required, or
+understanding of your target platform; how it is generally used, how to
+write platform-specific apps, and so on. Also, some Python knowledge is required, or
you will be unable to verify that your port is working correctly.
You will need a ``pyconfig.h`` file tailored for your platform. You can
diff --git a/developer-workflow/psrt.rst b/developer-workflow/psrt.rst
new file mode 100644
index 000000000..f469f68d1
--- /dev/null
+++ b/developer-workflow/psrt.rst
@@ -0,0 +1,160 @@
+Python Security Response Team (PSRT)
+====================================
+
+The Python Security Response Team (PSRT) is responsible for handling
+vulnerability reports for CPython and pip.
+
+Vulnerability report triage
+---------------------------
+
+Vulnerability reports are sent to one of two locations,
+the long-standing ``security@python.org`` mailing list
+or using the private vulnerability reporting feature
+of GitHub Security Advisories (GHSA).
+
+For reports sent to ``security@python.org``, a PSRT admin
+will triage the report and if the report seems plausible
+(that is, not spam and for the correct project) will reply with
+instructions on how to report the vulnerability on GitHub.
+
+If the reporter doesn't want to use GitHub's Security Advisories feature
+then the PSRT admins can create a draft report on behalf of the reporter.
+
+Coordinating a vulnerability report
+-----------------------------------
+
+Each report will have a member of the PSRT assigned as the "coordinator".
+The coordinator will be responsible for following the below process and
+will be publicly credited on vulnerability records post-publication.
+
+If a coordinator can't complete the process for any reason (time obligation,
+vacation, etc.) they must find a replacement coordinator in the PSRT
+and reassign the vulnerability report appropriately.
+
+Coordinators are expected to collaborate with other PSRT members and core developers
+when needed for guidance on whether the report is an actual vulnerability,
+severity, advisory text, and fixes.
+
+**The vulnerability coordination process is:**
+
+* Coordinator will determine whether the report constitutes a vulnerability. If the report isn't a vulnerability,
+ the reporter should be notified appropriately. Close the GHSA report, the report can be reopened if
+ sufficient evidence is later obtained that the report is a vulnerability.
+
+* After a vulnerability report is accepted, a Common Vulnerabilities and Exposures (CVE) ID must be assigned. If this is not done
+ automatically, then a CVE ID can be obtained by the coordinator sending an email to ``cna@python.org``.
+ No details about the vulnerability report need to be shared with the PSF CVE Numbering Authority (CNA) for a CVE ID to be reserved.
+
+* If the report is a vulnerability, the coordinator will determine the severity of the vulnerability. Severity is one of:
+ **Low**, **Medium**, **High**, and **Critical**. Coordinators can use their knowledge of the code, how the code is likely used,
+ or another mechanism like Common Vulnerability Scoring System (CVSS) for determining a severity. Add this information to the GitHub Security Advisory.
+
+* Once a CVE ID is assigned, the coordinator will share the acceptance and CVE ID with the reporter.
+ Use this CVE ID for referencing the vulnerability. The coordinator will ask the reporter
+ if the reporter would like to be credited publicly for the report and if so, how they would like to be credited.
+ Add this information to the GitHub Security Advisory.
+
+* The coordinator authors the vulnerability advisory text. The advisory must include the following information:
+
+ * Title should be a brief description of the vulnerability and affected component
+ (for example, "Buffer over-read in SSLContext.set_npn_protocols()")
+
+ * Short description of the vulnerability, impact, and the conditions where the affected component is vulnerable, if applicable.
+
+ * Affected versions. This could be "all versions", but if the vulnerability exists in a new feature
+ or removed feature then this could be different. Include versions that are end-of-life in this calculation
+ (for example, "Python 3.9 and earlier", "Python 3.10 and later", "all versions of Python").
+
+ * Affected components and APIs. The module, function, class, or method must be specified so users can
+ search their codebase for usage. For issues affecting the entire project, this can be omitted.
+
+ * Mitigations for the vulnerability beyond upgrading to a fixed version, if applicable.
+
+ This can all be done within the GitHub Security Advisory UI for easier collaboration between reporter and coordinator.
+
+* The coordinator determines the fix approach and who will provide a fix.
+ Some reporters are willing to provide or collaborate to create a fix,
+ otherwise relevant core developers can be invited to collaborate by
+ the coordinator.
+
+ * For **Low** and **Medium** severity vulnerabilities it is acceptable
+ to develop a fix in public.
+ The pull request must be marked with the ``security`` and ``release-blocker``
+ labels so that a release is not created without including the fix.
+
+ * For **High** and **Critical** severity vulnerabilities the fix must be
+ developed privately using GitHub Security Advisories' "Private Forks" feature.
+ Core developers can be added to the GitHub Security Advisory via "collaborators"
+ to work on the fix together. Once a fix is approved privately and tested,
+ a public issue and pull request can be created with
+ the ``security`` and ``release-blocker`` labels.
+
+* Once the pull request is merged the advisory can be published. The coordinator will send the advisory by email
+ to ``security-announce@python.org`` using the below template. Backport labels must be added as appropriate.
+ After the advisory is published a CVE record can be created.
+
+Template responses
+------------------
+
+These template responses should be used as guidance for messaging
+in various points in the process above. They are not required to be sent as-is,
+please feel free to adapt them as needed for the current context.
+
+**Directing to GitHub Security Advisories:**
+
+.. highlight:: none
+
+::
+
+ Thanks for submitting this report.
+ We use GitHub Security Advisories for triaging vulnerability reports,
+ are you able to submit your report directly to GitHub?
+
+ https://github.com/python/cpython/security/advisories/new
+
+ If you're unable to submit a report to GitHub (due to not having a GitHub
+ account or something else) let me know and I will create a GitHub Security
+ Advisory on your behalf, although you won't be able to participate directly
+ in discussions.
+
+**Rejecting a vulnerability report:**
+
+::
+
+ Thanks for your report. We've determined that the report doesn't constitute
+ a vulnerability. Let us know if you disagree with this determination.
+ If you are interested in working on this further, you can optionally open a
+ public issue on GitHub.
+
+**Accepting a vulnerability report:**
+
+::
+
+ Thanks for your report. We've determined that the report
+ is a vulnerability. We've assigned {CVE-YYYY-XXXX} and determined
+ a severity of {Low,Medium,High,Critical}. Let us know if you disagree
+ with the determined severity.
+
+ If you would like to be publicly credited for this vulnerability as the
+ reporter, please indicate that, along with how you would like to be
+ credited (name or organization).
+
+ Please keep this vulnerability report private until we've published
+ an advisory to ``security-announce@python.org``.
+
+**Advisory email:**
+
+::
+
+ Title: [{CVE-YYYY-XXXX}] {title}
+
+ There is a {LOW, MEDIUM, HIGH, CRITICAL} severity vulnerability
+ affecting {project}.
+
+ {description}
+
+ Please see the linked CVE ID for the latest information on
+ affected versions:
+
+ * https://www.cve.org/CVERecord?id={CVE-YYYY-XXXX}
+ * {pull request URL}
diff --git a/developer-workflow/stdlib.rst b/developer-workflow/stdlib.rst
index ae0f7208e..60112d6d3 100644
--- a/developer-workflow/stdlib.rst
+++ b/developer-workflow/stdlib.rst
@@ -30,13 +30,10 @@ You have a several options for this:
* Open a new thread in the `Ideas Discourse category`_
to gather feedback directly from the Python core developers and community.
* Write a blog post about the code, which may also help gather useful feedback.
-* Post it to the `Python Cookbook`_.
- Based on feedback and reviews of the recipe,
- you can see if others find the functionality as useful as you do.
If you have found general acceptance and usefulness for your code from people,
you can open an issue on the `issue tracker`_ with the code attached as a
-:ref:`pull request `. If possible, also submit a
+:ref:`pull request `. If possible, also submit a
:ref:`contributor agreement `.
If a core developer decides that your code would be useful to the general
@@ -47,7 +44,6 @@ for it you at least can know that others will come across it who may find it
useful.
.. _Ideas Discourse category: https://discuss.python.org/c/ideas/6
-.. _Python Cookbook: https://code.activestate.com/recipes/langs/python/
Adding a new module
@@ -91,7 +87,7 @@ In order for a module to even be considered for inclusion into the stdlib, a
couple of requirements must be met.
The most basic is that the code must meet
-:ref:`standard patch requirements `. For code that has
+:ref:`standard pull request requirements `. For code that has
been developed outside the stdlib typically this means making sure the coding
style guides are followed and that the proper tests have been written.
@@ -108,11 +104,11 @@ year, a module needs to have established itself as (one of) the top choices by
the community for solving the problem the module is intended for.
The development of the module must move into Python's
-infrastructure (i.e., the module is no longer directly maintained outside of
+infrastructure (that is, the module is no longer directly maintained outside of
Python). This prevents a divergence between the code that is included in the
stdlib and that which is released outside the stdlib (typically done to provide
the module to older versions of Python). It also removes the burden of forcing
-core developers to have to redirect bug reports or patches to an external issue
+core developers to have to redirect bug reports or changes to an external issue
tracker and :abbr:`VCS (version control system)`.
Someone involved with the development of the
diff --git a/development-tools/clang.rst b/development-tools/clang.rst
index 14040dd8b..f06834731 100644
--- a/development-tools/clang.rst
+++ b/development-tools/clang.rst
@@ -7,9 +7,7 @@ Dynamic analysis with Clang
.. highlight:: bash
This document describes how to use Clang to perform analysis on Python and its
-libraries. In addition to performing the analysis, the document will cover
-downloading, building and installing the latest Clang/LLVM combination (which
-is currently 3.4).
+libraries.
This document does not cover interpreting the findings. For a discussion of
interpreting results, see Marshall Clow's `Testing libc++ with
@@ -17,6 +15,13 @@ interpreting results, see Marshall Clow's `Testing libc++ with
blog posting is a detailed examinations of issues uncovered by Clang in
``libc++``.
+The document focuses on Clang, although most techniques should generally apply
+to GCC's sanitizers as well.
+
+The instructions were tested on Linux, but they should work on macOS as well.
+Instructions for Windows are incomplete.
+
+
What is Clang?
==============
@@ -49,177 +54,95 @@ A complete list of sanitizers can be found at `Controlling Code Generation
Clang and its sanitizers have strengths (and weaknesses). Its just one tool in
the war chest to uncovering bugs and improving code quality. Clang should be
-used to compliment other methods, including Code Reviews, Valgrind, Coverity,
+used to complement other methods, including Code Reviews, `Valgrind`_,
etc.
Clang/LLVM setup
================
-This portion of the document covers downloading, building and installing Clang
-and LLVM. There are three components to download and build. They are the LLVM
-compiler, the compiler front end and the compiler runtime library.
-
-In preparation you should create a scratch directory. Also ensure you are using
-Python 2 and not Python 3. Python 3 will cause the build to fail.
-
-Download, build and install
----------------------------
-
-Perform the following to download, build and install the Clang/LLVM 3.4. ::
-
- # Download
- wget https://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
- wget https://llvm.org/releases/3.4/clang-3.4.src.tar.gz
- wget https://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz
-
- # LLVM
- tar xvf llvm-3.4.src.tar.gz
- cd llvm-3.4/tools
+Pre-built Clang builds are available for most platforms:
- # Clang Front End
- tar xvf ../../clang-3.4.src.tar.gz
- mv clang-3.4 clang
+- On macOS, Clang is the default compiler.
+- For mainstream Linux distros, you can install a ``clang`` package.
+ In some cases, you also need to install ``llvm`` separately, otherwise
+ some tools are not available.
+- On Windows, the installer for Visual Studio (not Code)
+ includes the "C++ clang tools for windows" feature.
- # Compiler RT
- cd ../projects
- tar xvf ../../compiler-rt-3.4.src.tar.gz
- mv compiler-rt-3.4/ compiler-rt
+You can also build ``clang`` from source; refer to
+`the clang documentation `_ for details.
- # Build
- cd ..
- ./configure --enable-optimized --prefix=/usr/local
- make -j4
- sudo make install
-
-.. note::
-
- If you receive an error ``'LibraryDependencies.inc' file not found``, then
- ensure you are utilizing Python 2 and not Python 3. If you encounter the
- error after switching to Python 2, then delete everything and start over.
-
-After ``make install`` executes, the compilers will be installed in
-``/usr/local/bin`` and the various libraries will be installed in
-``/usr/local/lib/clang/3.4/lib/linux/``:
-
-.. code-block:: console
+The installer does not install all the components needed on occasion. For
+example, you might want to run a ``scan-build`` or examine the results with
+``scan-view``. If this is your case, you can build Clang from source and
+copy tools from ``tools/clang/tools`` to a directory on your ``PATH``.
- $ ls /usr/local/lib/clang/3.4/lib/linux/
- libclang_rt.asan-x86_64.a libclang_rt.profile-x86_64.a
- libclang_rt.dfsan-x86_64.a libclang_rt.san-x86_64.a
- libclang_rt.full-x86_64.a libclang_rt.tsan-x86_64.a
- libclang_rt.lsan-x86_64.a libclang_rt.ubsan_cxx-x86_64.a
- libclang_rt.msan-x86_64.a libclang_rt.ubsan-x86_64.a
+Another reason to build from source is to get the latest version of Clang/LLVM,
+if your platform's channels don't provide it yet.
+Newer versions of Clang/LLVM introduce new sanitizer checks.
-On macOS, the libraries are installed in
-``/usr/local/lib/clang/3.3/lib/darwin/``:
-.. code-block:: console
+Python build setup
+==================
- $ ls /usr/local/lib/clang/3.3/lib/darwin/
- libclang_rt.10.4.a libclang_rt.ios.a
- libclang_rt.asan_osx.a libclang_rt.osx.a
- libclang_rt.asan_osx_dynamic.dylib libclang_rt.profile_ios.a
- libclang_rt.cc_kext.a libclang_rt.profile_osx.a
- libclang_rt.cc_kext_ios5.a libclang_rt.ubsan_osx.a
- libclang_rt.eprintf.a
+This portion of the document covers invoking Clang and LLVM with the options
+required so the sanitizers analyze Python with under its test suite.
-.. note::
+Set the compiler to Clang, in case it's not the default::
- You should never have to add the libraries to a project. Clang will handle
- it for you. If you find you cannot pass the ``-fsanitize=XXX`` flag through
- ``make``'s implicit variables (``CFLAGS``, ``CXXFLAGS``, ``CC``,
- ``CXXFLAGS``, ``LDFLAGS``) during ``configure``, then you should modify the
- makefile after configuring to ensure the flag is passed through the
- compiler.
+ export CC="clang"
-The installer does not install all the components needed on occasion. For
-example, you might want to run a ``scan-build`` or examine the results with
-``scan-view``. You can copy the components by hand with: ::
+If you want to use additional sanitizer options (found in Clang documentation),
+add them to the ``CFLAGS`` variable.
+For example, you may want the checked process to exit after the first failure::
- sudo mkdir /usr/local/bin/scan-build
- sudo cp -r llvm-3.4/tools/clang/tools/scan-build /usr/local/bin
- sudo mkdir /usr/local/bin/scan-view
- sudo cp -r llvm-3.4/tools/clang/tools/scan-view /usr/local/bin
+ export CFLAGS="-fno-sanitize-recover"
-.. note::
+Then, run ``./configure`` with the relevant flags:
- Because the installer does not install all the components needed on
- occasion, you should not delete the scratch directory until you are sure
- things work as expected. If a library is missing, then you should search for
- it in the Clang/LLVM build directory.
+* ASan: ``--with-address-sanitizer --without-pymalloc``
+* UBsan: ``--with-undefined-behavior-sanitizer``
-Python build setup
-==================
+It is OK to specify both sanitizers.
-This portion of the document covers invoking Clang and LLVM with the options
-required so the sanitizers analyze Python with under its test suite. Two
-checkers are used - ASan and UBSan.
+After that, run ``make`` and ``make test`` as usual.
+Note that ``make`` itself may fail with a sanitizer failure,
+since the just-compiled Python runs during later stages of the build.
-Because the sanitizers are runtime checkers, its best to have as many positive
-and negative self tests as possible. You can never have enough self tests.
-The general idea is to compile and link with the sanitizer flags. At link time,
-Clang will include the needed runtime libraries. However, you can't use
-``CFLAGS`` and ``CXXFLAGS`` to pass the options through the compiler to the
-linker because the makefile rules for ``BUILDPYTHON``, ``_testembed`` and
-``_freeze_importlib`` don't use the implicit variables.
+Build setup for enabling sanitizers for all code
+------------------------------------------------
-As a workaround to the absence of flags to the linker, you can pass the
-sanitizer options by way of the compilers - ``CC`` and ``CXX``. Passing the
-flags though the compiler is used below, but passing them through ``LDFLAGS`` is
-also reported to work.
+Some parts of Python (for example, ``_testembed``, ``_freeze_importlib``,
+``test_cppext``) may not use the variables set by ``configure``,
+and with the above settings they'll be compiled without sanitization.
-Building Python
----------------
+As a workaround, you can pass the sanitizer options by way of the *compilers*,
+``CC`` (for C) and ``CXX`` (for C++). This is used below.
+Passing the options through ``LDFLAGS`` is also reported to work.
-To begin, export the variables of interest with the desired sanitizers. Its OK
-to specify both sanitizers: ::
+For ASan, use::
# ASan
- export CC="/usr/local/bin/clang -fsanitize=address"
- export CXX="/usr/local/bin/clang++ -fsanitize=address -fno-sanitize=vptr"
+ export CC="clang -fsanitize=address"
+ export CXX="clang++ -fsanitize=address -fno-sanitize=vptr"
-Or: ::
+And for UBSan::
# UBSan
- export CC="/usr/local/bin/clang -fsanitize=undefined"
- export CXX="/usr/local/bin/clang++ -fsanitize=undefined -fno-sanitize=vptr"
-
-The ``-fno-sanitize=vptr`` removes vtable checks that are part of UBSan from C++
-projects due to noise. Its not needed with Python, but you will likely need it
-for other C++ projects.
-
-After exporting ``CC`` and ``CXX``, ``configure`` as normal:
-
-.. code-block:: console
-
- $ ./configure
- checking build system type... x86_64-unknown-linux-gnu
- checking host system type... x86_64-unknown-linux-gnu
- checking for --enable-universalsdk... no
- checking for --with-universal-archs... 32-bit
- checking MACHDEP... linux
- checking for --without-gcc... no
- checking for gcc... /usr/local/bin/clang -fsanitize=undefined
- checking whether the C compiler works... yes
- ...
+ export CC="clang -fsanitize=undefined"
+ export CXX="clang++ -fsanitize=undefined -fno-sanitize=vptr"
-Next is a standard ``make`` (formatting added for clarity):
+It's OK to specify both sanitizers.
-.. code-block:: console
+After this, run ``./configure``, ``make`` and ``make test`` as usual.
- $ make
- /usr/local/bin/clang -fsanitize=undefined -c -Wno-unused-result
- -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I.
- -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o
- ./Modules/python.c
- /usr/local/bin/clang -fsanitize=undefined -c -Wno-unused-result
- -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I.
- -IInclude -I./Include -DPy_BUILD_CORE -o Parser/acceler.o
- Parser/acceler.c
- ...
-Finally is ``make test`` (formatting added for clarity):
+Analyzing the output
+====================
+
+Sanitizer failures will make the process fail and output a diagnostic,
+for example:
.. code-block:: none
@@ -233,8 +156,12 @@ Finally is ``make test`` (formatting added for clarity):
^
...
-If you are using the address sanitizer, its important to pipe the output through
-``asan_symbolize.py`` to get a good trace. For example, from Issue 20953 during
+If you are using the address sanitizer, an additional tool is needed to
+get good traces. Usually, this happens automatically through the
+``llvm-symbolizer`` tool. If this tool is not installed on your ``PATH``,
+you can set ``ASAN_SYMBOLIZER_PATH`` to the location of the tool,
+or pipe test output through ``asan_symbolize.py`` script from the
+Clang distribution. For example, from Issue 20953 during
compile (formatting added for clarity):
.. code-block:: none
@@ -302,25 +229,25 @@ compile (formatting added for clarity):
.. note::
- ``asan_symbolize.py`` is supposed to be installed during ``make install``.
- If its not installed, then look in the Clang/LLVM build directory for it and
- copy it to ``/usr/local/bin``.
+ If ``asan_symbolize.py`` is not installed, build Clang from source, then
+ look in the Clang/LLVM build directory for it and use it directly or copy
+ it to a directory on ``PATH``.
-Blacklisting (ignoring) findings
---------------------------------
+Ignoring findings
+-----------------
.. highlight:: none
Clang allows you to alter the behavior of sanitizer tools for certain
-source-level by providing a special blacklist file at compile-time. The
-blacklist is needed because it reports every instance of an issue, even if the
+source-level by providing a special ignorelist file at compile-time. The
+ignorelist is needed because it reports every instance of an issue, even if the
issue is reported 10's of thousands of time in un-managed library code.
-You specify the blacklist with ``-fsanitize-blacklist=XXX``. For example::
+You specify the ignorelist with ``-fsanitize-ignorelist=XXX``. For example::
- -fsanitize-blacklist=my_blacklist.txt
+ -fsanitize-ignorelist=my_ignorelist.txt
-``my_blacklist.txt`` would then contain entries such as the following. The entry
+``my_ignorelist.txt`` would then contain entries such as the following. The entry
will ignore a bug in ``libc++``'s ``ios`` formatting functions::
fun:_Ios_Fmtflags
@@ -342,7 +269,7 @@ findings::
...
One of the function of interest is ``audioop_getsample_impl`` (flagged at line
-422), and the blacklist entry would include::
+422), and the ignorelist entry would include::
fun:audioop_getsample_imp
@@ -350,7 +277,9 @@ Or, you could ignore the entire file with::
src:Modules/audioop.c
-Unfortunately, you won't know what to blacklist until you run the sanitizer.
+Unfortunately, you won't know what to ignorelist until you run the sanitizer.
The documentation is available at `Sanitizer special case list
`_.
+
+.. _Valgrind: https://github.com/python/cpython/blob/main/Misc/README.valgrind
diff --git a/development-tools/clinic.rst b/development-tools/clinic.rst
index 910de404a..642f40dce 100644
--- a/development-tools/clinic.rst
+++ b/development-tools/clinic.rst
@@ -213,7 +213,7 @@ Classes for extending Argument Clinic
The C type to use for this variable.
:attr:`!type` should be a Python string specifying the type,
- e.g. ``'int'``.
+ for example, ``'int'``.
If this is a pointer type, the type string should end with ``' *'``.
.. attribute:: default
diff --git a/development-tools/coverity.rst b/development-tools/coverity.rst
deleted file mode 100644
index 7c165a312..000000000
--- a/development-tools/coverity.rst
+++ /dev/null
@@ -1,141 +0,0 @@
-.. _coverity:
-
-=============
-Coverity Scan
-=============
-
-Coverity Scan is a free service for static code analysis of Open Source
-projects. It is based on Coverity's commercial product and is able to analyze
-C, C++ and Java code.
-
-Coverity's static code analysis doesn't run the code. Instead of that it uses
-abstract interpretation to gain information about the code's control flow and
-data flow. It's able to follow all possible code paths that a program may
-take. For example the analyzer understands that ``malloc()`` returns a memory
-that must be freed with ``free()`` later. It follows all branches and function
-calls to see if all possible combinations free the memory. The analyzer is
-able to detect all sorts of issues like resource leaks (memory, file
-descriptors), NULL dereferencing, use after free, unchecked return values,
-dead code, buffer overflows, integer overflows, uninitialized variables, and
-many more.
-
-
-Access to analysis reports
-==========================
-
-The results are available on the `Coverity Scan`_ website. In order to
-access the results you have to create an account yourself. Then go to
-*Projects using Scan* and add yourself to the Python project. New members must
-be approved by an admin (see `Contact`_).
-
-Access is restricted to Python core developers only. Other individuals may be
-given access at our own discretion, too. Every now and then Coverity detects a
-critical issue in Python's code -- new analyzers may even find new bugs in
-mature code. We don't want to disclose issues prematurely.
-
-
-Building and uploading analysis
-===============================
-
-The process is automated. A script checks out the code, runs
-``cov-build`` and uploads the latest analysis to Coverity. Since Coverity has
-limited the maximum number of builds per week Python is analyzed every second
-day. The build runs on a dedicated virtual machine on PSF's infrastructure at
-OSU Open Source Labs. The process is maintained by Christian Heimes (see
-`Contact`_). At present only the tip is analyzed with the 64bit Linux tools.
-
-
-Known limitations
-=================
-
-Some aspects of Python's C code are not yet understood by Coverity.
-
-False positives
----------------
-
-``Py_BuildValue("N", PyObject*)``
- Coverity doesn't understand that ``N`` format char passes the object along
- without touching its reference count. On this ground the analyzer detects
- a resource leak. CID 719685
-
-``PyLong_FromLong()`` for negative values
- Coverity claims that ``PyLong_FromLong()`` and other ``PyLong_From*()``
- functions cannot handle a negative value because the value might be used as
- an array index in ``get_small_int()``. CID 486783
-
-``PyLong_FromLong()`` for n in [-5 ... +255]
- For integers in the range of Python's small int cache the ``PyLong_From*()``
- function can never fail and never returns NULL. CID 1058291
-
-``PyArg_ParseTupleAndKeywords(args, kwargs, "s#", &data, &length)``
- Some functions use the format char combination such as ``s#``, ``u#`` or
- ``z#`` to get data and length of a character array. Coverity doesn't
- recognize the relation between data and length. Sometimes it detects a buffer
- overflow if data is written to a fixed size buffer although
- ``length <= sizeof(buffer)``. CID 486613
-
-``path_converter()`` dereferencing after null check
- The ``path_converter()`` function in ``posixmodule.c`` makes sure that
- either ``path_t.narrow`` or ``path_t.wide`` is filled unless
- ``path_t.nullable`` is explicitly enabled. CID 719648
-
-
-Modeling
-========
-
-Modeling is explained in the *Coverity Help Center* which is available in
-the help menu of `Coverity Connect`_. `coverity_model.c`_ contains a copy of
-Python's modeling file for Coverity. Please keep the copy in sync with the
-model file in *Analysis Settings* of `Coverity Scan`_.
-
-
-Workflow
-========
-
-False positive and intentional issues
--------------------------------------
-
-If the problem is listed under `Known limitations`_ then please set the
-classification to either "False positive" or "Intentional", the action to
-"Ignore", owner to your own account and add a comment why the issue
-is considered false positive or intentional.
-
-If you think it's a new false positive or intentional then please contact an
-admin. The first step should be an updated to Python's `Modeling`_ file.
-
-
-Positive issues
----------------
-
-You should always create an issue unless it's really a trivial case. Please
-add the full url to the ticket under *Ext. Reference* and add the CID
-(Coverity ID) to both the ticket and the checkin message. It makes it much
-easier to understand the relation between tickets, fixes and Coverity issues.
-
-
-Contact
-=======
-
-Please include both Brett and Christian in any mail regarding Coverity. Mails
-to Coverity should go through Brett or Christian, too.
-
-Christian Heimes
- admin, maintainer of build machine, intermediary between Python and Coverity
-
-Brett Cannon
- co-admin
-
-Dakshesh Vyas
- Technical Manager - Coverity Scan
-
-
-.. seealso::
-
- `Coverity Scan FAQ `_
-
-
-.. _Coverity Scan: https://scan.coverity.com/
-
-.. _Coverity Connect: https://scan.coverity.com/projects/python
-
-.. _coverity_model.c: https://github.com/python/cpython/blob/main/Misc/coverity_model.c
diff --git a/development-tools/gdb.rst b/development-tools/gdb.rst
index e85e826a0..8f89ea136 100644
--- a/development-tools/gdb.rst
+++ b/development-tools/gdb.rst
@@ -33,7 +33,7 @@ Fortunately, among the `many ways to set breakpoints
you can break at C labels, such as those generated for computed gotos.
If you are debugging an interpreter compiled with computed goto support
(generally true, certainly when using GCC), each instruction will be
-prefaced with a label named ``TARGET_``, e.g.,
+prefaced with a label named ``TARGET_``, for example,
``TARGET_LOAD_CONST``. You can then set a breakpoint with a command
like::
diff --git a/development-tools/index.rst b/development-tools/index.rst
index d7b88bf6d..5031227a1 100644
--- a/development-tools/index.rst
+++ b/development-tools/index.rst
@@ -1,3 +1,5 @@
+.. _development-tools:
+
=================
Development tools
=================
@@ -8,4 +10,4 @@ Development tools
clinic
gdb
clang
- coverity
+ warnings
diff --git a/development-tools/warnings.rst b/development-tools/warnings.rst
new file mode 100644
index 000000000..b6448f397
--- /dev/null
+++ b/development-tools/warnings.rst
@@ -0,0 +1,66 @@
+.. warnings:
+
+Tools for tracking compiler warnings
+====================================
+
+.. highlight:: bash
+
+The compiler warning tracking tooling is intended to alert developers about new
+compiler warnings introduced by their contributions. The tooling consists of
+a Python script which is ran by the following GitHub workflows:
+
+* Ubuntu/build and test (:cpy-file:`.github/workflows/reusable-ubuntu.yml`)
+* macOS/build and test (:cpy-file:`.github/workflows/reusable-macos.yml`)
+
+You can check the documentation for the :cpy-file:`Tools/build/check_warnings.py` tool
+by running::
+
+ python Tools/build/check_warnings.py --help
+
+The script can be run locally by providing the compiler output file
+(where the output is saved) and the compiler output type
+(either ``gcc`` or ``clang``) to see a list of unique warnings::
+
+ python Tools/build/check_warnings.py --compiler-output-file-path=compiler_output.txt --compiler-output-type=gcc
+
+.. _warning-check-failure:
+
+What to do if a warning check fails GitHub CI
+---------------------------------------------
+
+The :cpy-file:`Tools/build/check_warnings.py` tool will fail if the compiler generates
+more or less warnings than expected for a given source file as defined in the
+platform-specific warning ignore file. The warning ignore file is either
+:cpy-file:`Tools/build/.warningignore_ubuntu` or
+:cpy-file:`Tools/build/.warningignore_macos` depending on the platform.
+
+If a warning check fails with:
+
+* Unexpected warnings
+ * Attempt to refactor the code to avoid the warning.
+ * If it is not possible to avoid the warning document in the PR why it is
+ reasonable to ignore and add the warning to the platform-specific
+ warning ignore file. If the file exists in the warning ignore file
+ increment the count by the number of newly introduced warnings.
+* Unexpected improvements (less warnings)
+ * Document in the PR that the change reduces the number of compiler
+ warnings. Decrement the count in the platform-specific warning
+ ignore file or remove the file if the count is now zero.
+
+.. _updating-warning-ignore-file:
+
+Updating the warning ignore file
+--------------------------------
+
+The warning ignore files can be found in the :cpy-file:`Tools/build/` directory.
+Both files and directories can be added to the ignore file. Files can have an explicit warning count or a wildcard count.
+Directories must be followed by a wildcard count. Wildcards indicate that 0 or more warnings will be ignored.
+The following is an example of the warning ignore file format::
+
+ Modules/_ctypes/_ctypes_test_generated.c.h *
+ Objects/longobject.c 46
+ Objects/methodobject.c 1
+ Objects/mimalloc/ *
+
+Using wildcards is reserved for code that is not maintained by CPython, or code that is for tests.
+Keep lines in warning ignore files sorted lexicographically.
diff --git a/documentation/devguide.rst b/documentation/devguide.rst
index a17ed342a..7c53d054e 100644
--- a/documentation/devguide.rst
+++ b/documentation/devguide.rst
@@ -19,10 +19,12 @@ main Python documentation, except for some small differences. The source
lives in a `separate repository`_ and bug reports should be submitted to the
`devguide GitHub tracker`_.
-Our devguide workflow uses continuous integration and deployment so changes to
-the devguide are normally published when the pull request is merged. Changes
-to CPython documentation follow the workflow of a CPython release and are
-published in the release.
+Changes to the Developer's Guide are published when pull requests are merged.
+
+Changes to the Python documentation are published regularly,
+ususally within 48 hours of the change being committed.
+The documentation is also `published for each release `_,
+which may also be used by redistributors.
Developer's Guide workflow
diff --git a/documentation/help-documenting.rst b/documentation/help-documenting.rst
index 06e44549c..0b287df92 100644
--- a/documentation/help-documenting.rst
+++ b/documentation/help-documenting.rst
@@ -74,7 +74,7 @@ Proofreading
While an issue filed on the `issue tracker`_ means there is a known issue
somewhere, that does not mean there are not other issues lurking about in the
documentation. Proofreading a part of the documentation, such as a "How to" or
-OS specific document, can often uncover problems (e.g., documentation that
+OS specific document, can often uncover problems (for example, documentation that
needs updating for Python 3).
If you decide to proofread, read a section of the documentation from start
diff --git a/documentation/index.rst b/documentation/index.rst
index 3f2512bcf..eaa9e1a96 100644
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -9,5 +9,5 @@ Documentation
help-documenting
style-guide
markup
- translating
+ translations/index
devguide
diff --git a/documentation/markup.rst b/documentation/markup.rst
index b72e1a952..ce9ba648d 100644
--- a/documentation/markup.rst
+++ b/documentation/markup.rst
@@ -22,8 +22,8 @@ Element Markup See also
arguments/parameters ``*arg*`` :ref:`inline-markup`
variables/literals/code ````foo````, ````42````, ````len(s) - 1```` :ref:`inline-markup`
True/False/None ````True````, ````False````, ````None```` :ref:`inline-markup`
-functions definitions ``.. function:: print(*args)`` :ref:`directives`
-functions references ``:func:`print``` :ref:`roles`
+function definitions ``.. function:: print(*args)`` :ref:`directives`
+function references ``:func:`print``` :ref:`roles`
attribute definitions ``.. attribute: `attr-name``` :ref:`information-units`
attribute references ``:attr:`attr-name``` :ref:`roles`
reference labels ``.. _label-name:`` :ref:`doc-ref-role`
@@ -385,7 +385,7 @@ As you can see, the module-specific markup consists of two directives, the
.. describe:: module
This directive marks the beginning of the description of a module, package,
- or submodule. The name should be fully qualified (i.e. including the
+ or submodule. The name should be fully qualified (that is, including the
package name for submodules).
The ``platform`` option, if present, is a comma-separated list of the
@@ -443,7 +443,7 @@ The directives are:
.. describe:: c:function
- Describes a C function. The signature should be given as in C, e.g.::
+ Describes a C function. The signature should be given as in C, for example::
.. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
@@ -683,7 +683,7 @@ Syntax highlighting is handled in a smart way:
encountered.
* The ``code-block`` directive can be used to specify the highlight language
- of a single code block, e.g.::
+ of a single code block, for example::
.. code-block:: c
@@ -759,7 +759,7 @@ versatile:
``:meth:`~Queue.Queue.get``` will refer to ``Queue.Queue.get`` but only
display ``get`` as the link text.
- In HTML output, the link's ``title`` attribute (that is e.g. shown as a
+ In HTML output, the link's ``title`` attribute (that might be shown as a
tool-tip on mouse-hover) will always be the full target name.
* Combining ``~`` and ``!`` (for example, ``:meth:`~!Queue.Queue.get```) is not
@@ -949,7 +949,7 @@ in a different style:
.. describe:: manpage
A reference to a Unix manual page including the section,
- e.g. ``:manpage:`ls(1)```.
+ for example, ``:manpage:`ls(1)```.
.. describe:: menuselection
@@ -1083,8 +1083,11 @@ units as well as normal text:
(``class``, ``attribute``, ``function``, ``method``, ``c:type``, etc),
a ``versionadded`` should be included at the end of its description block.
- The first argument must be given and is the version in question. The second
- argument is optional and can be used to describe the details of the feature.
+ The first argument must be given and is the version in question.
+ Instead of a specific version number, you can---and should---use
+ the word ``next``, indicating that the API will first appear in the
+ upcoming release.
+ The second argument is optional and can be used to describe the details of the feature.
Example::
@@ -1092,7 +1095,26 @@ units as well as normal text:
Return foo and bar.
- .. versionadded:: 3.5
+ .. versionadded:: next
+
+ When a release is made, the release manager will change the ``next`` to
+ the just-released version. For example, if ``func`` in the above example is
+ released in 3.14, the snippet will be changed to::
+
+ .. function:: func()
+
+ Return foo and bar.
+
+ .. versionadded:: 3.14
+
+ The tool to do this replacement is `update_version_next.py`_
+ in the release-tools repository.
+
+ .. _update_version_next.py: https://github.com/python/release-tools/blob/master/update_version_next.py
+
+ When adding documentation for a function that existed in a past version,
+ but wasn't documented yet, use the version number where the function was
+ added instead of ``next``.
.. describe:: versionchanged
@@ -1106,7 +1128,7 @@ units as well as normal text:
Return foo and bar, optionally with *spam* applied.
- .. versionchanged:: 3.6
+ .. versionchanged:: next
Added the *spam* parameter.
Note that there should be no blank line between the directive head and the
@@ -1118,10 +1140,12 @@ units as well as normal text:
There is one required argument: the version from which the feature is
deprecated.
+ Similarly to ``versionadded``, you should use the word ``next`` to indicate
+ the API will be first deprecated in the upcoming release.
Example::
- .. deprecated:: 3.8
+ .. deprecated:: next
.. describe:: deprecated-removed
@@ -1129,16 +1153,17 @@ units as well as normal text:
removed.
There are two required arguments: the version from which the feature is
- deprecated, and the version in which the feature is removed.
+ deprecated (usually ``next``), and the version in which the feature
+ is removed, which must be a specific version number (*not* ``next``).
Example::
- .. deprecated-removed:: 3.8 4.0
+ .. deprecated-removed:: next 4.0
.. describe:: impl-detail
This directive is used to mark CPython-specific information. Use either with
- a block content or a single sentence as an argument, i.e. either ::
+ a block content or a single sentence as an argument, that is, either ::
.. impl-detail::
@@ -1190,6 +1215,9 @@ units as well as normal text:
Table-of-contents markup
------------------------
+.. TODO: This is a copy of the Sphinx description of the toctree directive.
+ Why duplicate it here?
+
Since reST does not have facilities to interconnect several documents, or split
documents into multiple output files, Sphinx uses a custom directive to add
relations between the single files the documentation is made of, as well as
@@ -1304,7 +1332,7 @@ the definition of the symbol. There is this directive:
Blank lines are not allowed within ``productionlist`` directive arguments.
The definition can contain token names which are marked as interpreted text
- (e.g. ``unaryneg ::= "-" `integer```) -- this generates cross-references
+ (for example, ``unaryneg ::= "-" `integer```) -- this generates cross-references
to the productions of these tokens.
Note that no further reST parsing is done in the production, so that you
@@ -1334,12 +1362,12 @@ default. They are set in the build configuration file :file:`conf.py`.
.. describe:: |release|
Replaced by the Python release the documentation refers to. This is the full
- version string including alpha/beta/release candidate tags, e.g. ``2.5.2b3``.
+ version string including alpha/beta/release candidate tags, for example, ``2.5.2b3``.
.. describe:: |version|
Replaced by the Python version the documentation refers to. This consists
- only of the major and minor version parts, e.g. ``2.5``, even for version
+ only of the major and minor version parts, for example, ``2.5``, even for version
2.5.1.
.. describe:: |today|
diff --git a/documentation/start-documenting.rst b/documentation/start-documenting.rst
index 184cf54bf..973b36b12 100644
--- a/documentation/start-documenting.rst
+++ b/documentation/start-documenting.rst
@@ -153,6 +153,25 @@ To build the docs as HTML, run:
start a local server, and automatically reload the page in your
browser when you make changes to reST files (Unix only).
+It is also possible to build only certain pages of the documentation in order
+to save time during the build process. Following is an example for building two
+pages:
+
+.. tab:: Unix/macOS
+
+ .. code-block:: shell
+
+ make html SOURCES="tutorial/classes.rst tutorial/inputoutput.rst"
+
+.. tab:: Windows
+
+ See :ref:`using-sphinx-build`. When invoking ``sphinx-build``, pass the
+ desired pages as the final parameter, like so:
+
+ .. code-block:: dosbatch
+
+ python -m sphinx -b html . build/html tutorial/classes.rst tutorial/inputoutput.rst
+
To check the docs for common errors with `Sphinx Lint`_
(which is run on all :ref:`pull requests `), use:
diff --git a/documentation/style-guide.rst b/documentation/style-guide.rst
index 1e94e518d..49bd15b1d 100644
--- a/documentation/style-guide.rst
+++ b/documentation/style-guide.rst
@@ -26,6 +26,7 @@ the footnote reference.
Footnotes may appear in the middle of sentences where appropriate.
+
Capitalization
==============
@@ -54,10 +55,15 @@ starting it with a lowercase letter should be avoided.
Many special names are used in the Python documentation, including the names of
operating systems, programming languages, standards bodies, and the like. Most
of these entities are not assigned any special markup, but the preferred
-spellings are given here to aid authors in maintaining the consistency of
-presentation in the Python documentation.
+spellings are given in :ref:`specific words` to aid authors in maintaining the
+consistency of presentation in the Python documentation.
+
+.. _specific words:
+
+Specific words
+==============
-Other terms and words deserve special mention as well; these conventions should
+Some terms and words deserve special mention. These conventions should
be used to ensure consistency throughout the documentation:
C API
@@ -79,6 +85,12 @@ reST
used to produce Python documentation. When spelled out, it is
always one word and both forms start with a lowercase 'r'.
+time zone
+ When referring to a Python term like a module, class, or argument spell it
+ as one word with appropriate markup (for example, ``:mod:`timezone```).
+ When talking about the real-world concept spell it as two words with no
+ markup.
+
Unicode
The name of a character coding system. This is always written
capitalized.
@@ -88,7 +100,18 @@ Unix
1970s.
+Use simple language
+===================
+
+Avoid esoteric phrasing where possible. Our audience is world-wide and may not
+be native English speakers.
+
+Don't use Latin abbreviations like "e.g." or "i.e." where English words will do,
+such as "for example" or "that is."
+
+
.. index:: diataxis
+.. _diataxis:
DiΓ‘taxis
========
@@ -110,7 +133,7 @@ explanation.
designed to guide a user through a problem-field.
Both tutorials and how-to guides are instructional rather than explanatory
and should provide logical steps on how to complete a task. However,
- how-to guides make more assumptions about the user's knoweldge and
+ how-to guides make more assumptions about the user's knowledge and
focus on the user finding the best way to solve their own
particular problem.
@@ -132,6 +155,7 @@ explanation.
Please consult the `DiΓ‘taxis `_ guide for more
detail.
+
Links
=====
@@ -160,6 +184,7 @@ documentation for ``map``. You can suppress the link while keeping the
semantic presentation of the function name by adding an exclamation point
prefix: ``:func:`!map```. See :ref:`roles` for more details.
+
Affirmative tone
================
@@ -185,6 +210,29 @@ language):
achieve the same effect. This assures that files are flushed and file
descriptor resources are released in a timely manner.
+
+Author attribution
+==================
+
+For new documentation, do not use a byline (naming the author of the document).
+Explicit attribution tends to discourage other users from updating community
+documentation.
+
+Existing documentation with bylines will not be changed unless the author
+decides to do so. This is subject to change in the future.
+
+
+Pronunciation of dunder names
+=============================
+
+"Dunder names" like ``__init__`` can be awkward in running prose: is it "an
+init" or "a dunder init"? Our recommendation is to ignore the underscores and
+use the article that is appropriate for the word in the name. A `quick poll`__
+backs this up: "an __init__."
+
+__ https://hachyderm.io/@nedbat/112129685322594689
+
+
Economy of expression
=====================
@@ -196,12 +244,13 @@ to understanding and can result in even more ways to misread or misinterpret the
text. Long descriptions full of corner cases and caveats can create the
impression that a function is more complex or harder to use than it actually is.
+
Security considerations (and other concerns)
============================================
Some modules provided with Python are inherently exposed to security issues
-(e.g. shell injection vulnerabilities) due to the purpose of the module
-(e.g. :mod:`ssl`). Littering the documentation of these modules with red
+(for example, shell injection vulnerabilities) due to the purpose of the module
+(for example, :mod:`ssl`). Littering the documentation of these modules with red
warning boxes for problems that are due to the task at hand, rather than
specifically to Python's support for that task, doesn't make for a good
reading experience.
@@ -213,10 +262,11 @@ similar to :samp:`"Please refer to the :ref:\`{security-considerations}\`
section for important information on how to avoid common mistakes."`.
Similarly, if there is a common error that affects many interfaces in a
-module (e.g. OS level pipe buffers filling up and stalling child processes),
+module (for example, OS level pipe buffers filling up and stalling child processes),
these can be documented in a "Common Errors" section and cross-referenced
rather than repeated for every affected interface.
+
.. _code-examples:
Code examples
@@ -237,6 +287,7 @@ lines and output lines. Besides contributing visual clutter, it makes it
difficult for readers to cut-and-paste examples so they can experiment with
variations.
+
Code equivalents
================
@@ -261,6 +312,7 @@ An example of when not to use a code equivalent is for the :func:`oct` function.
The exact steps in converting a number to octal doesn't add value for a user
trying to learn what the function does.
+
Audience
========
@@ -281,3 +333,19 @@ errors ("I made a mistake, therefore the docs must be wrong ..."). Typically,
the documentation wasn't consulted until after the error was made. It is
unfortunate, but typically no documentation edit would have saved the user from
making false assumptions about the language ("I was surprised by ...").
+
+
+Function signatures
+===================
+
+These are the evolving guidelines for how to include function signatures in the
+reference guide. As outlined in :ref:`diataxis`, reference material should
+prioritize precision and completeness.
+
+- If a function accepts positional-only or keyword-only arguments, include the
+ slash and the star in the signature as appropriate::
+
+ .. function:: some_function(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):
+
+ Although the syntax is terse, it is precise about the allowable ways to call
+ the function and is taken from Python itself.
diff --git a/documentation/translating.rst b/documentation/translating.rst
deleted file mode 100644
index 9d21bca0e..000000000
--- a/documentation/translating.rst
+++ /dev/null
@@ -1,233 +0,0 @@
-.. _translating:
-
-===========
-Translating
-===========
-
-.. highlight:: rest
-
-Python documentation translations are governed by :PEP:`545`.
-They are built by `docsbuild-scripts
- `__ and hosted on
-docs.python.org. There are several documentation translations already
-in production; others are works in progress.
-
-.. list-table::
- :header-rows: 1
-
- * - Language
- - Contact
- - Links
- * - Arabic (ar)
- - Abdur-Rahmaan Janhangeer (:github-user:`Abdur-rahmaanJ`)
- - :github:`GitHub `
- * - Bengali as spoken in India (bn_IN)
- - Kushal Das (:github-user:`Kushal997-das`)
- - :github:`GitHub `
- * - `French (fr) `__
- - Julien Palard (:github-user:`JulienPalard`)
- - :github:`GitHub `
- * - Greek (gr)
- - Lysandros Nikolaou (:github-user:`lysnikolaou`),
- Fanis Petkos (:github-user:`thepetk`)
- - :github:`GitHub `
- * - Hindi as spoken in India (hi_IN)
- - Sanyam Khurana (:github-user:`CuriousLearner`)
- - :github:`GitHub `
- * - Hungarian (hu)
- - TamΓ‘s Bajusz (:github-user:`gbtami`)
- - :github:`GitHub `,
- `mailing list `__
- * - `Indonesian (id) `__
- - Oon Arfiandwi (:github-user:`oonid`)
- - :github:`GitHub `
- * - Italian (it)
- - Alessandro Cucci (`email `__)
- - `Original mail `__
- * - `Japanese (ja) `__
- - Kinebuchi Tomohiko (:github-user:`cocoatomo`),
- Atsuo Ishimoto (:github-user:`atsuoishimoto`)
- - :github:`GitHub `
- * - `Korean (ko) `__
- - μ€λκΆ (:github-user:`flowdas`)
- - :github:`GitHub `
- * - Marathi (mr)
- - Sanket Garade (:github-user:`sanketgarade`, `email `__)
- - :github:`GitHub `
- * - Lithuanian (lt)
- - Albertas Gimbutas (:github-user:`albertas`, `email `__)
- - `Original mail `__
- * - Persian (fa)
- - Komeil Parseh (:github-user:`mmdbalkhi`)
- - :github:`GitHub `
- * - `Polish (pl) `__
- - Maciej Olko (:github-user:`m-aciek`)
- - :github:`GitHub `,
- `Transifex `_,
- `original mail `__
- * - Portuguese (pt)
- - Gustavo Toffo
- -
- * - `Portuguese as spoken in Brasil (pt-br) `__
- - Marco Rougeth
- - :github:`GitHub `,
- `wiki `__,
- `Telegram `__,
- `article `__
- * - Russian (ru)
- - Daniil Kolesnikov (:github-user:`MLGRussianXP`, `email `__)
- - :github:`GitHub `,
- `mail `__
- * - `Simplified Chinese (zh-cn) `__
- - Shengjing Zhu (:github-user:`zhsj`),
- Du, Meng (:github-user:`dumeng`)
- - :github:`GitHub `,
- `Transifex `_
- * - `Spanish (es) `__
- - RaΓΊl Cumplido
- - :github:`GitHub `
- * - `Traditional Chinese (zh-tw) `__
- - ηε¨ηΏ Matt Wang (:github-user:`mattwang44`),
- Josix Wang
- - :github:`GitHub `
- * - `Turkish (tr) `__
- - Ege Akman (:github-user:`egeakman`)
- - :github:`GitHub `,
- `RTD `__
- * - `Ukrainian (uk) `__
- - Dmytro Kazanzhy (:github-user:`kazanzhy`, `email `__)
- - :github:`GitHub `,
- `Transifex `_
-
-.. _tx: https://explore.transifex.com/python-doc/python-newest/
-
-Starting a new translation
-==========================
-
-First subscribe to the `translation mailing list `_,
-and introduce yourself and the translation you're starting. Translations
-fall under the aegis of the `PSF Translation Workgroup `_
-
-Then you can bootstrap your new translation by using our `cookiecutter
-`__.
-
-The important steps look like this:
-
-- Create the GitHub repo (anywhere) with the right hierarchy (using the
- cookiecutter).
-- Gather people to help you translate. You can't do it alone.
-- You can use any tool to translate, as long as you can synchronize with Git.
- Some use Transifex, and some use only GitHub. You can choose another
- way if you like; it's up to you.
-- Ensure we update this page to reflect your work and progress, either via a
- PR or by asking on the `translation mailing list `_.
-- When ``bugs.html``, ``tutorial``, and ``library/functions`` are 100%
- completed, ask on the `translation mailing list `_ for
- your language to be added in the language picker on docs.python.org.
-
-
-PEP 545 summary
-===============
-
-Here are the essential points of :PEP:`545`:
-
-- Each translation is assigned an appropriate lowercased language tag,
- with an optional region subtag, and joined with a dash, like
- ``pt-br`` or ``fr``.
-
-- Each translation is under CC0 and marked as such in the README (as in
- the cookiecutter).
-
-- Translation files are hosted on
- ``https://github.com/python/python-docs-{LANGUAGE_TAG}`` (not
- mandatory to start a translation, but mandatory to land on
- ``docs.python.org``).
-
-- Translations having completed ``tutorial/``, ``library/stdtypes``
- and ``library/functions`` are hosted on
- ``https://docs.python.org/{LANGUAGE_TAG}/{VERSION_TAG}/``.
-
-
-How to get help
-===============
-
-Discussions about translations occur on the `translation mailing list `_,
-and there's a `Libera.Chat IRC `_ channel,
-``#python-doc``.
-
-
-Translation FAQ
-===============
-
-Which version of the Python documentation should be translated?
----------------------------------------------------------------
-
-Consensus is to work on current stable. You can then propagate your
-translation from one branch to another using :pypi:`pomerge`.
-
-
-Are there some tools to help in managing the repo?
---------------------------------------------------
-
-Here's what we're using:
-
-- :pypi:`pomerge` to propagate translations from one file to others.
-- :pypi:`pospell` to check for typos in ``.po`` files.
-- :pypi:`powrap` to rewrap the ``.po`` files
- before committing. This helps keep Git diffs short.
-- :pypi:`potodo` to list what needs to be translated.
-- :pypi:`sphinx-lint` to validate reST syntax in translation files.
-
-
-How is a coordinator elected?
------------------------------
-
-There is no election; each translation has to sort this out. Here are some suggestions.
-
-- Coordinator requests are to be public on the `translation mailing list `_.
-- If the given language has a native core dev, the core dev has their
- say on the choice.
-- Anyone who wants to become coordinator for their native language and shows
- motivation by translating and building a community will be named
- coordinator.
-- In case of concurrency between two persons, no one will sort this out
- for you. It is up to you two to organize a local election or whatever is
- needed to sort this out.
-- If a coordinator becomes inactive or unreachable for a long
- period of time, someone else can ask for a takeover on the `translation mailing list `_.
-
-
-The entry for my translation is missing/not up to date on this page
--------------------------------------------------------------------
-
-Ask on the `translation mailing list `_, or better, make a PR on the `devguide
- `__.
-
-
-I have a translation, but it's not in Git. What should I do?
-------------------------------------------------------------
-
-You can ask for help on the `translation mailing list `_, and
-the team will help you create an appropriate repository. You can still use tools like transifex,
-if you like.
-
-
-My Git hierarchy does not match yours. Can I keep it?
------------------------------------------------------
-
-No, inside the ``github.com/python`` organization weβll all have the
-exact same hierarchy so bots will be able to build all of our
-translations. So you may have to convert from one hierarchy to another.
-Ask for help on the `translation mailing list `_ if youβre
-not sure on how to do it.
-
-
-What hierarchy should I use in my GitHub repository?
-----------------------------------------------------
-
-As for every project, we have a *branch* per version. We store ``.po``
-files in the root of the repository using the ``gettext_compact=0``
-style.
-
-.. _translation_wg: https://wiki.python.org/psf/TranslationWG/Charter
-.. _translation_ml: https://mail.python.org/mailman3/lists/translation.python.org/
diff --git a/documentation/translations/coordinating.rst b/documentation/translations/coordinating.rst
new file mode 100644
index 000000000..4e78b9247
--- /dev/null
+++ b/documentation/translations/coordinating.rst
@@ -0,0 +1,170 @@
+============
+Coordinating
+============
+
+Information about the Python documentation translation processes is
+found in this devguide and :PEP:`545`.
+Translations are built by `docsbuild-scripts
+ `__ and hosted on
+docs.python.org. Translations
+are overseen by the `Editorial Board `_
+
+Starting a new translation
+==========================
+
+First subscribe to the `translation mailing list `_,
+and introduce yourself and the translation you're starting.
+
+Then you can bootstrap your new translation by using the `cookiecutter
+`__ or
+`bootstrapper `__.
+You can also start your translation using `Transifex `_
+following this `guide `_.
+
+The important steps look like this:
+
+- Create the GitHub repo (any account) with the correct hierarchy by using one
+ of the bootstrappers or Transifex.
+- Gather people to help you translate. You can't do it alone.
+- You can use any tool to translate, as long as you can synchronize with Git.
+ Some use Transifex, and some use only GitHub. You can choose another
+ way if you like; it's up to you.
+- Update :doc:`this page ` to reflect your work and progress, either via a
+ PR or by asking on the `translation mailing list `_.
+- When ``bugs``, ``tutorial``, and ``library/functions`` are 100%
+ completed, ask on the `translation mailing list `_ for
+ your language to be added in the language switcher on docs.python.org.
+
+
+How to get help
+===============
+
+Discussions about translations occur on the Python Docs Discord
+`#translations channel `_, `translation
+mailing list `_, and the
+`translations category `_
+of the Python Discourse.
+
+
+PEP 545 summary
+===============
+
+Here are the essential points of :PEP:`545`:
+
+- Each translation is assigned an appropriate lowercased language tag,
+ with an optional region subtag, and joined with a dash, like
+ ``pt-br`` or ``fr``.
+
+- Each translation is under CC0 and marked as such in the README (as in
+ the cookiecutter).
+
+- Translation files are hosted on
+ ``https://github.com/python/python-docs-{LANGUAGE_TAG}`` (not
+ mandatory to start a translation, but mandatory to land on
+ ``docs.python.org``).
+
+- Translations having completed ``tutorial/``, ``library/stdtypes``
+ and ``library/functions`` are hosted on
+ ``https://docs.python.org/{LANGUAGE_TAG}/{VERSION_TAG}/``.
+
+
+Transifex
+=========
+
+If you need help from a Transifex administrator, open an issue on the
+`tracker `_.
+
+
+Coordinating FAQ
+================
+
+Are there tools to help in managing the repo?
+---------------------------------------------
+
+Here's what we're using:
+
+- :pypi:`poutils` which includes:
+ - :pypi:`pomerge` to propagate translations from one file to others.
+ - :pypi:`pospell` to check for typos in ``.po`` files.
+ - :pypi:`powrap` to rewrap the ``.po`` files
+ before committing. This helps keep Git diffs short.
+ - :pypi:`potodo` to list what needs to be translated.
+- :pypi:`sphinx-lint` to validate reST syntax in translation files.
+
+More related tools and projects can be found in the
+`python-docs-translations`__ organisation on GitHub.
+
+__ https://github.com/python-docs-translations
+
+How is a coordinator elected?
+-----------------------------
+
+Each translation team will decide on the number of coordinators.
+We recommend two or three coordinators, though you may begin with one.
+Here are some general suggestions.
+
+- Coordinator requests are to be public on the `translation mailing list `_.
+- If the given language has a native core dev, the core dev has input
+ on the coordinator request.
+- Anyone who wants to become coordinator for their native language and shows
+ motivation by translating and building a community will be named
+ coordinator.
+- We expect the local community to self-organize coordinators and contributors.
+ If you have questions, please ask on the mailing list or Discourse.
+- If a coordinator becomes inactive or unreachable for a long
+ period of time, someone else can ask to be added as a primary coordinator on the `translation mailing list `_.
+ As a community resource, we aim to keep translations up to date with active contributors, including coordinators.
+
+I have a translation, but it's not in Git. What should I do?
+------------------------------------------------------------
+
+You can ask for help on the `translation mailing list `_, and
+the team will help you create an appropriate repository. You can still use tools like transifex,
+if you like.
+
+
+My Git hierarchy does not match yours. Can I keep it?
+-----------------------------------------------------
+
+No, inside the ``github.com/python`` organization weβll all have the
+exact same hierarchy so bots will be able to build all of our
+translations. So you may have to convert from one hierarchy to another.
+Ask for help on the `translation mailing list `_ if youβre
+not sure on how to do it.
+
+
+What hierarchy should I use in my GitHub repository?
+----------------------------------------------------
+
+As for every project, we have a *branch* per version. We store ``.po``
+files in the root of the repository using the ``gettext_compact=0``
+style.
+
+
+.. XXX Explain necessary folder structure
+
+
+Which version of the Python documentation should be translated?
+---------------------------------------------------------------
+
+It's best to work on Python's current stable or beta version. You can then
+propagate your translation from one branch to another using :pypi:`pomerge`.
+
+
+The entry for my translation is missing or not up to date
+---------------------------------------------------------
+
+Ask on the `translation mailing list `_, or better, make a PR
+on the `devguide `__.
+
+
+Is there a Weblate instance we can translate on?
+------------------------------------------------
+
+There is currently no Weblate instance for Python translations.
+See this `Discourse thread `_
+for updates.
+
+
+.. _EB: https://python.github.io/editorial-board/
+.. _translation_ml: https://mail.python.org/mailman3/lists/translation.python.org/
diff --git a/documentation/translations/index.rst b/documentation/translations/index.rst
new file mode 100644
index 000000000..2f5cfe0f4
--- /dev/null
+++ b/documentation/translations/index.rst
@@ -0,0 +1,9 @@
+============
+Translations
+============
+
+.. toctree::
+ :maxdepth: 3
+
+ translating
+ coordinating
diff --git a/documentation/translations/translating.rst b/documentation/translations/translating.rst
new file mode 100644
index 000000000..7d1e2f251
--- /dev/null
+++ b/documentation/translations/translating.rst
@@ -0,0 +1,286 @@
+===========
+Translating
+===========
+
+.. highlight:: rest
+
+There are several documentation translations already
+in production and can be found in the language switcher; others are works in
+progress. To get started read your repository's contributing guide, which is
+generally the ``README`` file, and this page.
+If your language isnβt listed below, feel free to start the translation!
+See :doc:`coordinating` guide to get started.
+
+For more details about translations and their progress, see `the dashboard
+ `__.
+
+.. _translation-coordinators:
+
+.. list-table::
+ :header-rows: 1
+
+ * - Language
+ - Coordination team
+ - Links
+ * - Arabic (ar)
+ - Abdur-Rahmaan Janhangeer (:github-user:`Abdur-rahmaanJ`)
+ - :github:`GitHub `
+ * - `Bengali (bn-IN) `__
+ - Kushal Das (:github-user:`kushaldas`)
+ - :github:`GitHub `
+ * - `French (fr) `__
+ - Julien Palard (:github-user:`JulienPalard`)
+ - `AFPy/python-docs-fr `_,
+ :github:`mirror `
+ * - `Greek (el) `__
+ - | Lysandros Nikolaou (:github-user:`lysnikolaou`),
+ | Fanis Petkos (:github-user:`thepetk`),
+ | Panagiotis Skias (:github-user:`skpanagiotis`)
+ - :github:`GitHub `
+ * - Hindi (hi-IN)
+ - Sanyam Khurana (:github-user:`CuriousLearner`)
+ - :github:`GitHub `
+ * - Hungarian (hu)
+ - TamΓ‘s Bajusz (:github-user:`gbtami`)
+ - :github:`GitHub `,
+ `mailing list `__
+ * - `Indonesian (id) `__
+ - | Irvan Putra (:github-user:`irvan-putra`),
+ | Jeff Jacobson (:github-user:`jwjacobson`)
+ - :github:`GitHub `
+ * - `Italian (it) `__
+ - Alessandro Cucci (`email `__)
+ - :github:`GitHub `,
+ `original announcement `__
+ * - `Japanese (ja) `__
+ - | Kinebuchi Tomohiko (:github-user:`cocoatomo`),
+ | Atsuo Ishimoto (:github-user:`atsuoishimoto`)
+ - :github:`GitHub `
+ * - `Korean (ko) `__
+ - μ€λκΆ (:github-user:`flowdas`)
+ - :github:`GitHub `
+ * - Marathi (mr)
+ - Sanket Garade (:github-user:`sanketgarade`, `email `__)
+ - :github:`GitHub `
+ * - Lithuanian (lt)
+ - Albertas Gimbutas (:github-user:`albertas`, `email `__)
+ - `original announcement `__
+ * - Persian (fa)
+ - Alireza Shabani (:github-user:`revisto`)
+ - :github:`GitHub `
+ * - `Polish (pl) `__
+ - | Maciej Olko (:github-user:`m-aciek`),
+ | Stan Ulbrych (:github-user:`StanFromIreland`)
+ - :github:`GitHub `,
+ `Transifex `_,
+ `original announcement `__
+ * - Portuguese (pt)
+ - Gustavo Toffo
+ -
+ * - `Brazilian Portuguese (pt-br) `__
+ - | Rafael Fontenelle (:github-user:`rffontenelle`),
+ | Marco Rougeth (:github-user:`rougeth`)
+ - :github:`GitHub `,
+ `guide `__,
+ `Telegram `__,
+ `article `__
+ * - `Romanian (ro) `__
+ - Octavian Mustafa (:github-user:`octaG-M`, `email `__)
+ - :github:`GitHub `
+ * - Russian (ru)
+ - Daniil Kolesnikov (:github-user:`MLGRussianXP`, `email `__)
+ - :github:`GitHub `,
+ `original announcement `__
+ * - `Simplified Chinese (zh-cn) `__
+ - | Shengjing Zhu (:github-user:`zhsj`),
+ | Du, Meng (:github-user:`dumeng`)
+ - :github:`GitHub `,
+ `Transifex `_
+ * - `Spanish (es) `__
+ - RaΓΊl Cumplido
+ - :github:`GitHub `
+ * - `Traditional Chinese (zh-tw) `__
+ - | ηε¨ηΏ Matt Wang (:github-user:`mattwang44`),
+ | Josix Wang
+ - :github:`GitHub `
+ * - `Turkish (tr) `__
+ - Ege Akman (:github-user:`egeakman`)
+ - :github:`GitHub `,
+ `RTD `__
+ * - `Ukrainian (uk) `__
+ - Dmytro Kazanzhy (:github-user:`kazanzhy`, `email `__)
+ - :github:`GitHub