Skip to content

Commit 3dc1a9e

Browse files
committed
Merge branch 'main' into zero-count-table
2 parents 9a223e2 + 3eacfc1 commit 3dc1a9e

File tree

1,083 files changed

+39214
-21080
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,083 files changed

+39214
-21080
lines changed

.devcontainer/Dockerfile

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

33
ENV CC=clang
44

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

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=18.0.3
9+
ENV WASMTIME_VERSION=22.0.0
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

1212
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \

.github/CODEOWNERS

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
# Build system
1515
configure* @erlend-aasland @corona10
16+
Makefile.pre.in @erlend-aasland
17+
Modules/Setup* @erlend-aasland
1618

1719
# asyncio
1820
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
@@ -34,11 +36,13 @@ Python/ceval*.h @markshannon
3436
Python/compile.c @markshannon @iritkatriel
3537
Python/assemble.c @markshannon @iritkatriel
3638
Python/flowgraph.c @markshannon @iritkatriel
39+
Python/instruction_sequence.c @iritkatriel
3740
Python/ast_opt.c @isidentical
3841
Python/bytecodes.c @markshannon
3942
Python/optimizer*.c @markshannon
4043
Python/optimizer_analysis.c @Fidget-Spinner
4144
Python/optimizer_bytecodes.c @Fidget-Spinner
45+
Python/symtable.c @JelleZijlstra @carljm
4246
Lib/_pyrepl/* @pablogsal @lysnikolaou @ambv
4347
Lib/test/test_patma.py @brandtbucher
4448
Lib/test/test_type_*.py @JelleZijlstra
@@ -68,17 +72,15 @@ Include/internal/pycore_freelist.h @ericsnowcurrently
6872
Include/internal/pycore_global_objects.h @ericsnowcurrently
6973
Include/internal/pycore_obmalloc.h @ericsnowcurrently
7074
Include/internal/pycore_pymem.h @ericsnowcurrently
75+
Include/internal/pycore_stackref.h @Fidget-Spinner
7176
Modules/main.c @ericsnowcurrently
7277
Programs/_bootstrap_python.c @ericsnowcurrently
7378
Programs/python.c @ericsnowcurrently
7479
Tools/build/generate_global_objects.py @ericsnowcurrently
7580

7681
# Exceptions
77-
Lib/traceback.py @iritkatriel
7882
Lib/test/test_except*.py @iritkatriel
79-
Lib/test/test_traceback.py @iritkatriel
8083
Objects/exceptions.c @iritkatriel
81-
Python/traceback.c @iritkatriel
8284

8385
# Hashing
8486
**/*hashlib* @gpshead @tiran
@@ -155,10 +157,10 @@ Include/internal/pycore_time.h @pganssle @abalkin
155157
/Tools/cases_generator/ @markshannon
156158

157159
# AST
158-
Python/ast.c @isidentical
159-
Parser/asdl.py @isidentical
160-
Parser/asdl_c.py @isidentical
161-
Lib/ast.py @isidentical
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
162164

163165
# Mock
164166
/Lib/unittest/mock.py @cjw296
@@ -175,6 +177,10 @@ Lib/ast.py @isidentical
175177
/Lib/test/test_subprocess.py @gpshead
176178
/Modules/*subprocess* @gpshead
177179

180+
# debugger
181+
**/*pdb* @gaogaotiantian
182+
**/*bdb* @gaogaotiantian
183+
178184
# Limited C API & stable ABI
179185
Tools/build/stable_abi.py @encukou
180186
Misc/stable_abi.toml @encukou
@@ -196,7 +202,6 @@ Doc/c-api/stable.rst @encukou
196202
**/*itertools* @rhettinger
197203
**/*collections* @rhettinger
198204
**/*random* @rhettinger
199-
**/*queue* @rhettinger
200205
**/*bisect* @rhettinger
201206
**/*heapq* @rhettinger
202207
**/*functools* @rhettinger
@@ -207,6 +212,7 @@ Doc/c-api/stable.rst @encukou
207212
**/*ensurepip* @pfmoore @pradyunsg
208213

209214
**/*idlelib* @terryjreedy
215+
/Doc/library/idle.rst @terryjreedy
210216

