Skip to content

Commit 4ec550d

Browse files
committed
Merge branch 'main' into burn-posixsubprocess-with-ac
2 parents 7251169 + 2b6f5c3 commit 4ec550d

File tree

417 files changed

+20016
-12975
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

417 files changed

+20016
-12975
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM docker.io/library/fedora:37
2+
3+
ENV CC=clang
4+
5+
ENV WASI_SDK_VERSION=19
6+
ENV WASI_SDK_PATH=/opt/wasi-sdk
7+
8+
ENV WASMTIME_HOME=/opt/wasmtime
9+
ENV WASMTIME_VERSION=7.0.0
10+
ENV WASMTIME_CPU_ARCH=x86_64
11+
12+
RUN dnf -y --nodocs install git clang xz python3-blurb dnf-plugins-core && \
13+
dnf -y --nodocs builddep python3 && \
14+
dnf -y clean all
15+
16+
RUN mkdir ${WASI_SDK_PATH} && \
17+
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz | \
18+
tar --strip-components 1 --directory ${WASI_SDK_PATH} --extract --gunzip
19+
20+
RUN mkdir --parents ${WASMTIME_HOME} && \
21+
curl --location "https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-${WASMTIME_CPU_ARCH}-linux.tar.xz" | \
22+
xz --decompress | \
23+
tar --strip-components 1 --directory ${WASMTIME_HOME} -x && \
24+
ln -s ${WASMTIME_HOME}/wasmtime /usr/local/bin

