Skip to content

Commit b896470

Browse files
authored
Merge branch 'main' into implement-119127-again
2 parents 8744bcb + 17a544b commit b896470

File tree

1,030 files changed

+69957
-43967
lines changed

Some content is hidden

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

1,030 files changed

+69957
-43967
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

5-
ENV WASI_SDK_VERSION=22
5+
ENV WASI_SDK_VERSION=24
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
@@ -14,7 +14,7 @@ RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,cla
1414
dnf -y clean all
1515

1616
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 | \
17+
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz | \
1818
tar --strip-components 1 --directory ${WASI_SDK_PATH} --extract --gunzip
1919

2020
RUN mkdir --parents ${WASMTIME_HOME} && \

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ Lib/test/cjkencodings/* noeol
2727
Lib/test/tokenizedata/coding20731.py noeol
2828
Lib/test/decimaltestdata/*.decTest noeol
2929
Lib/test/test_email/data/*.txt noeol
30-
Lib/test/test_importlib/resources/data01/* noeol
31-
Lib/test/test_importlib/resources/namespacedata01/* noeol
3230
Lib/test/xmltestdata/* noeol
3331

3432
# Shell scripts should have LF even on Windows because of Cygwin

.github/CODEOWNERS

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ Objects/frameobject.c @markshannon
3333
Objects/call.c @markshannon
3434
Python/ceval*.c @markshannon
3535
Python/ceval*.h @markshannon
36+
Python/codegen.c @markshannon @iritkatriel
3637
Python/compile.c @markshannon @iritkatriel
3738
Python/assemble.c @markshannon @iritkatriel
3839
Python/flowgraph.c @markshannon @iritkatriel
3940
Python/instruction_sequence.c @iritkatriel
40-
Python/ast_opt.c @isidentical
4141
Python/bytecodes.c @markshannon
4242
Python/optimizer*.c @markshannon
4343
Python/optimizer_analysis.c @Fidget-Spinner
@@ -157,10 +157,12 @@ Include/internal/pycore_time.h @pganssle @abalkin
157157
/Tools/cases_generator/ @markshannon
158158

159159
# AST
160-
Python/ast.c @isidentical @JelleZijlstra
161-
Parser/asdl.py @isidentical @JelleZijlstra
162-
Parser/asdl_c.py @isidentical @JelleZijlstra
163-
Lib/ast.py @isidentical @JelleZijlstra
160+
Python/ast.c @isidentical @JelleZijlstra @eclips4
161+
Python/ast_opt.c @isidentical @eclips4
162+
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
163+
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
164+
Lib/ast.py @isidentical @JelleZijlstra @eclips4
165+
Lib/test/test_ast/ @eclips4
164166

165167
# Mock
166168
/Lib/unittest/mock.py @cjw296
@@ -211,8 +213,9 @@ Doc/c-api/stable.rst @encukou
211213

212214
**/*ensurepip* @pfmoore @pradyunsg
213215

