Skip to content

Commit 1274e2b

Browse files
committed
Merge branch 'main' into inlinecomp2
* main: (463 commits) pythongh-104057: Fix direct invocation of test_super (python#104064) pythongh-87092: Expose assembler to unit tests (python#103988) pythongh-97696: asyncio eager tasks factory (python#102853) pythongh-84436: Immortalize in _PyStructSequence_InitBuiltinWithFlags() (pythongh-104054) pythongh-104057: Fix direct invocation of test_module (pythonGH-104059) pythongh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11.rst (pythonGH-100387) pythongh-104018: disallow "z" format specifier in %-format of byte strings (pythonGH-104033) pythongh-104016: Fixed off by 1 error in f string tokenizer (python#104047) pythonGH-103629: Update Unpack's repr in compliance with PEP 692 (python#104048) pythongh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules (python#104032) Fix typo in "expected" word in few source files (python#104034) pythongh-103824: fix use-after-free error in Parser/tokenizer.c (python#103993) pythongh-104035: Do not ignore user-defined `__{get,set}state__` in slotted frozen dataclasses (python#104041) pythongh-104028: Reduce object creation while calling callback function from gc (pythongh-104030) pythongh-104036: Fix direct invocation of test_typing (python#104037) pythongh-102213: Optimize the performance of `__getattr__` (pythonGH-103761) pythongh-103895: Improve how invalid `Exception.__notes__` are displayed (python#103897) Adjust expression from `==` to `!=` in alignment with the meaning of the paragraph. (pythonGH-104021) pythongh-88496: Fix IDLE test hang on macOS (python#104025) Improve int test coverage (python#104024) ...
2 parents 1a8f4a0 + 605f878 commit 1274e2b

File tree

770 files changed

+38971
-23297
lines changed

Some content is hidden

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

770 files changed

+38971
-23297
lines changed

Diff for: .devcontainer/Dockerfile

+24
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 --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
13+
dnf -y --nodocs --setopt=install_weak_deps=False 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

Diff for: .devcontainer/devcontainer.json

+81
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+
}

Diff for: .gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ 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+
Lib/venv/scripts/posix/* text eol=lf
38+
3539
# CRLF files
3640
[attr]dos text eol=crlf
3741

Diff for: .github/CODEOWNERS

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
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
1212

1313
# asyncio
14-
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303
14+
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
1515

1616
# Core
1717
**/*context* @1st1
@@ -25,6 +25,8 @@ Objects/frameobject.c @markshannon
2525
Objects/call.c @markshannon
2626
Python/ceval.c @markshannon
2727
Python/compile.c @markshannon @iritkatriel
28+
Python/assemble.c @markshannon @iritkatriel
29+
Python/flowgraph.c @markshannon @iritkatriel
2830
Python/ast_opt.c @isidentical
2931
Lib/test/test_patma.py @brandtbucher
3032
Lib/test/test_peepholer.py @brandtbucher
@@ -61,11 +63,7 @@ Python/traceback.c @iritkatriel
6163
/Tools/build/parse_html5_entities.py @ezio-melotti
6264

6365
# 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
66+
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6967
**/*importlib/resources/* @jaraco @warsaw @FFY00
7068
**/importlib/metadata/* @jaraco @warsaw
7169

Diff for: .github/workflows/build.yml

+12-2
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:
@@ -302,6 +308,10 @@ jobs:
302308
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
303309
- name: Install Dependencies
304310
run: sudo ./.github/workflows/posix-deps-apt.sh
311+
- name: Set up GCC-10 for ASAN
312+
uses: egor-tensin/setup-gcc@v1
313+
with:
314+
version: 10
305315
- name: Configure OpenSSL env vars
306316
run: |
307317
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV

Diff for: .github/workflows/build_msi.yml

+1
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]

Diff for: .github/workflows/doc.yml

+47
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,56 @@ 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+
if: github.event_name == 'pull_request'
60+
id: changed_files
61+
uses: Ana06/get-changed-files@v2.2.0
62+
with:
63+
filter: "Doc/**"
64+
- name: 'Build changed files in nit-picky mode'
65+
if: github.event_name == 'pull_request'
66+
continue-on-error: true
67+
run: |
68+
# Mark files the pull request modified
69+
touch ${{ steps.changed_files.outputs.added_modified }}
70+
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
71+
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
72+
python Doc/tools/warnings-to-gh-actions.py
73+
74+
# Ensure some files always pass Sphinx nit-picky mode (no missing references)
75+
- name: 'Build known-good files in nit-picky mode'
76+
run: |
77+
# Mark files that must pass nit-picky
78+
python Doc/tools/touch-clean-files.py
79+
# Build docs with the '-n' (nit-picky) option, convert warnings to errors (-W)
80+
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
81+
82+
# This build doesn't use problem matchers or check annotations
83+
# It also does not run 'make check', as sphinx-lint is not installed into the
84+
# environment.
85+
build_doc_oldest_supported_sphinx:
86+
name: 'Docs (Oldest Sphinx)'
87+
runs-on: ubuntu-latest
88+
timeout-minutes: 60
89+
steps:
90+
- uses: actions/checkout@v3
91+
- name: 'Set up Python'
92+
uses: actions/setup-python@v4
93+
with:
94+
python-version: '3.11' # known to work with Sphinx 3.2
95+
cache: 'pip'
96+
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
97+
- name: 'Install build dependencies'
98+
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
99+
- name: 'Build HTML documentation'
100+
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
101+
56102
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
57103
doctest:
58104
name: 'Doctest'
59105
runs-on: ubuntu-latest
106+
timeout-minutes: 60
60107
steps:
61108
- uses: actions/checkout@v3
62109
- name: Register Sphinx problem matcher

Diff for: .github/workflows/documentation-links.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Read the Docs PR preview
2+
# Automatically edits a pull request's descriptions with a link
3+
# to the documentation's preview on Read the Docs.
4+
5+
on:
6+
pull_request_target:
7+
types:
8+
- opened
9+
paths:
10+
- 'Doc/**'
11+
- '.github/workflows/doc.yml'
12+
13+
permissions:
14+
pull-requests: write
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
documentation-links:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: readthedocs/actions/preview@v1
25+
with:
26+
project-slug: "cpython-previews"
27+
single-version: "true"

Diff for: .github/workflows/new-bugs-announce-notifier.yml

+1
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:

Diff for: .github/workflows/project-updater.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ 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:
1920
# if an issue has any of these labels, it will be added
2021
# to the corresponding project
2122
- { project: 2, label: "release-blocker, deferred-blocker" }
22-
- { project: 3, label: expert-subinterpreters }
23-
- { project: 29, label: expert-asyncio }
2423
- { project: 32, label: sprint }
25-
24+
2625
steps:
2726
- uses: actions/add-to-project@v0.1.0
2827
with:

Diff for: .github/workflows/require-pr-label.yml

+18
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 / unresolved review
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, awaiting changes, awaiting change review"

0 commit comments

Comments
 (0)