.devcontainer/devcontainer.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"onCreateCommand": [
6+
// Install common tooling.
7+
"dnf",
8+
"install",
9+
"-y",
10+
"which",
11+
"zsh",
12+
"fish"
13+
],
14+
"updateContentCommand": {
15+
// Using the shell for `nproc` usage.
16+
"python": "./configure --config-cache --with-pydebug && make -s -j `nproc`",
17+
"docs": [
18+
"make",
19+
"--directory",
20+
"Doc",
21+
"venv",
22+
"html"
23+
]
24+
},
25+
"customizations": {
26+
"vscode": {
27+
"extensions": [
28+
// Highlighting for Parser/Python.asdl.
29+
"brettcannon.zephyr-asdl",
30+
// Highlighting for configure.ac.
31+
"maelvalais.autoconf",
32+
// C auto-complete.
33+
"ms-vscode.cpptools",
34+
// To view built docs.
35+
"ms-vscode.live-server"
36+
// https://github.com/microsoft/vscode-python/issues/18073
37+
// "ms-python.python"
38+
],
39+
"settings": {
40+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
41+
"C_Cpp.default.cStandard": "c11",
42+
"C_Cpp.default.defines": [
43+
"CONFIG_64",
44+
"Py_BUILD_CORE"
45+
],
46+
"C_Cpp.default.includePath": [
47+
"${workspaceFolder}/*",
48+
"${workspaceFolder}/Include/**"
49+
],
50+
// https://github.com/microsoft/vscode-cpptools/issues/10732
51+
"C_Cpp.errorSquiggles": "disabled",
52+
"editor.insertSpaces": true,
53+
"editor.rulers": [
54+
80
55+
],
56+
"editor.tabSize": 4,
57+
"editor.trimAutoWhitespace": true,
58+
"files.associations": {
59+
"*.h": "c"
60+
},
61+
"files.encoding": "utf8",
62+
"files.eol": "\n",
63+
"files.insertFinalNewline": true,
64+
"files.trimTrailingWhitespace": true,
65+
"python.analysis.diagnosticSeverityOverrides": {
66+
// Complains about shadowing the stdlib w/ the stdlib.
67+
"reportShadowedImports": "none",
68+
// Doesn't like _frozen_importlib.
69+
"reportMissingImports": "none"
70+
},
71+
"python.analysis.extraPaths": [
72+
"Lib"
73+
],
74+
"python.defaultInterpreterPath": "./python",
75+
"[restructuredtext]": {
76+
"editor.tabSize": 3
77+
}
78+
}
79+
}
80+
}
81+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Lib/test/test_importlib/resources/data01/* noeol
3232
Lib/test/test_importlib/resources/namespacedata01/* noeol
3333
Lib/test/xmltestdata/* noeol
3434

35+
# Shell scripts should have LF even on Windows because of Cygwin
36+
Lib/venv/scripts/common/activate text eol=lf
37+
3538
# CRLF files
3639
[attr]dos text eol=crlf
3740

.github/CODEOWNERS

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

77
# GitHub
8-
.github/** @ezio-melotti
8+
.github/** @ezio-melotti @hugovk
99

1010
# Build system
1111
configure* @erlend-aasland @corona10
@@ -61,11 +61,7 @@ Python/traceback.c @iritkatriel
6161
/Tools/build/parse_html5_entities.py @ezio-melotti
6262

6363
# Import (including importlib).
64-
# Ignoring importlib.h so as to not get flagged on
65-
# all pull requests that change the emitted
66-
# bytecode.
67-
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
68-
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
64+
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6965
**/*importlib/resources/* @jaraco @warsaw @FFY00
7066
**/importlib/metadata/* @jaraco @warsaw
7167

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
check_source:
3434
name: 'Check for source changes'
3535
runs-on: ubuntu-latest
36+
timeout-minutes: 10
3637
outputs:
3738
run_tests: ${{ steps.check.outputs.run_tests }}
3839
steps:
@@ -63,6 +64,7 @@ jobs:
6364
check_generated_files:
6465
name: 'Check if generated files are up to date'
6566
runs-on: ubuntu-latest
67+
timeout-minutes: 60
6668
needs: check_source
6769
if: needs.check_source.outputs.run_tests == 'true'
6870
steps:
@@ -118,6 +120,7 @@ jobs:
118120
build_win32:
119121
name: 'Windows (x86)'
120122
runs-on: windows-latest
123+
timeout-minutes: 60
121124
needs: check_source
122125
if: needs.check_source.outputs.run_tests == 'true'
123126
env:
@@ -126,7 +129,6 @@ jobs:
126129
- uses: actions/checkout@v3
127130
- name: Build CPython
128131
run: .\PCbuild\build.bat -e -d -p Win32
129-
timeout-minutes: 30
130132
- name: Display build info
131133
run: .\python.bat -m test.pythoninfo
132134
- name: Tests
@@ -135,6 +137,7 @@ jobs:
135137
build_win_amd64:
136138
name: 'Windows (x64)'
137139
runs-on: windows-latest
140+
timeout-minutes: 60
138141
needs: check_source
139142
if: needs.check_source.outputs.run_tests == 'true'
140143
env:
@@ -145,7 +148,6 @@ jobs:
145148
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
146149
- name: Build CPython
147150
run: .\PCbuild\build.bat -e -d -p x64
148-
timeout-minutes: 30
149151
- name: Display build info
150152
run: .\python.bat -m test.pythoninfo
151153
- name: Tests
@@ -154,6 +156,7 @@ jobs:
154156
build_macos:
155157
name: 'macOS'
156158
runs-on: macos-latest
159+
timeout-minutes: 60
157160
needs: check_source
158161
if: needs.check_source.outputs.run_tests == 'true'
159162
env:
@@ -184,6 +187,7 @@ jobs:
184187
build_ubuntu:
185188
name: 'Ubuntu'
186189
runs-on: ubuntu-20.04
190+
timeout-minutes: 60
187191
needs: check_source
188192
if: needs.check_source.outputs.run_tests == 'true'
189193
env:
@@ -241,6 +245,7 @@ jobs:
241245
build_ubuntu_ssltests:
242246
name: 'Ubuntu SSL tests with OpenSSL'
243247
runs-on: ubuntu-20.04
248+
timeout-minutes: 60
244249
needs: check_source
245250
if: needs.check_source.outputs.run_tests == 'true'
246251
strategy:
@@ -290,6 +295,7 @@ jobs:
290295
build_asan:
291296
name: 'Address sanitizer'
292297
runs-on: ubuntu-20.04
298+
timeout-minutes: 60
293299
needs: check_source
294300
if: needs.check_source.outputs.run_tests == 'true'
295301
env:

.github/workflows/build_msi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
build:
2727
name: Windows Installer
2828
runs-on: windows-latest
29+
timeout-minutes: 60
2930
strategy:
3031
matrix:
3132
type: [x86, x64, arm64]

.github/workflows/doc.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
build_doc:
3737
name: 'Docs'
3838
runs-on: ubuntu-latest
39+
timeout-minutes: 60
3940
steps:
4041
- uses: actions/checkout@v3
4142
- name: Register Sphinx problem matcher
@@ -53,10 +54,34 @@ jobs:
5354
- name: 'Build HTML documentation'
5455
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
5556

57+
# Add pull request annotations for Sphinx nitpicks (missing references)
58+
- name: 'Get list of changed files'
59+
id: changed_files
60+
uses: Ana06/get-changed-files@v2.2.0
61+
with:
62+
filter: "Doc/**"
63+
- name: 'Build changed files in nit-picky mode'
64+
continue-on-error: true
65+
run: |
66+
# Mark files the pull request modified
67+
touch ${{ steps.changed_files.outputs.added_modified }}
68+
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
69+
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
70+
python Doc/tools/warnings-to-gh-actions.py
71+
72+
# Ensure some files always pass Sphinx nit-picky mode (no missing references)
73+
- name: 'Build known-good files in nit-picky mode'
74+
run: |
75+
# Mark files that must pass nit-picky
76+
python Doc/tools/touch-clean-files.py
77+
# Build docs with the '-n' (nit-picky) option, convert warnings to errors (-W)
78+
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
79+
5680
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
5781
doctest:
5882
name: 'Doctest'
5983
runs-on: ubuntu-latest
84+
timeout-minutes: 60
6085
steps:
6186
- uses: actions/checkout@v3
6287
- name: Register Sphinx problem matcher

.github/workflows/new-bugs-announce-notifier.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
notify-new-bugs-announce:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 10
1415
steps:
1516
- uses: actions/setup-node@v3
1617
with:

.github/workflows/project-updater.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
add-to-project:
1414
name: Add issues to projects
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 10
1617
strategy:
1718
matrix:
1819
include:
@@ -22,7 +23,7 @@ jobs:
2223
- { project: 3, label: expert-subinterpreters }
2324
- { project: 29, label: expert-asyncio }
2425
- { project: 32, label: sprint }
25-
26+
2627
steps:
2728
- uses: actions/add-to-project@v0.1.0
2829
with:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Check labels
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, labeled, unlabeled, synchronize]
6+
7+
jobs:
8+
label:
9+
name: DO-NOT-MERGE
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
13+
steps:
14+
- uses: mheap/github-action-required-labels@v4
15+
with:
16+
mode: exactly
17+
count: 0
18+
labels: "DO-NOT-MERGE"

.github/workflows/stale.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ jobs:
1212
if: github.repository_owner == 'python'
1313

1414
runs-on: ubuntu-latest
15+
timeout-minutes: 10
1516

1617
steps:
1718
- name: "Check PRs"
18-
uses: actions/stale@v7
19+
uses: actions/stale@v8
1920
with:
2021
repo-token: ${{ secrets.GITHUB_TOKEN }}
2122
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'

.github/workflows/verify-ensurepip-wheels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ concurrency:
2323
jobs:
2424
verify:
2525
runs-on: ubuntu-latest
26+
timeout-minutes: 10
2627
steps:
2728
- uses: actions/checkout@v3
2829
- uses: actions/setup-python@v4

Doc/c-api/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Printing and clearing
8686
8787
An exception must be set when calling this function.
8888
89-
.. c:function: void PyErr_DisplayException(PyObject *exc)
89+
.. c:function:: void PyErr_DisplayException(PyObject *exc)
9090
9191
Print the standard traceback display of ``exc`` to ``sys.stderr``, including
9292
chained exceptions and notes.

Doc/c-api/weakref.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,13 @@ as much as it can.
6767
.. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
6868
6969
Similar to :c:func:`PyWeakref_GetObject`, but does no error checking.
70+
71+
72+
.. c:function:: void PyObject_ClearWeakRefs(PyObject *object)
73+
74+
This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler
75+
to clear weak references.
76+
77+
This iterates through the weak references for *object* and calls callbacks
78+
for those references which have one. It returns when all callbacks have
79+
been attempted.

Doc/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@
6868
# Minimum version of sphinx required
6969
needs_sphinx = '3.2'
7070

71+
# Ignore any .rst files in the includes/ directory;
72+
# they're embedded in pages but not rendered individually.
7173
# Ignore any .rst files in the venv/ directory.
72-
exclude_patterns = ['venv/*', 'README.rst']
74+
exclude_patterns = ['includes/*.rst', 'venv/*', 'README.rst']
7375
venvdir = os.getenv('VENVDIR')
7476
if venvdir is not None:
7577
exclude_patterns.append(venvdir + '/*')

Doc/extending/newtypes_tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ standard Python floats::
8888
The second bit is the definition of the type object. ::
8989

9090
static PyTypeObject CustomType = {
91-
PyVarObject_HEAD_INIT(NULL, 0)
91+
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
9292
.tp_name = "custom.Custom",
9393
.tp_doc = PyDoc_STR("Custom objects"),
9494
.tp_basicsize = sizeof(CustomObject),
@@ -109,7 +109,7 @@ common practice to not specify them explicitly unless you need them.
109109

110110
We're going to pick it apart, one field at a time::
111111

112-
PyVarObject_HEAD_INIT(NULL, 0)
112+
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
113113

114114
This line is mandatory boilerplate to initialize the ``ob_base``
115115
field mentioned above. ::

Doc/glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Glossary
214214
A callable is an object that can be called, possibly with a set
215215
of arguments (see :term:`argument`), with the following syntax::
216216

217-
callable(argument1, argument2, ...)
217+
callable(argument1, argument2, argumentN)
218218

219219
A :term:`function`, and by extension a :term:`method`, is a callable.
220220
An instance of a class that implements the :meth:`~object.__call__`

0 commit comments

Comments
 (0)