Skip to content

Commit 5c69280

Browse files
authored
Merge branch 'main' into hex-floatlit
2 parents 89a549c + f067efa commit 5c69280

File tree

1,175 files changed

+43227
-22843
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,175 files changed

+43227
-22843
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: 58 additions & 44 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,35 +237,25 @@ 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:
217-
name: 'Ubuntu'
218-
needs: check_source
219-
if: needs.check_source.outputs.run_tests == 'true'
220-
uses: ./.github/workflows/reusable-ubuntu.yml
221-
with:
222-
config_hash: ${{ needs.check_source.outputs.config_hash }}
223-
options: |
224-
../cpython-ro-srcdir/configure \
225-
--config-cache \
226-
--with-pydebug \
227-
--with-openssl=$OPENSSL_DIR
228-
229-
build_ubuntu_free_threading:
230-
name: 'Ubuntu (free-threading)'
245+
name: >-
246+
Ubuntu
247+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
231248
needs: check_source
232249
if: needs.check_source.outputs.run_tests == 'true'
250+
strategy:
251+
matrix:
252+
free-threading:
253+
- false
254+
- true
233255
uses: ./.github/workflows/reusable-ubuntu.yml
234256
with:
235257
config_hash: ${{ needs.check_source.outputs.config_hash }}
236-
options: |
237-
../cpython-ro-srcdir/configure \
238-
--config-cache \
239-
--with-pydebug \
240-
--with-openssl=$OPENSSL_DIR \
241-
--disable-gil
258+
free-threading: ${{ matrix.free-threading }}
242259

243260
build_ubuntu_ssltests:
244261
name: 'Ubuntu SSL tests with OpenSSL'
@@ -290,7 +307,7 @@ jobs:
290307
with:
291308
save: false
292309
- name: Configure CPython
293-
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
310+
run: ./configure --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
294311
- name: Build CPython
295312
run: make -j4
296313
- name: Display build info
@@ -363,6 +380,7 @@ jobs:
363380
../cpython-ro-srcdir/configure \
364381
--config-cache \
365382
--with-pydebug \
383+
--enable-slower-safety \
366384
--with-openssl=$OPENSSL_DIR
367385
- name: Build CPython out-of-tree
368386
working-directory: ${{ env.CPYTHON_BUILDDIR }}
@@ -391,7 +409,7 @@ jobs:
391409
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
392410
key: hypothesis-database-${{ github.head_ref || github.run_id }}
393411
restore-keys: |
394-
- hypothesis-database-
412+
hypothesis-database-
395413
- name: "Run tests"
396414
working-directory: ${{ env.CPYTHON_BUILDDIR }}
397415
run: |
@@ -550,11 +568,9 @@ jobs:
550568
- build_macos
551569
- build_macos_free_threading
552570
- build_ubuntu
553-
- build_ubuntu_free_threading
554571
- build_ubuntu_ssltests
555572
- build_wasi
556573
- build_windows
557-
- build_windows_free_threading
558574
- test_hypothesis
559575
- build_asan
560576
- build_tsan
@@ -586,11 +602,9 @@ jobs:
586602
build_macos,
587603
build_macos_free_threading,
588604
build_ubuntu,
589-
build_ubuntu_free_threading,
590605
build_ubuntu_ssltests,
591606
build_wasi,
592607
build_windows,
593-
build_windows_free_threading,
594608
build_asan,
595609
build_tsan,
596610
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: 9 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
@@ -46,6 +53,7 @@ jobs:
4653
./configure \
4754
--config-cache \
4855
--with-pydebug \
56+
--enable-slower-safety \
4957
${{ inputs.free-threading && '--disable-gil' || '' }} \
5058
--prefix=/opt/python-dev \
5159
--with-openssl="$(brew --prefix [email protected])"

.github/workflows/reusable-ubuntu.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
config_hash:
55
required: true
66
type: string
7-
options:
8-
required: true
9-
type: string
7+
free-threading:
8+
description: Whether to use free-threaded mode
9+
required: false
10+
type: boolean
11+
default: false
1012

1113
jobs:
1214
build_ubuntu_reusable:
@@ -63,7 +65,13 @@ jobs:
6365
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
6466
- name: Configure CPython out-of-tree
6567
working-directory: ${{ env.CPYTHON_BUILDDIR }}
66-
run: ${{ inputs.options }}
68+
run: >-
69+
../cpython-ro-srcdir/configure
70+
--config-cache
71+
--with-pydebug
72+
--enable-slower-safety
73+
--with-openssl=$OPENSSL_DIR
74+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
6775
- name: Build CPython out-of-tree
6876
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6977
run: make -j4

0 commit comments

Comments
 (0)