214-
**/*idlelib* @terryjreedy
215216
/Doc/library/idle.rst @terryjreedy
217+
**/*idlelib* @terryjreedy
218+
**/*turtledemo* @terryjreedy
216219

217220
**/*annotationlib* @JelleZijlstra
218221
**/*typing* @JelleZijlstra @AlexWaygood
@@ -275,3 +278,6 @@ Lib/test/test_interpreters/ @ericsnowcurrently
275278
# Config Parser
276279
Lib/configparser.py @jaraco
277280
Lib/test/test_configparser.py @jaraco
281+
282+
# Doc sections
283+
Doc/reference/ @willingc

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,15 @@ jobs:
195195

196196
build_ubuntu_ssltests:
197197
name: 'Ubuntu SSL tests with OpenSSL'
198-
runs-on: ubuntu-22.04
198+
runs-on: ${{ matrix.os }}
199199
timeout-minutes: 60
200200
needs: check_source
201201
if: needs.check_source.outputs.run_tests == 'true'
202202
strategy:
203203
fail-fast: false
204204
matrix:
205-
openssl_ver: [1.1.1w, 3.0.13, 3.1.5, 3.2.1]
205+
os: [ubuntu-22.04]
206+
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
206207
env:
207208
OPENSSL_VER: ${{ matrix.openssl_ver }}
208209
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -231,7 +232,7 @@ jobs:
231232
uses: actions/cache@v4
232233
with:
233234
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
234-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
235+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
235236
- name: Install OpenSSL
236237
if: steps.cache-openssl.outputs.cache-hit != 'true'
237238
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -266,7 +267,7 @@ jobs:
266267
needs: check_source
267268
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
268269
env:
269-
OPENSSL_VER: 3.0.13
270+
OPENSSL_VER: 3.0.15
270271
PYTHONSTRICTEXTENSIONBUILD: 1
271272
steps:
272273
- uses: actions/checkout@v4
@@ -380,7 +381,7 @@ jobs:
380381
needs: check_source
381382
if: needs.check_source.outputs.run_tests == 'true'
382383
env:
383-
OPENSSL_VER: 3.0.13
384+
OPENSSL_VER: 3.0.15
384385
PYTHONSTRICTEXTENSIONBUILD: 1
385386
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
386387
steps:
@@ -410,7 +411,7 @@ jobs:
410411
uses: actions/cache@v4
411412
with:
412413
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
413-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
414+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
414415
- name: Install OpenSSL
415416
if: steps.cache-openssl.outputs.cache-hit != 'true'
416417
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux

.github/workflows/jit.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,15 @@ jobs:
110110
- name: Native Windows
111111
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
112112
run: |
113-
choco upgrade llvm -y
114-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
113+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
115114
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
116115
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
117116
118117
# No PGO or tests (yet):
119118
- name: Emulated Windows
120119
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
121120
run: |
122-
choco upgrade llvm -y
123-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
121+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
124122
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
125123
126124
- name: Native macOS
@@ -159,7 +157,7 @@ jobs:
159157
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
160158
CPP="$CC --preprocess" \
161159
HOSTRUNNER=qemu-${{ matrix.architecture }} \
162-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
160+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
163161
make all --jobs 4
164162
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
165163

.github/workflows/reusable-change-detection.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,18 @@ jobs:
126126
.github/workflows/reusable-docs.yml
127127
format: csv # works for paths with spaces
128128
- name: Check for docs changes
129+
# We only want to run this on PRs when related files are changed,
130+
# or when user triggers manual workflow run.
129131
if: >-
130-
github.event_name == 'pull_request'
131-
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
132+
(
133+
github.event_name == 'pull_request'
134+
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
135+
) || github.event_name == 'workflow_dispatch'
132136
id: docs-changes
133137
run: |
134138
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
135139
- name: Get a list of the MSI installer-related files
140+
if: github.event_name == 'pull_request'
136141
id: changed-win-msi-files
137142
uses: Ana06/[email protected]
138143
with:
@@ -141,10 +146,13 @@ jobs:
141146
.github/workflows/reusable-windows-msi.yml
142147
format: csv # works for paths with spaces
143148
- name: Check for changes in MSI installer-related files
149+
# We only want to run this on PRs when related files are changed,
150+
# or when user triggers manual workflow run.
144151
if: >-
145-
steps.changed-win-msi-files.outputs.added_modified_renamed != ''
152+
(
153+
github.event_name == 'pull_request'
154+
&& steps.changed-win-msi-files.outputs.added_modified_renamed != ''
155+
) || github.event_name == 'workflow_dispatch'
146156
id: win-msi-changes
147157
run: |
148158
echo "run-win-msi=true" >> "${GITHUB_OUTPUT}"
149-
150-
...

.github/workflows/reusable-docs.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1212
cancel-in-progress: true
1313

14+
env:
15+
FORCE_COLOR: 1
16+
1417
jobs:
1518
build_doc:
1619
name: 'Docs'
@@ -25,9 +28,15 @@ jobs:
2528
- name: 'Check out latest PR branch commit'
2629
uses: actions/checkout@v4
2730
with:
28-
ref: ${{ github.event.pull_request.head.sha }}
31+
ref: >-
32+
${{
33+
github.event_name == 'pull_request'
34+
&& github.event.pull_request.head.sha
35+
|| ''
36+
}}
2937
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
3038
- name: 'Fetch commits to get branch diff'
39+
if: github.event_name == 'pull_request'
3140
run: |
3241
# Fetch enough history to find a common ancestor commit (aka merge-base):
3342
git fetch origin ${{ env.refspec_pr }} --depth=$(( ${{ github.event.pull_request.commits }} + 1 )) \

.github/workflows/reusable-macos.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
path: config.cache
3636
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
3737
- name: Install Homebrew dependencies
38-
run: brew install pkg-config [email protected] xz gdbm tcl-tk
38+
run: brew install pkg-config [email protected] xz gdbm tcl-tk make
3939
- name: Configure CPython
4040
run: |
4141
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
@@ -44,14 +44,27 @@ jobs:
4444
--config-cache \
4545
--with-pydebug \
4646
--enable-slower-safety \
47+
--enable-safety \
4748
${{ inputs.free-threading && '--disable-gil' || '' }} \
4849
--prefix=/opt/python-dev \
4950
--with-openssl="$(brew --prefix [email protected])"
5051
- name: Build CPython
51-
run: set -o pipefail; make -j8 2>&1 | tee compiler_output.txt
52+
if : ${{ inputs.free-threading || inputs.os != 'macos-13' }}
53+
run: gmake -j8
54+
- name: Build CPython for compiler warning check
55+
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
56+
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
5257
- name: Display build info
5358
run: make pythoninfo
5459
- name: Check compiler warnings
55-
run: python3 Tools/build/check_warnings.py --compiler-output-file-path=compiler_output.txt --warning-ignore-file-path=Tools/build/.warningignore_macos --compiler-output-type=clang
60+
if : ${{ !inputs.free-threading && inputs.os == 'macos-13' }}
61+
run: >-
62+
python3 Tools/build/check_warnings.py
63+
--compiler-output-file-path=compiler_output_macos.txt
64+
--warning-ignore-file-path=Tools/build/.warningignore_macos
65+
--compiler-output-type=clang
66+
--fail-on-regression
67+
--fail-on-improvement
68+
--path-prefix="./"
5669
- name: Tests
5770
run: make test

.github/workflows/reusable-ubuntu.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ jobs:
1414
build_ubuntu_reusable:
1515
name: 'build and test'
1616
timeout-minutes: 60
17-
runs-on: ubuntu-22.04
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-22.04]
1822
env:
1923
FORCE_COLOR: 1
20-
OPENSSL_VER: 3.0.13
24+
OPENSSL_VER: 3.0.15
2125
PYTHONSTRICTEXTENSIONBUILD: 1
2226
TERM: linux
2327
steps:
@@ -36,7 +40,7 @@ jobs:
3640
uses: actions/cache@v4
3741
with:
3842
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
39-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
43+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
4044
- name: Install OpenSSL
4145
if: steps.cache-openssl.outputs.cache-hit != 'true'
4246
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -67,20 +71,33 @@ jobs:
6771
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6872
run: >-
6973
../cpython-ro-srcdir/configure
70-
CFLAGS="-fdiagnostics-format=json"
7174
--config-cache
7275
--with-pydebug
7376
--enable-slower-safety
77+
--enable-safety
7478
--with-openssl=$OPENSSL_DIR
7579
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
7680
- name: Build CPython out-of-tree
81+
if: ${{ inputs.free-threading }}
7782
working-directory: ${{ env.CPYTHON_BUILDDIR }}
78-
run: set -o pipefail; make -j4 2>&1 | tee compiler_output.txt
83+
run: make -j4
84+
- name: Build CPython out-of-tree (for compiler warning check)
85+
if: ${{ !inputs.free-threading}}
86+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
87+
run: set -o pipefail; make -j4 --output-sync 2>&1 | tee compiler_output_ubuntu.txt
7988
- name: Display build info
8089
working-directory: ${{ env.CPYTHON_BUILDDIR }}
8190
run: make pythoninfo
8291
- name: Check compiler warnings
83-
run: python Tools/build/check_warnings.py --compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output.txt --warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu --compiler-output-type=json
92+
if: ${{ !inputs.free-threading }}
93+
run: >-
94+
python Tools/build/check_warnings.py
95+
--compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output_ubuntu.txt
96+
--warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu
97+
--compiler-output-type=gcc
98+
--fail-on-regression
99+
--fail-on-improvement
100+
--path-prefix="../cpython-ro-srcdir/"
84101
- name: Remount sources writable for tests
85102
# some tests write to srcdir, lack of pyc files slows down testing
86103
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-22.04
1313
env:
1414
WASMTIME_VERSION: 22.0.0
15-
WASI_SDK_VERSION: 22
15+
WASI_SDK_VERSION: 24
1616
WASI_SDK_PATH: /opt/wasi-sdk
1717
CROSS_BUILD_PYTHON: cross-build/build
1818
CROSS_BUILD_WASI: cross-build/wasm32-wasi
@@ -33,7 +33,7 @@ jobs:
3333
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
3434
run: |
3535
mkdir ${{ env.WASI_SDK_PATH }} && \
36-
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-linux.tar.gz | \
36+
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-x86_64-linux.tar.gz | \
3737
tar --strip-components 1 --directory ${{ env.WASI_SDK_PATH }} --extract --gunzip
3838
- name: "Configure ccache action"
3939
uses: hendrikmuhs/[email protected]

0 commit comments

Comments
 (0)