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 376c78461..235382276 100644
--- a/.github/CODE_OF_CONDUCT.md
+++ b/.github/CODE_OF_CONDUCT.md
@@ -4,7 +4,7 @@ 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
(for example, mailing lists, issue trackers, GitHub, etc.).
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index a6bafe511..028715319 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -33,13 +33,13 @@ Due to the fact that this project is entirely volunteer-run (that is, no one is
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/.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 d005d01bb..3d485ae2d 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 = --fail-on-warning --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 = --define latex_paper_size=a4
-PAPEROPT_letter = --define latex_paper_size=letter
-ALLSPHINXOPTS = --builder $(BUILDER) \
- --doctree-dir $(BUILDDIR)/doctrees \
- --jobs $(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:
@@ -69,101 +58,19 @@ venv:
.PHONY: ensure-venv
ensure-venv:
@if [ ! -d $(VENVDIR) ] ; then \
+ set -e; \
echo "Creating venv in $(VENVDIR)"; \
- if uv --version > /dev/null; then \
- uv venv $(VENVDIR); \
- VIRTUAL_ENV=$(VENVDIR) uv 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.txt; \
+ $(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'))"
@@ -172,7 +79,7 @@ htmlview: html
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
# Arbitrarily selected ephemeral port between 49152β65535
# to avoid conflicts with other processes:
-htmllive: SPHINXOPTS = --re-ignore="/\.idea/|/venv/" --open-browser --delay 0 --port 55301
+htmllive: SPHINXOPTS = --open-browser --delay 0 --port 55301
htmllive: html
.PHONY: check
@@ -180,29 +87,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
- if uv --version > /dev/null; then \
- $(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || VIRTUAL_ENV=$(VENVDIR) uv pip install pre-commit; \
+.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 pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit; \
- fi;
- $(VENVDIR)/bin/python3 -m pre_commit run --all-files
+ $(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/README.rst b/README.rst
index fde4a6c27..e2f0c5617 100644
--- a/README.rst
+++ b/README.rst
@@ -17,7 +17,7 @@ The CPython Developer's Guide
This guide covers how to contribute to CPython. It is known by the
-nickname of "the devguide" by the Python core developers.
+nickname of "the devguide" by the Python core team.
The official home of this guide is https://devguide.python.org.
diff --git a/_static/devguide_overrides.css b/_static/devguide_overrides.css
index 9237445d2..5b6d67b09 100644
--- a/_static/devguide_overrides.css
+++ b/_static/devguide_overrides.css
@@ -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-blob.release-cycle-blob-security {
- fill: #FFDD44;
- stroke: #FF8800;
+.release-cycle-chart .release-cycle-status-prerelease {
+ --status-bg-color: teal;
+ --status-border-color: darkgreen;
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-bugfix {
- fill: #00DD22;
- stroke: #008844;
+.release-cycle-chart .release-cycle-status-feature {
+ --status-bg-color: #2222EE;
+ --status-border-color: #008888;
}
-.release-cycle-chart .release-cycle-blob.release-cycle-blob-prerelease {
- fill: teal;
- stroke: darkgreen;
+.release-cycle-chart .release-cycle-blob {
+ fill: var(--status-bg-color);
+ stroke: transparent;
+}
+
+.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 {
@@ -94,3 +117,9 @@
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 fc46f3223..5050f5c45 100644
--- a/conf.py
+++ b/conf.py
@@ -1,4 +1,4 @@
-import time
+import json
extensions = [
'notfound.extension',
@@ -16,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.
@@ -63,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
@@ -86,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",
@@ -132,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",
@@ -166,6 +176,37 @@
# 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.
@@ -177,6 +218,7 @@
"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..aa16f10bd
--- /dev/null
+++ b/contrib/core-team/experts.rst
@@ -0,0 +1,10 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core team :ref:`experts` page from the devguide.]
+
+.. 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..2ca21344b
--- /dev/null
+++ b/contrib/core-team/index.rst
@@ -0,0 +1,24 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+.. _c_core-team:
+
+=========
+Core team
+=========
+
+[This is mostly re-organized from the :ref:`core-team` section of the devguide]
+
+.. 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..932216f7c
--- /dev/null
+++ b/contrib/core-team/join-team.rst
@@ -0,0 +1,10 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core team :ref:`join-core-team` page from the devguide.]
+
+.. 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..38ba31023
--- /dev/null
+++ b/contrib/core-team/motivations.rst
@@ -0,0 +1,10 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core team :ref:`motivations` page from the devguide.]
+
+.. 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..d6902bd78
--- /dev/null
+++ b/contrib/core-team/responsibilities.rst
@@ -0,0 +1,10 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core team :ref:`responsibilities` page from the devguide.]
+
+.. 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..ecfe856a4
--- /dev/null
+++ b/contrib/core-team/team-log.rst
@@ -0,0 +1,10 @@
+.. important::
+
+ |draft|
+
+ |purpose|
+
+
+[This is the existing core team :ref:`team-log` page from the devguide.]
+
+.. 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 91%
rename from core-developers/committing.rst
rename to core-team/committing.rst
index e438d39fa..41cf67254 100644
--- a/core-developers/committing.rst
+++ b/core-team/committing.rst
@@ -5,7 +5,7 @@ Accepting pull requests
.. highlight:: none
-This page is a step-by-step guide for core developers who need to assess,
+This page is a step-by-step guide for the core team to assess,
merge, and possibly backport a pull request on the main repository.
Assessing a pull request
@@ -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.
@@ -54,7 +54,7 @@ to enter the public source tree. Ask yourself the following questions:
developer can apply the label ``needs backport to X.Y`` to the pull
request. Once the backport pull request has been created, remove the
``needs backport to X.Y`` label from the original pull request. (Only
- core developers and members of the :ref:`Python Triage Team `
+ the core team and members of the :ref:`Python Triage Team `
can apply labels to GitHub pull requests).
* **Does the pull request pass a check indicating that the submitter has signed the CLA?**
@@ -62,7 +62,8 @@ to enter the public source tree. Ask yourself the following questions:
Licensing Agreement `_
(CLA), unless their change has no possible intellectual property
associated with it (for example, fixing a spelling mistake in documentation).
- The `CPython CLA Bot `_
+ 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.
@@ -151,7 +152,7 @@ How to write a NEWS entry
All ``NEWS`` entries end up being part of the changelog.
The changelog contains *a lot* of entries,
-and its intended audience is mainly users, not core devs and contributors.
+and its intended audience is mainly users, not the core team and contributors.
Take this into consideration when wording your ``NEWS`` entry.
Describe the user-visible effects of your change succinctly and accurately;
avoid long technical elaborations, digressions, and do not expect or require
@@ -165,7 +166,7 @@ number since it is part of the file name. You can use
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
@@ -178,11 +179,11 @@ Working with Git_
.. seealso::
:ref:`gitbootcamp`
-As a core developer, you have the ability to push changes to the official
+As a core team member, 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.
@@ -223,12 +224,12 @@ Backporting changes to an older version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If it is determined that a pull request needs to be backported into one or
-more of the maintenance branches, then a core developer can apply the label
+more of the maintenance branches, then a core team member can apply the label
``needs backport to X.Y`` to the pull request.
After the pull request has been merged, miss-islington (bot) will first try to
do the backport automatically. If miss-islington is unable to do it,
-then the pull request author or the core developer who merged it should look into
+then the pull request author or the core team member who merged it should look into
backporting it themselves, using the backport generated by cherry_picker.py_
as a starting point.
@@ -251,7 +252,7 @@ Note that cherry_picker.py_ adds the branch prefix automatically.
Once the backport pull request has been created, remove the
``needs backport to X.Y`` label from the original pull request. (Only
-core developers and members of the :ref:`Python Triage Team `
+members of the core team and :ref:`Python Triage Team `
can apply labels to GitHub pull requests).
.. _cherry_picker.py: https://github.com/python/cherry-picker
@@ -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 9a6a2ee3e..ab87c50fa 100644
--- a/core-developers/developers.csv
+++ b/core-team/core-team.csv
@@ -1,6 +1,14 @@
+Emma Smith,emmatyping,2025-07-31,,
+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,,
-Michael Droetboom,mdboom,2024-06-06,,
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,,
@@ -27,7 +35,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,,
@@ -48,7 +56,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,,
@@ -65,16 +73,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
@@ -96,12 +104,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
@@ -110,9 +118,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
@@ -138,9 +146,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,11 +157,11 @@ Brett Cannon,brettcannon,2003-04-18,,
David Goodger,,2003-01-02,2017-02-10,Did not make GitHub transition
Gustavo Niemeyer,,2002-11-05,2017-02-10,Did not make GitHub transition
Tony Lownds,,2002-09-22,2017-02-10,Did not make GitHub transition
-Steve Holden,holdenweb,2002-06-14,2017-02-10,"Relinquished privileges on 2005-04-07,
+Steve Holden,holdenweb,2002-06-14,2017-02-10,"Relinquished privileges on 2005-04-07,
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
@@ -186,9 +194,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 74%
rename from core-developers/experts.rst
rename to core-team/experts.rst
index f61f1439c..5791ff408 100644
--- a/core-developers/experts.rst
+++ b/core-team/experts.rst
@@ -56,9 +56,10 @@ __future__
__main__ gvanrossum, ncoghlan
_thread
abc
-argparse
+annotationlib JelleZijlstra*
+argparse savannahostrowski*, serhiy-storchaka*
array
-ast benjaminp, pablogsal, isidentical, JelleZijlstra
+ast benjaminp, pablogsal, isidentical, JelleZijlstra, eclips4
asyncio 1st1, asvetlov, gvanrossum, graingert, kumaraditya303, willingc
atexit
base64
@@ -66,9 +67,8 @@ bdb
binascii
bisect rhettinger*
builtins
-bz2
calendar
-cmath mdickinson
+cmath
cmd
code
codecs malemburg, doerwalter
@@ -77,20 +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
-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)
@@ -99,66 +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
libmpdec
linecache
locale malemburg
logging vsajip
-lzma
mailbox
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 gaogaotiantian
-pickle avassalotti
-pickletools avassalotti
-pipes
+pickle avassalotti, serhiy-storchaka*
+pickletools avassalotti, serhiy-storchaka*
pkgutil
platform malemburg
plistlib
@@ -171,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
@@ -191,17 +190,15 @@ 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*
symtable benjaminp
sys
@@ -209,14 +206,14 @@ sysconfig FFY00
syslog jafo^*
tabnanny tim-one (inactive)
tarfile gustaebel
-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*
@@ -225,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
@@ -255,7 +251,6 @@ xmlrpc
zipapp pfmoore
zipfile alanmcintyre^, serhiy-storchaka, Yhg1s, gpshead
zipimport Yhg1s*
-zlib Yhg1s, gpshead*
==================== =============================================
@@ -265,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
================== ===========
@@ -285,20 +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, 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
=================== ===========
@@ -308,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
@@ -332,35 +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
+subinterpreters ericsnowcurrently, kumaraditya303, ZeroIntensity*
symbol table JelleZijlstra, carljm
-testing voidspace, ezio-melotti
+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
================== ==========================================================
@@ -368,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..eb0f56e09
--- /dev/null
+++ b/core-team/join-team.rst
@@ -0,0 +1,115 @@
+.. _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 join the core team of Python.
+You must also work well with other core team members (and people in general)
+as you become an ambassador for the Python project.
+
+Typically a core team member 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 team members 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 team member (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..7ab0fab02
--- /dev/null
+++ b/core-team/memorialization.rst
@@ -0,0 +1,159 @@
+.. _memorialize-core-developer:
+.. _memorialize-core-team-member:
+
+===============
+Memorialization
+===============
+
+Rationale
+=========
+
+When a core team member 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
+the core team has access.
+
+After the status of the core team member 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 81%
rename from core-developers/motivations.rst
rename to core-team/motivations.rst
index dfe41d5ae..d5a87e22c 100644
--- a/core-developers/motivations.rst
+++ b/core-team/motivations.rst
@@ -4,22 +4,22 @@
Motivations and affiliations
============================
-CPython core developers participate in the core development process for a
-variety of reasons. Being accepted as a core developer indicates that
+CPython core team members participate in the core development process for a
+variety of reasons. Being accepted as a core team member indicates that
an individual is interested in acquiring those responsibilities, has the
-ability to collaborate effectively with existing core developers, and has had
+ability to collaborate effectively with existing core team members, and has had
the time available to demonstrate both that interest and that ability.
-This page allows core developers that choose to do so to provide more
+This page allows core team members that choose to do so to provide more
information to the rest of the Python community regarding their personal
situation (such as their general location and professional affiliations), as
well as any personal motivations that they consider particularly relevant.
-Core developers that wish to provide this additional information add a new
+Core team members that wish to provide this additional information add a new
entry to the :ref:`published-motivations` section below. Guidelines relating
to content and layout are included as comments in the source code for this page.
-Core developers that are available for training, consulting, contract, or
+Core team members who are available for training, consulting, contract, or
full-time work, or are seeking crowdfunding support for their community
contributions, may also choose to provide that information here (including
linking out to commercial sites with the relevant details).
@@ -32,7 +32,7 @@ For more information on the origins and purpose of this page, see
Published entries
=================
-The following core developers have chosen to provide additional details
+The following core team members have chosen to provide additional details
regarding their professional affiliations and (optionally) other reasons for
participating in the CPython core development process:
@@ -43,7 +43,7 @@ participating in the CPython core development process:
Topic headings should be in the form of "Name (Country)" or
"Name (Continent)" to help give some indication as to the geographic
- distribution of core developers.
+ distribution of core team members.
NOTE: The rest of these guidelines are highly provisional - we can evolve
them as people add entries, and we decide on the style we like. The
@@ -106,11 +106,13 @@ 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
+ As a core team member, she is primarily interested in helping to ensure Python's
continued suitability for educational, testing and data analysis use cases,
as well as in encouraging good architectural practices when assembling Python
applications and test harnesses from open source components.
@@ -130,7 +132,7 @@ participating in the CPython core development process:
devices, and now works for Microsoft on anything that makes Python more
accessible to developers on any platform.
- As a core developer, his focus is on maintaining the already excellent
+ As a core team member, his focus is on maintaining the already excellent
Windows support and improving Python's ability to be embedded in other
applications.
@@ -186,23 +188,23 @@ 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
Antoine started working with Python in 2005 in order to implement a
decentralized virtual world protocol. He started contributing to CPython
- in 2007 and became a core developer in 2008. His motivations have been
+ in 2007 and became a core team member in 2008. His motivations have been
driven both by the abstract desire to make Python better for the whole
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,12 +279,12 @@ 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 team 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
-identifying, nominating and mentoring new core developers.
+resolving open issues and accepting submitted pull requests, but also the process of
+identifying, nominating and mentoring new core team members.
The core commit statistics monitored by sites like `OpenHub`_ provide a good
record as to *who* is currently handling the bulk of the review and maintenance
@@ -293,13 +293,13 @@ people's ability to spend time on reviewing proposed changes, or mentoring new
contributors.
This page aims to provide at least some of that missing data by encouraging
-core developers to highlight professional affiliations in the following two
+core team members to highlight professional affiliations in the following two
cases (even if not currently paid for time spent participating in the core
development process):
-* developers working for vendors that distribute a commercially supported
+* members working for vendors that distribute a commercially supported
Python runtime
-* developers working for Sponsor Members of the Python Software Foundation
+* members working for Sponsor Members of the Python Software Foundation
These are cases where documenting our affiliations helps to improve the
overall transparency of the core development process, as well as making it
@@ -307,20 +307,20 @@ easier for staff at these organisations to locate colleagues that can help
them to participate in and contribute effectively to supporting the core
development process.
-Core developers working for organisations with a vested interest in the
+Core team members working for organisations with a vested interest in the
sustainability of the CPython core development process are also encouraged to
seek opportunities to spend work time on mentoring potential new core
developers, whether through the general `core mentorship program`_, through
mentoring colleagues, or through more targeted efforts like Outreachy's paid
`internships`_ and Google's `Summer of Code`_.
-Core developers that are available for consulting or contract work on behalf of
+Core team members who are available for consulting or contract work on behalf of
the Python Software Foundation or other organisations are also encouraged
to provide that information here, as this will help the PSF to better
facilitate funding of core development work by organisations that don't
-directly employ any core developers themselves.
+directly employ any core team members themselves.
-Finally, some core developers seeking to increase the time they have available
+Finally, some core team members seeking to increase the time they have available
to contribute to CPython may wish to pursue crowdfunding efforts that allow
their contributions to be funded directly by the community, rather than relying
on institutional sponsors allowing them to spend some or all of their work
@@ -336,15 +336,15 @@ time contributing to CPython development.
Limitations on scope
====================
-* Specific technical areas of interest for core developers should be captured in
+* Specific technical areas of interest for core team members should be captured in
the :ref:`Experts Index `.
-* This specific listing is limited to CPython core developers (since it's
- focused on the specific constraint that is core developer time), but it
+* This specific listing is limited to CPython core team members (since it's
+ focused on the specific constraint that is core team member time), but it
would be possible to create a more expansive listing on the Python wiki that
- also covers issue triagers, and folks seeking to become core developers.
+ also covers issue triagers, and folks seeking to join the core team.
-* Changes to the software and documentation maintained by core developers,
+* Changes to the software and documentation maintained by the core team,
together with related design discussions, all take place in public venues, and
hence are inherently subject to full public review. Accordingly, core
developers are NOT required to publish their motivations and affiliations if
diff --git a/core-developers/responsibilities.rst b/core-team/responsibilities.rst
similarity index 80%
rename from core-developers/responsibilities.rst
rename to core-team/responsibilities.rst
index 0638a967e..3b2137d6b 100644
--- a/core-developers/responsibilities.rst
+++ b/core-team/responsibilities.rst
@@ -5,25 +5,25 @@ Responsibilities
================
As contributors to the CPython project, our shared responsibility is to
-collaborate constructively with other contributors, including core developers.
+collaborate constructively with other contributors, including core team members.
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 `.
-Core developers accept key additional responsibilities around the ongoing
+Core team members accept key additional responsibilities around the ongoing
management of the project:
-* core developers bear the additional responsibility of handling the
+* core team members bear the additional responsibility of handling the
consequences of accepting a change into the code base or documentation.
That includes reverting or fixing it if it causes problems in the
Buildbot fleet or someone spots a problem in post-commit review, as well
as helping out the release manager in resolving any problems found during
the pre-release testing cycle. While all contributors are free to help out
with this part of the process, and it is most welcome when they do, the
- actual responsibility rests with the core developer that merged the change
-* core developers also bear the primary responsibility for deciding when
+ actual responsibility rests with the core team member that merged the change
+* core team members also bear the primary responsibility for deciding when
changes proposed on the issue tracker should be escalated to
the appropriate :ref:`Discourse ` category
for wider discussion, as well as suggesting the use of the
@@ -31,15 +31,15 @@ management of the project:
of complex changes, or changes with a potentially significant impact on
end users
-As a result of the additional responsibilities they accept, core developers
+As a result of the additional responsibilities they accept, core team members
gain the privilege of being able to approve proposed changes, as well as being
-able to reject them as inappropriate. Core developers are also able to request
+able to reject them as inappropriate. Core team members are also able to request
that even already merged changes be escalated to
:ref:`Discourse ` for further discussion,
and potentially even reverted prior to release.
-Becoming a core developer isn't a binary "all-or-nothing" status - CPython
-is a large project, and different core developers accept responsibility for
+Joining the core team isn't a binary "all-or-nothing" status - CPython
+is a large project, and different core team members accept responsibility for
making design and development decisions in different areas (as documented
in the :ref:`experts` and :ref:`developers`).
@@ -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.
@@ -82,7 +82,7 @@ Pull request merging
Once you have your commit privileges on GitHub you will be able to accept
pull requests on GitHub. You should plan to continue to submit your own
-changes through pull requests as if you weren't a core developer to benefit
+changes through pull requests as if you weren't a core team member to benefit
from various things such as automatic integration testing, but you
can accept your own pull requests if you feel comfortable doing so.
@@ -90,13 +90,13 @@ can accept your own pull requests if you feel comfortable doing so.
Expectations
============
-As a core developer, there are certain things that are expected of you.
+As a core team member, there are certain things that are expected of you.
First and foremost, be a good person. This might sound melodramatic, but you
are now a member of the Python project and thus represent the project and your
-fellow core developers whenever you discuss Python with anyone. We have a
+fellow core team members whenever you discuss Python with anyone. We have a
reputation for being a very nice group of people and we would like to keep it
-that way. Core developers responsibilities include following the `PSF Code of
+that way. Core team responsibilities include following the `PSF Code of
Conduct`_.
Second, please be prompt in responding to questions. Many contributors to Python
@@ -118,7 +118,7 @@ remove yourself from the list.
Fourth, please consider whether or not you wish to add your name to the
:ref:`motivations` list. Core contributor participation in the list helps the
wider Python community to better appreciate the perspectives currently
-represented amongst the core development team, the Python Software Foundation
+represented amongst the core team, the Python Software Foundation
to better assess the sustainability of current contributions to CPython core
development, and also serves as a referral list for organisations seeking
commercial Python support from the core development community.
@@ -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 3f8c03e92..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
diff --git a/developer-workflow/communication-channels.rst b/developer-workflow/communication-channels.rst
index 0f7970fad..9b088b350 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,27 +78,24 @@ 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
the `Committers`_ category, where posting is restricted to the `CPython
-`_ core developers.
+`_ core team.
The Committers category is often used for announcements and notifications.
-It is also the designated venue for the core developer promotion votes.
+It is also the designated venue for the core team promotion votes.
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,29 +182,29 @@ 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)
=============================
For more real-time discussions, the core development team have a private Discord
-server available. Core developers, Steering Council members, triagers, and
+server available. Core team members, Steering Council members, triagers, and
documentarians on the project are eligible to join the server. Joining the
Discord server is entirely optional, as all essential communications occur on
the mailing lists and Discourse forums.
-For core developers, a long lived multiple use invitation link for this server
-can be found in the private core developer only section of the Discourse forum.
+For core team members, a long-lived multiple-use invitation link for this server
+can be found in the private core team only section of the Discourse forum.
For triagers and documentarians joining the Discord server, a single use invitation
link should be generated and sent to them directly.
When first joining the server, new users will only have access to the ``#welcome``
and ``#rules-and-info`` channels. To link their Discord ID with their project
-role, core developers may update their Steering Council π `voter record`_ with
+role, core team members may update their Steering Council π `voter record`_ with
their Discord ID before posting in the ``#welcome`` channel to request access
-to the rest of the server channels. Triagers, documentarians, and core developers
+to the rest of the server channels. Triagers, documentarians, and core team members
that would prefer not to add their Discord ID to their Steering Council voter
record may instead be vouched for by an existing member of the Discord server.
@@ -224,7 +225,7 @@ set a specific `Server Nickname`_
IRC
===
-Some core developers still participate in the ``#python-dev`` IRC channel on
+Some core team members still participate in the ``#python-dev`` IRC channel on
``irc.libera.chat``. This is not a place to ask for help with Python, but to
discuss issues related to Python's own development. See also the
``#python-dev-notifs`` channel for bots notifications.
@@ -233,9 +234,9 @@ discuss issues related to Python's own development. See also the
Blogs
=====
-Several core developers are active bloggers and discuss Python's development
+Several core team members 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 501df2d43..c8b2d5ebf 100644
--- a/developer-workflow/development-cycle.rst
+++ b/developer-workflow/development-cycle.rst
@@ -4,7 +4,7 @@
Development cycle
=================
-The responsibilities of a core developer shift based on what kind of branch of
+The responsibilities of a core team member shift based on what kind of branch of
Python a developer is working on and what stage the branch is in.
To clarify terminology, Python uses a ``major.minor.micro`` nomenclature
@@ -37,7 +37,7 @@ Branches
--------
There is a branch for each *feature version*, whether released or not (for
-example, 3.7, 3.8).
+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
-(``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.
@@ -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, for example, ``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.
@@ -144,7 +142,7 @@ Stages
------
Based on what stage the :ref:`in-development ` version of Python
-is in, the responsibilities of a core developer change in regards to commits
+is in, the responsibilities of a core team member change in regards to commits
to the :abbr:`VCS (version control system)`.
@@ -153,15 +151,15 @@ 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:
Alpha
^^^^^
-Alpha releases typically serve as a reminder to core developers that they
+Alpha releases typically serve as a reminder to the core team that they
need to start getting in changes that change semantics or add something to
Python as such things should not be added during a Beta_. Otherwise no new
restrictions are in place while in alpha.
@@ -173,16 +171,13 @@ Beta
After a first beta release is published, no new features are accepted. Only
bug fixes and improvements to documentation and tests can now be committed.
-This is when core developers should concentrate on the task of fixing
+This is when the core team should concentrate on the task of fixing
regressions and other new issues filed by users who have downloaded the alpha
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:
@@ -190,7 +185,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
+been reviewed by other core team members. Generally, these issues must be
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.
@@ -201,7 +196,7 @@ changes should be discussed first with the release manager.
You **cannot** skip the peer review during an RC, no matter how small! Even if
it is a simple copy-and-paste change, **everything** requires peer review from
-a core developer.
+a core team member.
.. _final:
@@ -321,12 +316,12 @@ including collaborators, access control, integrations, webhooks, and branch
protection. For full details of the permission levels see `GitHub's
documentation on repository permission levels
`_.
-Common reasons for this role are: maintenance of Core Developer
-Workflow tooling, Release Managers for all :ref:`in-development `,
+Common reasons for this role are: maintenance of core
+workflow tooling, Release Managers for all :ref:`in-development `,
:ref:`maintenance `, and :ref:`security mode `
-releases, and additional Python Core Developers as necessary for redundancy.
-Occasional temporary administrator access is acceptable as necessary for Core
-Developer workflow projects.
+releases, and additional Python core team members as necessary for redundancy.
+Occasional temporary administrator access is acceptable as necessary for core
+workflow projects.
Inactive or unreachable members may be removed with or without notice. Members
who no longer necessitate this level of access will be removed with notice.
@@ -347,7 +342,7 @@ Current administrators
| Pablo Galindo | Python 3.10 and 3.11 Release Manager, | pablogsal |
| | Maintainer of buildbot.python.org | |
+-------------------+----------------------------------------------------------+-----------------+
-| Εukasz Langa | Python 3.8 and 3.9 Release Manager, | ambv |
+| Εukasz Langa | Python 3.9 Release Manager, | ambv |
| | PSF CPython Developer in Residence 2021-present | |
+-------------------+----------------------------------------------------------+-----------------+
| Brett Cannon | | brettcannon |
@@ -356,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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -363,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..7131cfdf8 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 ca39a7275..e73927f1d 100644
--- a/developer-workflow/index.rst
+++ b/developer-workflow/index.rst
@@ -1,3 +1,5 @@
+.. _dev-workflow:
+
====================
Development workflow
====================
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/psrt.rst b/developer-workflow/psrt.rst
index 9347a9a81..9d9019dbf 100644
--- a/developer-workflow/psrt.rst
+++ b/developer-workflow/psrt.rst
@@ -31,7 +31,7 @@ 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
+Coordinators are expected to collaborate with other PSRT and core team members
when needed for guidance on whether the report is an actual vulnerability,
severity, advisory text, and fixes.
@@ -68,24 +68,24 @@ severity, advisory text, and fixes.
* 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 patched version, if applicable.
+ * 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 patch.
- Some reporters are willing to provide or collaborate to create a patch,
- otherwise relevant core developers can be invited to collaborate by
+* 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 team members can be invited to collaborate by
the coordinator.
* For **Low** and **Medium** severity vulnerabilities it is acceptable
- to develop a patch in public.
+ 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 patch.
+ labels so that a release is not created without including the fix.
- * For **High** and **Critical** severity vulnerabilities the patch must be
+ * 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 patch is approved privately and tested,
+ Core team members 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.
diff --git a/developer-workflow/stdlib.rst b/developer-workflow/stdlib.rst
index 732ee8f45..b683e55e9 100644
--- a/developer-workflow/stdlib.rst
+++ b/developer-workflow/stdlib.rst
@@ -28,26 +28,22 @@ You have a several options for this:
* Search the `issue tracker`_ for discussion related to the proposed addition.
This may turn up an issue that explains why the suggestion wasn't accepted.
* Open a new thread in the `Ideas Discourse category`_
- to gather feedback directly from the Python core developers and community.
+ to gather feedback directly from the Python core team 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
+If a core team member decides that your code would be useful to the general
Python community, they will then commit your code. If your code is not picked
-up by a core developer and committed then please do not take this personally.
+up by a core team and committed then please do not take this personally.
Through your public sharing of your code in order to gauge community support
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
@@ -55,8 +51,8 @@ Adding a new module
It must be stated upfront that getting a new module into the stdlib is very
difficult. Adding any significant amount of code to the stdlib increases the
-burden placed upon core developers. It also means that the module somewhat
-becomes "sanctioned" by the core developers as a good way to do something,
+burden placed upon the core team. It also means that the module somewhat
+becomes "sanctioned" by the core team as a good way to do something,
typically leading to the rest of the Python community to using the new module
over other available solutions. All of this means that additions to the stdlib
are not taken lightly.
@@ -80,7 +76,7 @@ that the stdlib consists of.
While a new stdlib module does not need to appeal to all users of Python, it
should be something that a large portion of the community will find useful.
-This makes sure that the developer burden placed upon core developers is worth
+This makes sure that the developer burden placed upon the core team is worth
it.
@@ -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.
@@ -112,12 +108,12 @@ 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
+the core team 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
module must promise to help maintain the module in the stdlib for two years.
-This not only helps out other core developers by alleviating workload from bug
+This not only helps out other core team members by alleviating workload from bug
reports that arrive from the first Python release containing the module, but
also helps to make sure that the overall design of the module continues to be
uniform.
diff --git a/development-tools/clang.rst b/development-tools/clang.rst
index 14040dd8b..b353d82f0 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,99 @@ 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/``:
+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``.
-.. code-block:: console
+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.
- $ 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
-On macOS, the libraries are installed in
-``/usr/local/lib/clang/3.3/lib/darwin/``:
+Python build setup
+==================
-.. code-block:: console
+This portion of the document covers invoking Clang and LLVM with the options
+required so the sanitizers analyze Python with under its test suite.
- $ 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
+Set the compiler to Clang, in case it's not the default::
-.. note::
+ export CC="clang"
- 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.
+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::
-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: ::
+ export CFLAGS="-fno-sanitize-recover"
- 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
+Then, run ``./configure`` with the relevant flags:
-.. note::
+* ASan: ``--with-address-sanitizer --without-pymalloc``
+* UBsan: ``--with-undefined-behavior-sanitizer``
- 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.
+The ``--without-pymalloc`` option is not necessary (tests should pass without it),
+but disabling pymalloc helps ASan uncover more bugs (ASan does not track
+individual allocations done by pymalloc).
-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 +160,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 +233,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 +273,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 +281,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 642f40dce..2f4677430 100644
--- a/development-tools/clinic.rst
+++ b/development-tools/clinic.rst
@@ -107,8 +107,8 @@ Terminology
end line
The line ``[clinic start generated code]*/``.
- The *end line* marks the _end_ of Argument Clinic :term:`input`,
- but at the same time marks the _start_ of Argument Clinic :term:`output`,
+ The *end line* marks the *end* of Argument Clinic :term:`input`,
+ but at the same time marks the *start* of Argument Clinic :term:`output`,
thus the text *"clinic start start generated code"*
Note that the *end line* closes the C block comment opened
by the *start line*.
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/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..b30d81131
--- /dev/null
+++ b/development-tools/warnings.rst
@@ -0,0 +1,69 @@
+.. 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/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 58b2bdac0..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`
@@ -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,11 +1153,12 @@ 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
@@ -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
diff --git a/documentation/start-documenting.rst b/documentation/start-documenting.rst
index 184cf54bf..7515992ec 100644
--- a/documentation/start-documenting.rst
+++ b/documentation/start-documenting.rst
@@ -76,12 +76,22 @@ To build the documentation, follow the steps in one of the sections below.
You can view the documentation after building the HTML
by opening the file :file:`Doc/build/html/index.html` in a web browser.
-.. note::
+Initial requirements
+--------------------
+
+Ensure your current working directory is the top level ``Doc/`` directory
+inside your :ref:`CPython repository clone `. You can switch to
+it with:
+
+.. code-block:: shell
+
+ cd Doc
+
+Ensure your Python version is at least 3.11. You can verify it with:
- The following instructions all assume your current working dir is
- the ``Doc`` subdirectory in your :ref:`CPython repository clone `.
- Make sure to switch to it with ``cd Doc`` if necessary.
+.. code-block:: shell
+ python --version
.. _doc-create-venv:
@@ -153,6 +163,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 8ebcec663..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
==============
@@ -132,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.
@@ -154,6 +155,7 @@ explanation.
Please consult the `DiΓ‘taxis `_ guide for more
detail.
+
Links
=====
@@ -182,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
================
@@ -207,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
=====================
@@ -218,6 +244,7 @@ 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)
============================================
@@ -239,6 +266,7 @@ module (for example, OS level pipe buffers filling up and stalling child process
these can be documented in a "Common Errors" section and cross-referenced
rather than repeated for every affected interface.
+
.. _code-examples:
Code examples
@@ -259,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
================
@@ -283,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
========
@@ -304,6 +334,7 @@ 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
===================
diff --git a/documentation/translating.rst b/documentation/translating.rst
deleted file mode 100644
index 12aea204e..000000000
--- a/documentation/translating.rst
+++ /dev/null
@@ -1,234 +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 `__)
- - :github:`GitHub `,
- `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..4240382b9
--- /dev/null
+++ b/documentation/translations/coordinating.rst
@@ -0,0 +1,172 @@
+============
+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 team member, they have 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..0c2202670
--- /dev/null
+++ b/documentation/translations/translating.rst
@@ -0,0 +1,288 @@
+.. _translating:
+
+===========
+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 `,
+ `Transifex `_
+
+
+How to get help
+===============
+
+If there is already a repository for your language team (there may be links to
+Telegrams/Discords in the ``README``), join and introduce
+yourself. Your fellow translators will be more than happy to help!
+General discussions about translations occur on the Python Docs Discord
+`#translations channel `_, `translation
+mailing list `_, and the `translations category <_discourse>`_
+of the Python Discourse.
+
+
+Style guide
+===========
+
+Before translating, you should familiarize yourself with the general
+documentation :doc:`style guide<../style-guide>`. Some translation-specific
+guidelines are explained below.
+
+
+Translate the meaning
+---------------------
+
+Try to stay as close as possible to the original text. Focus on translating its
+meaning in the best possible way.
+
+
+Gender neutrality
+-----------------
+
+Many languages use grammatical gender. When possible and natural, prefer
+gender-neutral or inclusive forms. Aim to reflect the inclusive tone of
+the English documentation.
+
+
+Roles and links
+---------------
+
+The Python docs contain many roles (``:role:`target```) that link to other parts
+of the documentation.
+Do not translate reStructuredText roles targets, such as ``:func:`print``` or
+``:ref:`some-section``` because it will break the link.
+If alternate text (``:role:`text ``` is provided, it generally
+should be translated. You can also introduce alternate text for translation if
+the target is not a name or term.
+
+Links (```text `_``) should be handled similarly. If possible, the target
+should be updated to match the language.
+
+.. seealso::
+ :doc:`../markup`
+
+
+Translation quality
+-------------------
+
+Translators should know both English and the language they are
+translating to. Translators should aim for a similar level of quality as that
+of the English documentation.
+
+Do not rely solely on machine translation. These tools can be useful to speed up
+work, but often produce inaccurate or misleading results and should be reviewed
+by a human.
+
+
+Terminology
+-----------
+
+The documentation is full of technical terms, some are common in general
+programming and have translations, whereas others are specific to Python
+and previous translations are not available.
+Translation teams should keep the translations of these terms
+consistent, which is done with glossaries.
+
+Some general guidelines for deciding on a translation:
+
+- Use existing community conventions over inventing new terms.
+- You can use a hybrid English form if users are generally familiar
+ with the English word.
+- For common terms, the English word may be best.
+- Use other translations as a reference as to what they did for the word.
+- Be careful to not translate names.
+- Use your best judgment.
+- When you translate a specific term, record it in your translations glossary to
+ help fellow translators and ensure consistency.
+
+
+Dialects
+--------
+
+Some translation receive contributions from people of several different dialects,
+understandably the language will differ. It is recommended however that
+translators try to keep files and sections consistent.
+
+
+Code examples
+-------------
+
+Translate values in code examples, that is string literals, and comments.
+Don't translate keywords or names, including variable, function, class, argument,
+and attribute names. An example of a translated codeblock from the `tutorial `_
+is provided below:
+
+.. code-block:: python
+
+ def cheeseshop(kind, *arguments, **keywords):
+ print("-- Czy jest moΕΌe", kind, "?")
+ print("-- Przykro mi, nie mamy juΕΌ sera", kind)
+ for arg in arguments:
+ print(arg)
+ print("-" * 40)
+ for kw in keywords:
+ print(kw, ":", keywords[kw])
+
+
+Transifex
+=========
+
+.. important::
+
+ There are many translations in the `python-doc organization on Transifex `_,
+ some of which, however, are not used or do not have a coordination team.
+ Confirm this is not the case before you begin translating.
+
+Several language projects use Transifex as their translation interface.
+Translations on Transifex are carried out via a web interface, similar to Weblate.
+You should translate the `python-newest `_ project.
+If you are new to Transifex, it is recommended that you take the time to read
+through the following resources from the Transifex documentation:
+
+- `Getting started as a translator `__:
+ This covers signing up for an account and joining a translation team.
+- `Translating with the Web Editor `__:
+ This covers getting to the editor, searching and filtering strings, and translating strings.
+- `Other Tools in the Editor `__:
+ This covers the history, glossary, comments, keyboard shortcuts, and more.
+- `Starting with the basics `__:
+ A group of documents with basic information.
+
+For further information about Transifex see our `documentation `_.
+
+
+Pull requests
+=============
+
+Several translations accept contributions by pull requests. Most have their
+own guide for how to do this, and for general tips see our :ref:`git-boot-camp`.
+
+
+Translation FAQ
+===============
+
+Which version of the Python documentation should I work on?
+-----------------------------------------------------------
+
+You should work on the latest branch available to you for translation (this should
+be the latest non-alpha branch), the translations should then be propagated by
+your languages coordination team.
+
+
+The coordination team for my language is inactive, what do I do?
+----------------------------------------------------------------
+
+If you would like to coordinate, open a pull request in the
+`devguide `_ adding yourself, and ping
+``@python/editorial-board``.
+
+
+.. _translation_ml: https://mail.python.org/mailman3/lists/translation.python.org/
+.. _discourse: https://discuss.python.org/c/documentation/translations/
+.. _tx: https://explore.transifex.com/python-doc/python-newest/
diff --git a/getting-started/fixing-issues.rst b/getting-started/fixing-issues.rst
index 6161f4aa6..f277cbf60 100644
--- a/getting-started/fixing-issues.rst
+++ b/getting-started/fixing-issues.rst
@@ -6,7 +6,7 @@ Fixing "easy" issues (and beyond)
=================================
When you feel comfortable enough to want to help tackle issues by trying to
-create a patch to fix an issue, you can start by looking at the `"easy"
+create a pull request to fix an issue, you can start by looking at the `"easy"
issues`_. These issues *should* be ones where it should take no longer than a
day or weekend to fix. But because the "easy" classification is typically done
at triage time it can turn out to be inaccurate, so do feel free to leave a
@@ -17,11 +17,9 @@ are not considered easy and try to fix those. It must be warned, though, that
it is quite possible that a bug that has been left open has been left into that
state because of the difficulty compared to the benefit of the fix. It could
also still be open because no consensus has been reached on how to fix the
-issue (although having a patch that proposes a fix can turn the tides of the
-discussion to help bring it to a close). Regardless of why the issue is open,
+issue, although having a pull request that proposes a fix can turn the tides of the
+discussion to help bring it to a close. Regardless of why the issue is open,
you can also always provide useful comments if you do attempt a fix, successful
or not.
.. _"easy" issues: https://github.com/python/cpython/issues?q=is%3Aissue+is%3Aopen+label%3Aeasy
-
-.. TODO: add something about no active core developer for the area?
diff --git a/getting-started/generative-ai.rst b/getting-started/generative-ai.rst
new file mode 100644
index 000000000..90fe020f3
--- /dev/null
+++ b/getting-started/generative-ai.rst
@@ -0,0 +1,26 @@
+.. _generative-ai:
+
+=============
+Generative AI
+=============
+
+Generative AI has evolved rapidly over the past decade and will continue in the future.
+Using generative AI and large language models (LLMs) can be helpful tools for contributors.
+Their overuse can also be problematic, such as generation of incorrect code, inaccurate documentation, and unneeded code churn.
+Discretion, good judgement, and critical thinking **must** be used when opening issues and pull requests.
+
+Acceptable uses
+===============
+
+Some of the acceptable uses of generative AI include:
+
+- Assistance with writing comments, especially in a non-native language
+- Gaining understanding of existing code
+- Supplementing contributor knowledge for code, tests, and documentation
+
+Unacceptable uses
+=================
+
+Maintainers may close issues and PRs that are not useful or productive, including
+those that are fully generated by AI. If a contributor repeatedly opens unproductive
+issues or PRs, they may be blocked.
diff --git a/getting-started/getting-help.rst b/getting-started/getting-help.rst
index 4e993a1e9..fc289fd44 100644
--- a/getting-started/getting-help.rst
+++ b/getting-started/getting-help.rst
@@ -5,7 +5,7 @@ Where to get help
=================
If you are working on Python it is very possible you will come across an issue
-where you need some assistance to solve it (this happens to core developers
+where you need some assistance to solve it (this happens to the core team
all the time).
Should you require help, there are a :ref:`variety of options available
@@ -37,31 +37,12 @@ Those particularly relevant for help contributing to Python itself include:
.. _Ideas: https://discuss.python.org/c/ideas/6
-.. _help-mailing-lists:
-
-Mailing lists
--------------
-
-Further options for seeking assistance include the
-`python-ideas`_ and `python-dev`_ mailing lists,
-which correspond to the `Ideas`_ and `Core Development`_
-:ref:`help-discourse` categories, respectively.
-The Discourse categories are generally more active
-and are the preferred venue for new discussions,
-but the mailing lists are still monitored and responded to.
-These mailing lists are for questions involving the
-development *of* Python, **not** for development *with* Python.
-
-.. _python-ideas: https://mail.python.org/mailman3/lists/python-ideas.python.org
-.. _python-dev: https://mail.python.org/mailman3/lists/python-dev.python.org/
-
-
Ask #python-dev
---------------
If you are comfortable with IRC you can try asking on ``#python-dev`` (on
the `Libera.Chat`_ network). Typically there are a number of experienced
-developers, ranging from triagers to core developers, who can answer
+contributors, ranging from triagers to the core team, who can answer
questions about developing for Python. As with the mailing lists,
``#python-dev`` is for questions involving the development *of* Python
whereas ``#python`` is for questions concerning development *with* Python.
@@ -79,7 +60,7 @@ Core mentorship
If you are interested in improving Python and contributing to its development,
but donβt yet feel entirely comfortable with the public channels mentioned
above, `Python Mentors`_ are here to help you. Python is fortunate to have a
-community of volunteer core developers willing to mentor anyone wishing to
+community of volunteer core team members willing to mentor anyone wishing to
contribute code, work on bug fixes or improve documentation. Everyone is
welcomed and encouraged to contribute.
diff --git a/getting-started/git-boot-camp.rst b/getting-started/git-boot-camp.rst
index b5465cdb7..87177840c 100644
--- a/getting-started/git-boot-camp.rst
+++ b/getting-started/git-boot-camp.rst
@@ -44,11 +44,13 @@ You will only need to do this once.
1. Go to https://github.com/python/cpython.
-2. Press ``Fork`` on the top right.
+2. Press :guilabel:`Fork` located near the top right of the page.
-3. When asked where to fork the repository, choose to fork it to your username.
+3. Uncheck "Copy the ``main`` branch only".
-4. Your forked CPython repository will be created at https://github.com//cpython.
+4. Press the :guilabel:`Create fork` button.
+
+5. Your forked CPython repository will be created at ``https://github.com//cpython``.
.. _clone-your-fork:
@@ -105,6 +107,10 @@ To verify the upstream for ``main``::
It should emit ``upstream``, indicating to track/pull changes for ``main`` from the
``upstream`` remote.
+Once this is verified, update your local clone with the upstream branches::
+
+ $ git fetch upstream
+
.. _set-up-name-email:
@@ -126,7 +132,7 @@ Enabling ``autocrlf`` on Windows
The ``autocrlf`` option will fix automatically any Windows-specific line endings.
This should be enabled on Windows, since the public repository has a hook which
-will reject all changesets having the wrong line endings::
+will reject all commits having the wrong line endings::
$ git config --global core.autocrlf input
@@ -304,7 +310,7 @@ Creating a pull request
1. Go to https://github.com/python/cpython.
-2. Press the ``New pull request`` button.
+2. Press the :guilabel:`New pull request` button.
3. Click the ``compare across forks`` link.
@@ -313,7 +319,7 @@ Creating a pull request
5. Select the head repository: ``/cpython`` and head branch: the branch
containing your changes.
-6. Press the ``Create pull request`` button.
+6. Press the :guilabel:`Create pull request` button.
You should include the issue number in the title of the PR,
in the format ``gh-NNNNN: ``.
@@ -335,7 +341,7 @@ example, backports to other branches), so this features is only useful if
you know for sure that a single PR is enough to address and close the issue.
.. _bedevere: https://github.com/python/bedevere
-.. _special keywords: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
+.. _special keywords: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
Updating your CPython fork
--------------------------
@@ -350,7 +356,7 @@ Scenario:
the upstream CPython repository.
Please do not try to solve this by creating a pull request from
-``python:main`` to ``:main`` as the authors of the patches will
+``python:main`` to ``:main`` as the authors of the pull requests will
get notified unnecessarily.
Solution::
@@ -429,8 +435,8 @@ Solution:
.. _git_pr:
-Downloading other's patches
----------------------------
+Checking out others' pull requests
+----------------------------------
Scenario:
@@ -480,14 +486,14 @@ can be merged. See :ref:`"Keeping CI green" ` for some
simple things you can do to help the checks turn green.
At any point, a core developer can schedule an automatic merge of the change
-by clicking the gray ``Enable auto-merge (squash)`` button. You will find
+by clicking the gray :guilabel:`Enable auto-merge (squash)` button. You will find
it at the bottom of the pull request page. The auto-merge will only
happen if all the required checks pass, but the PR does not need to have been
approved for a successful auto-merge to take place.
If all required checks are already finished on a PR you're reviewing,
-in place of the gray ``Enable auto-merge`` button you will find a green
-``Squash and merge`` button.
+in place of the gray :guilabel:`Enable auto-merge` button you will find a green
+:guilabel:`Squash and merge` button.
In either case, adjust and clean up the commit message.
@@ -520,7 +526,7 @@ PR life cycle, while being irrelevant to the final change.
`How to Write a Git Commit Message `_
is a nice article describing how to write a good commit message.
-Finally, press the ``Confirm squash and merge`` button.
+Finally, press the :guilabel:`Confirm squash and merge` button.
Cancelling an automatic merge
-----------------------------
@@ -529,7 +535,7 @@ If you notice a problem with a pull request that was accepted and where
auto-merge was enabled, you can still cancel the workflow before GitHub
automatically merges the change.
-Press the gray "Disable auto-merge" button on the bottom of the
+Press the gray :guilabel:`Disable auto-merge` button on the bottom of the
pull request page to disable automatic merging entirely. This is the
recommended approach.
diff --git a/getting-started/index.rst b/getting-started/index.rst
index 18f7d5cd5..05ee67a3b 100644
--- a/getting-started/index.rst
+++ b/getting-started/index.rst
@@ -1,3 +1,5 @@
+.. _getting-started:
+
===============
Getting started
===============
@@ -10,3 +12,4 @@ Getting started
git-boot-camp
pull-request-lifecycle
getting-help
+ generative-ai
diff --git a/getting-started/pull-request-lifecycle.rst b/getting-started/pull-request-lifecycle.rst
index 42b341281..fe810e90f 100644
--- a/getting-started/pull-request-lifecycle.rst
+++ b/getting-started/pull-request-lifecycle.rst
@@ -131,7 +131,7 @@ You should have already :ref:`set up your system `,
git commit -m ''
git push origin
- * If a core developer reviewing your PR pushed one or more commits to your
+ * If a core team member reviewing your PR pushed one or more commits to your
PR branch, then after checking out your branch and before editing, run::
git pull origin # pull = fetch + merge
@@ -204,7 +204,7 @@ should do to help ensure that your pull request is accepted.
#. **Make sure to follow Python's style guidelines.** For Python code you
should follow :PEP:`8`, and for C code you should follow :PEP:`7`. If you have
- one or two discrepancies those can be fixed by the core developer who merges
+ one or two discrepancies those can be fixed by the core team member who merges
your pull request. But if you have systematic deviations from the style guides
your pull request will be put on hold until you fix the formatting issues.
@@ -238,13 +238,32 @@ should do to help ensure that your pull request is accepted.
#. Proper :ref:`documentation ` additions/changes should be included.
+Copyrights
+==========
+
+Copyright notices are optional and informational, as international treaties
+have abolished the requirement for them to protect copyrights.
+However, they still serve an informative role.
+
+According to the US Copyright Office, valid copyright notices include the year
+of first publication of the work. For example:
+
+ Copyright (C) 2001 Python Software Foundation.
+
+Updating notices to add subsequent years is unnecessary and such PRs will be
+closed.
+
+See also `python/cpython#126133
+`__.
+
+
.. _patchcheck:
``patchcheck``
==============
-``patchcheck`` is a simple automated patch checklist that guides a developer
-through the common patch generation checks. To run ``patchcheck``:
+``patchcheck`` is a simple automated checklist for changes in progress that
+guides a developer through common checks. To run ``patchcheck``:
On *Unix* (including macOS)::
@@ -256,7 +275,7 @@ On *Windows* (after any successful build):
.\python.bat Tools\patchcheck\patchcheck.py
-The automated patch checklist runs through:
+The automated checklist runs through:
* Are there any whitespace problems in Python files?
(using :cpy-file:`Tools/patchcheck/reindent.py`)
@@ -271,10 +290,10 @@ The automated patch checklist runs through:
* Has ``configure`` been regenerated, if necessary?
* Has ``pyconfig.h.in`` been regenerated, if necessary?
-The automated patch check doesn't actually *answer* all of these
+The automated checks don't actually *answer* all of these
questions. Aside from the whitespace checks, the tool is
a memory aid for the various elements that can go into
-making a complete patch.
+making a complete pull request.
.. _good-commits:
@@ -305,7 +324,7 @@ Furthermore, the first line should not end in a period.
If this is not enough detail for a commit, a new paragraph(s) can be added
to explain in proper depth what has happened (detail should be good enough
-that a core developer reading the commit message understands the
+that a core team member reading the commit message understands the
justification for the change).
Check :ref:`the Git bootcamp ` for further
@@ -335,14 +354,14 @@ Here are the steps needed in order to sign the CLA:
1. Create a change and submit it as a pull request.
-2. When ``cpython-cla-bot`` comments on your pull request that commit
+2. When ``python-cla-bot`` comments on your pull request that commit
authors are required to sign a Contributor License Agreement, click
on the button in the comment to sign it. It's enough to log in through
GitHub. The process is automatic.
-3. After signing, the comment by ``cpython-cla-bot`` will update to
+3. After signing, the comment by ``python-cla-bot`` will update to
indicate that "all commit authors signed the Contributor License
- Agreement.
+ Agreement".
.. _PSF license: https://docs.python.org/dev/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
.. _contributor agreement: https://www.python.org/psf/contrib/
@@ -428,7 +447,7 @@ to ask for someone to review your pull request.
When someone does manage to find the time to look at your pull request
they will most likely make comments about how it can be improved
-(don't worry, even core developers of Python have their pull requests sent
+(don't worry, even core team members of Python have their pull requests sent
back to them for changes). It is then expected that you update your
pull request to address these comments, and the review process will
thus iterate until a satisfactory solution has emerged.
@@ -495,11 +514,13 @@ Instead of simply "approving" the pull request, leave comments. For example:
#. Look at any failures in CI on the current PR. See :ref:`"Keeping CI green"
` below for simple things you can do to help move the PR forward.
-Dismissing review from another core developer
----------------------------------------------
+.. _dismissing-review-from-another-core-developer:
+
+Dismissing review from another core team member
+-----------------------------------------------
-A core developer can dismiss another core developer's review if they confirmed
-that the requested changes have been made. When a core developer has assigned
+A core team member can dismiss another team member's review if they confirmed
+that the requested changes have been made. When a core team member has assigned
the PR to themselves, then it is a sign that they are actively looking after
the PR, and their review should not be dismissed.
@@ -531,9 +552,9 @@ will merge in the latest changes from the base branch into the PR.
If this still doesn't help with the failure on the PR, you can try
to re-run that particular failed check. Go to the red GitHub Action job,
-click on the "Re-run jobs" button on the top right, and select
-"Re-run failed jobs". The button will only be present when all other jobs
-finished running.
+click on the :guilabel:`Re-run jobs` button on the top right, and select
+:guilabel:`Re-run failed jobs`. The button will only be present when all other
+jobs finished running.
Re-running failed jobs shouldn't be your first instinct but it is occasionally
helpful because distributed systems can have intermittent failures, and
@@ -542,6 +563,22 @@ If you identify such flaky behavior, look for an issue in the `issue tracker`_
that describes this particular flakiness. Create a new issue if you can't
find one.
+:guilabel:`Update branch` button
+================================
+
+You can click on the :guilabel:`Update branch` button to merge the latest
+changes from the base branch (usually ``main``) into the PR.
+This is useful to :ref:`keep the CI green ` for old PRs,
+or to check if a CI failure has been fixed in the base branch.
+
+If the PR is very old, it may be useful to update the branch before merging to
+ensure that the PR does not fail any CI checks that were added or changed since
+CI last ran.
+
+Do not click :guilabel:`Update branch` without a good reason because it notifies
+everyone watching the PR that there are new changes, when there are not,
+and it uses up limited CI resources.
+
Committing/rejecting
====================
@@ -554,7 +591,7 @@ Python is tricky and we simply cannot accept everyone's contributions.
But if your pull request is merged it will then go into Python's
:abbr:`VCS (version control system)` to be released
with the next feature release of Python. It may also be backported to older
-versions of Python as a bugfix if the core developer doing the merge believes
+versions of Python as a bugfix if the core team member doing the merge believes
it is warranted.
@@ -563,7 +600,7 @@ Crediting
Non-trivial contributions are credited in the ``Misc/ACKS`` file (and, most
often, in a contribution's news entry as well). You may be
-asked to make these edits on the behalf of the core developer who
+asked to make these edits on the behalf of the core team member who
accepts your pull request.
.. _issue tracker: https://github.com/python/cpython/issues
diff --git a/getting-started/setup-building.rst b/getting-started/setup-building.rst
index 9960500e6..bd026ea71 100644
--- a/getting-started/setup-building.rst
+++ b/getting-started/setup-building.rst
@@ -36,6 +36,8 @@ and are provided for development and testing purposes only.
Install Git
===========
+.. c_install_git_start
+
CPython is developed using `Git `_ for version control. The Git
command line program is named ``git``; this is also used to refer to Git
itself. Git is easily available for all common operating systems.
@@ -43,11 +45,11 @@ itself. Git is easily available for all common operating systems.
- **Install**
As the CPython repo is hosted on GitHub, please refer to either the
- `GitHub setup instructions `_
+ `GitHub setup instructions `_
or the `Git project instructions `_ for step-by-step
installation directions. You may also want to consider a graphical client
such as `TortoiseGit `_ or
- `GitHub Desktop `_.
+ `GitHub Desktop `_.
- **Configure**
@@ -58,12 +60,15 @@ itself. Git is easily available for all common operating systems.
``git push``, or ``git fetch``. On Windows, you should also
:ref:`enable autocrlf