211217
**/*typing* @JelleZijlstra @AlexWaygood
212218

@@ -242,7 +248,7 @@ Doc/howto/clinic.rst @erlend-aasland
242248
**/*interpreteridobject.* @ericsnowcurrently
243249
**/*crossinterp* @ericsnowcurrently
244250
Lib/test/support/interpreters/ @ericsnowcurrently
245-
Modules/_xx*interp*module.c @ericsnowcurrently
251+
Modules/_interp*module.c @ericsnowcurrently
246252
Lib/test/test_interpreters/ @ericsnowcurrently
247253

248254
# Android

.github/workflows/build.yml

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,31 @@ jobs:
2727
runs-on: ubuntu-latest
2828
timeout-minutes: 10
2929
outputs:
30+
# Some of the referenced steps set outputs conditionally and there may be
31+
# cases when referencing them evaluates to empty strings. It is nice to
32+
# work with proper booleans so they have to be evaluated through JSON
33+
# conversion in the expressions. However, empty strings used like that
34+
# may trigger all sorts of undefined and hard-to-debug behaviors in
35+
# GitHub Actions CI/CD. To help with this, all of the outputs set here
36+
# that are meant to be used as boolean flags (and not arbitrary strings),
37+
# MUST have fallbacks with default values set. A common pattern would be
38+
# to add ` || false` to all such expressions here, in the output
39+
# definitions. They can then later be safely used through the following
40+
# idiom in job conditionals and other expressions. Here's some examples:
41+
#
42+
# if: fromJSON(needs.check_source.outputs.run-docs)
43+
#
44+
# ${{
45+
# fromJSON(needs.check_source.outputs.run_tests)
46+
# && 'truthy-branch'
47+
# || 'falsy-branch'
48+
# }}
49+
#
3050
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
31-
run_tests: ${{ steps.check.outputs.run_tests }}
32-
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
33-
run_cifuzz: ${{ steps.check.outputs.run_cifuzz }}
34-
config_hash: ${{ steps.config_hash.outputs.hash }}
51+
run_tests: ${{ steps.check.outputs.run_tests || false }}
52+
run_hypothesis: ${{ steps.check.outputs.run_hypothesis || false }}
53+
run_cifuzz: ${{ steps.check.outputs.run_cifuzz || false }}
54+
config_hash: ${{ steps.config_hash.outputs.hash }} # str
3555
steps:
3656
- uses: actions/checkout@v4
3757
- name: Check for source changes
@@ -54,7 +74,7 @@ jobs:
5474
# into the PR branch anyway.
5575
#
5676
# https://github.com/python/core-workflow/issues/373
57-
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
77+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
5878
fi
5979
6080
# Check if we should run hypothesis tests
@@ -179,18 +199,24 @@ jobs:
179199
run: make check-c-globals
180200

181201
build_windows:
182-
name: 'Windows'
202+
name: >-
203+
Windows
204+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
183205
needs: check_source
184-
if: needs.check_source.outputs.run_tests == 'true'
185-
uses: ./.github/workflows/reusable-windows.yml
186-
187-
build_windows_free_threading:
188-
name: 'Windows (free-threading)'
189-
needs: check_source
190-
if: needs.check_source.outputs.run_tests == 'true'
206+
if: fromJSON(needs.check_source.outputs.run_tests)
207+
strategy:
208+
matrix:
209+
arch:
210+
- Win32
211+
- x64
212+
- arm64
213+
free-threading:
214+
- false
215+
- true
191216
uses: ./.github/workflows/reusable-windows.yml
192217
with:
193-
free-threading: true
218+
arch: ${{ matrix.arch }}
219+
free-threading: ${{ matrix.free-threading }}
194220

195221
build_macos:
196222
name: 'macOS'
@@ -199,8 +225,9 @@ jobs:
199225
uses: ./.github/workflows/reusable-macos.yml
200226
with:
201227
config_hash: ${{ needs.check_source.outputs.config_hash }}
202-
# macos-14 is M1, macos-13 is Intel
203-
os-matrix: '["macos-14", "macos-13"]'
228+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
229+
# Cirrus used for upstream, macos-14 for forks.
230+
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
204231

205232
build_macos_free_threading:
206233
name: 'macOS (free-threading)'
@@ -210,8 +237,9 @@ jobs:
210237
with:
211238
config_hash: ${{ needs.check_source.outputs.config_hash }}
212239
free-threading: true
213-
# macos-14-large is Intel with 12 cores (most parallelism)
214-
os-matrix: '["macos-14"]'
240+
# Cirrus and macos-14 are M1.
241+
# Cirrus used for upstream, macos-14 for forks.
242+
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
215243

216244
build_ubuntu:
217245
name: 'Ubuntu'
@@ -391,7 +419,7 @@ jobs:
391419
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
392420
key: hypothesis-database-${{ github.head_ref || github.run_id }}
393421
restore-keys: |
394-
- hypothesis-database-
422+
hypothesis-database-
395423
- name: "Run tests"
396424
working-directory: ${{ env.CPYTHON_BUILDDIR }}
397425
run: |
@@ -554,7 +582,6 @@ jobs:
554582
- build_ubuntu_ssltests
555583
- build_wasi
556584
- build_windows
557-
- build_windows_free_threading
558585
- test_hypothesis
559586
- build_asan
560587
- build_tsan
@@ -590,7 +617,6 @@ jobs:
590617
build_ubuntu_ssltests,
591618
build_wasi,
592619
build_windows,
593-
build_windows_free_threading,
594620
build_asan,
595621
build_tsan,
596622
build_tsan_free_threading,

.github/workflows/jit.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,15 @@ jobs:
133133
make all --jobs 4
134134
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
135135
136-
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
137136
- name: Native Linux
138137
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
139138
run: |
140139
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
141140
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
142-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations' }}
141+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
143142
make all --jobs 4
144143
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
145144
146-
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
147145
- name: Emulated Linux
148146
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
149147
# The --ignorefile on ./python -m test is used to exclude tests known to fail when running on an emulated Linux.
@@ -161,7 +159,7 @@ jobs:
161159
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
162160
CPP="$CC --preprocess" \
163161
HOSTRUNNER=qemu-${{ matrix.architecture }} \
164-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations ' }} --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
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
165163
make all --jobs 4
166164
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
167165

.github/workflows/reusable-macos.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
build_macos:
17-
name: 'build and test'
17+
name: build and test (${{ matrix.os }})
1818
timeout-minutes: 60
1919
env:
2020
HOMEBREW_NO_ANALYTICS: 1
@@ -27,6 +27,13 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ${{fromJson(inputs.os-matrix)}}
30+
is-fork:
31+
- ${{ github.repository_owner != 'python' }}
32+
exclude:
33+
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
34+
is-fork: true
35+
- os: "macos-14"
36+
is-fork: false
3037
runs-on: ${{ matrix.os }}
3138
steps:
3239
- uses: actions/checkout@v4

.github/workflows/reusable-wasi.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
timeout-minutes: 60
1212
runs-on: ubuntu-22.04
1313
env:
14-
WASMTIME_VERSION: 18.0.3
15-
WASI_SDK_VERSION: 21
14+
WASMTIME_VERSION: 22.0.0
15+
WASI_SDK_VERSION: 22
1616
WASI_SDK_PATH: /opt/wasi-sdk
1717
CROSS_BUILD_PYTHON: cross-build/build
1818
CROSS_BUILD_WASI: cross-build/wasm32-wasi
1919
steps:
2020
- uses: actions/checkout@v4
2121
# No problem resolver registered as one doesn't currently exist for Clang.
2222
- name: "Install wasmtime"
23-
uses: jcbhmr/setup-wasmtime@v2
23+
uses: bytecodealliance/actions/wasmtime/setup@v1
2424
with:
25-
wasmtime-version: ${{ env.WASMTIME_VERSION }}
25+
version: ${{ env.WASMTIME_VERSION }}
2626
- name: "Restore WASI SDK"
2727
id: cache-wasi-sdk
2828
uses: actions/cache@v4
@@ -50,8 +50,10 @@ jobs:
5050
uses: actions/cache@v4
5151
with:
5252
path: ${{ env.CROSS_BUILD_PYTHON }}/config.cache
53-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
54-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}-${{ env.pythonLocation }}
53+
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python.
54+
# Include the hash of `Tools/wasm/wasi.py` as it may change the environment variables.
55+
# (Make sure to keep the key in sync with the other config.cache step below.)
56+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
5557
- name: "Configure build Python"
5658
run: python3 Tools/wasm/wasi.py configure-build-python -- --config-cache --with-pydebug
5759
- name: "Make build Python"
@@ -60,8 +62,8 @@ jobs:
6062
uses: actions/cache@v4
6163
with:
6264
path: ${{ env.CROSS_BUILD_WASI }}/config.cache
63-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
64-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-wasi-sdk-${{ env.WASI_SDK_VERSION }}-${{ inputs.config_hash }}-${{ env.pythonLocation }}
65+
# Should be kept in sync with the other config.cache step above.
66+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
6567
- name: "Configure host"
6668
# `--with-pydebug` inferred from configure-build-python
6769
run: python3 Tools/wasm/wasi.py configure-host -- --config-cache

0 commit comments

Comments
 (0)