Skip to content

Commit 82d0715

Browse files
Merge branch 'main' into fix-suggestion
2 parents 0330428 + 8db8fc9 commit 82d0715

File tree

292 files changed

+6482
-4221
lines changed

Some content is hidden

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

292 files changed

+6482
-4221
lines changed

.github/CODEOWNERS

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@
6363
.azure-pipelines/ @AA-Turner
6464

6565
# GitHub & related scripts
66-
.github/ @ezio-melotti @hugovk @AA-Turner @webknjaz
67-
Tools/build/compute-changes.py @AA-Turner @hugovk @webknjaz
68-
Tools/build/verify_ensurepip_wheels.py @AA-Turner @pfmoore @pradyunsg
66+
.github/ @ezio-melotti @hugovk @AA-Turner @webknjaz
67+
Tools/build/compute-changes.py @AA-Turner @hugovk @webknjaz
68+
Lib/test/test_tools/test_compute_changes.py @AA-Turner @hugovk @webknjaz
69+
Tools/build/verify_ensurepip_wheels.py @AA-Turner @pfmoore @pradyunsg
6970

7071
# Pre-commit
7172
.pre-commit-config.yaml @hugovk
@@ -110,6 +111,7 @@ Doc/tools/ @AA-Turner @hugovk
110111
.readthedocs.yml @AA-Turner
111112

112113
# Sections
114+
Doc/c-api/ @ZeroIntensity
113115
Doc/reference/ @willingc @AA-Turner
114116
Doc/whatsnew/ @AA-Turner
115117

@@ -293,10 +295,10 @@ Tools/jit/ @brandtbucher @savannahostrowski @diegorusso
293295
InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-Turner
294296

295297
# Lazy imports (PEP 810)
296-
Objects/lazyimportobject.c @twouters @DinoV @pablogsal
297-
Include/internal/pycore_lazyimportobject.h @twouters @DinoV @pablogsal
298-
Lib/test/test_import/test_lazy_imports.py @twouters @DinoV @pablogsal
299-
Lib/test/test_import/data/lazy_imports/ @twouters @DinoV @pablogsal
298+
Objects/lazyimportobject.c @yhg1s @DinoV @pablogsal
299+
Include/internal/pycore_lazyimportobject.h @yhg1s @DinoV @pablogsal
300+
Lib/test/test_import/test_lazy_imports.py @yhg1s @DinoV @pablogsal
301+
Lib/test/test_import/data/lazy_imports/ @yhg1s @DinoV @pablogsal
300302

301303
# Micro-op / μop / Tier 2 Optimiser
302304
Python/optimizer.c @markshannon @Fidget-Spinner

.github/workflows/jit.yml

Lines changed: 90 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: JIT
22
on:
33
pull_request:
4-
paths:
4+
paths: &paths
55
- '**jit**'
66
- 'Python/bytecodes.c'
77
- 'Python/optimizer*.c'
@@ -12,16 +12,7 @@ on:
1212
- '!**/*.md'
1313
- '!**/*.ini'
1414
push:
15-
paths:
16-
- '**jit**'
17-
- 'Python/bytecodes.c'
18-
- 'Python/optimizer*.c'
19-
- 'Python/executor_cases.c.h'
20-
- 'Python/optimizer_cases.c.h'
21-
- '**_testinternalcapi**'
22-
- '!Python/perf_jit_trampoline.c'
23-
- '!**/*.md'
24-
- '!**/*.ini'
15+
paths: *paths
2516
workflow_dispatch:
2617

2718
permissions:
@@ -33,12 +24,13 @@ concurrency:
3324

3425
env:
3526
FORCE_COLOR: 1
27+
LLVM_VERSION: 21
3628

3729
jobs:
3830
interpreter:
3931
name: Interpreter (Debug)
4032
runs-on: ubuntu-24.04
41-
timeout-minutes: 90
33+
timeout-minutes: 60
4234
steps:
4335
- uses: actions/checkout@v6
4436
with:
@@ -50,162 +42,163 @@ jobs:
5042
- name: Test tier two interpreter
5143
run: |
5244
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
53-
jit:
45+
46+
windows:
5447
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
55-
needs: interpreter
48+
5649
runs-on: ${{ matrix.runner }}
57-
timeout-minutes: 90
50+
timeout-minutes: 60
5851
strategy:
5952
fail-fast: false
6053
matrix:
6154
target:
6255
- i686-pc-windows-msvc/msvc
6356
- x86_64-pc-windows-msvc/msvc
6457
- aarch64-pc-windows-msvc/msvc
65-
- x86_64-apple-darwin/clang
66-
- aarch64-apple-darwin/clang
67-
- x86_64-unknown-linux-gnu/gcc
68-
- aarch64-unknown-linux-gnu/gcc
6958
debug:
7059
- true
7160
- false
72-
llvm:
73-
- 21
7461
include:
7562
- target: i686-pc-windows-msvc/msvc
7663
architecture: Win32
77-
runner: windows-2025
64+
runner: windows-2025-vs2026
7865
- target: x86_64-pc-windows-msvc/msvc
7966
architecture: x64
80-
runner: windows-2025
67+
runner: windows-2025-vs2026
8168
- target: aarch64-pc-windows-msvc/msvc
8269
architecture: ARM64
8370
runner: windows-11-arm
84-
- target: x86_64-apple-darwin/clang
85-
architecture: x86_64
86-
runner: macos-15-intel
87-
- target: aarch64-apple-darwin/clang
88-
architecture: aarch64
89-
runner: macos-14
90-
- target: x86_64-unknown-linux-gnu/gcc
91-
architecture: x86_64
92-
runner: ubuntu-24.04
93-
- target: aarch64-unknown-linux-gnu/gcc
94-
architecture: aarch64
95-
runner: ubuntu-24.04-arm
9671
steps:
9772
- uses: actions/checkout@v6
9873
with:
9974
persist-credentials: false
10075
- uses: actions/setup-python@v6
10176
with:
10277
python-version: '3.11'
103-
10478
# PCbuild downloads LLVM automatically:
105-
- name: Windows
106-
if: runner.os == 'Windows'
79+
- name: Build
10780
run: |
10881
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
109-
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
110-
111-
- name: macOS
112-
if: runner.os == 'macOS'
82+
- name: Test
11383
run: |
114-
brew update
115-
brew install llvm@${{ matrix.llvm }}
116-
export SDKROOT="$(xcrun --show-sdk-path)"
117-
# Set MACOSX_DEPLOYMENT_TARGET and -Werror=unguarded-availability to
118-
# make sure we don't break downstream distributors (like uv):
119-
export CFLAGS_JIT='-Werror=unguarded-availability'
120-
export MACOSX_DEPLOYMENT_TARGET=10.15
121-
./configure --enable-experimental-jit --enable-universalsdk --with-universal-archs=universal2 ${{ matrix.debug && '--with-pydebug' || '' }}
122-
make all --jobs 4
123-
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
84+
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
12485
125-
- name: Linux
126-
if: runner.os == 'Linux'
127-
run: |
128-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
129-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
130-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
131-
make all --jobs 4
132-
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
86+
macos:
87+
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
13388

134-
jit-with-disabled-gil:
135-
name: Free-Threaded (Debug)
136-
needs: interpreter
137-
runs-on: ubuntu-24.04
138-
timeout-minutes: 90
89+
runs-on: ${{ matrix.runner }}
90+
timeout-minutes: 60
13991
strategy:
14092
fail-fast: false
14193
matrix:
142-
llvm:
143-
- 21
94+
target:
95+
- x86_64-apple-darwin/clang
96+
- aarch64-apple-darwin/clang
97+
debug:
98+
- true
99+
- false
100+
include:
101+
- target: x86_64-apple-darwin/clang
102+
runner: macos-15-intel
103+
- target: aarch64-apple-darwin/clang
104+
runner: macos-14
144105
steps:
145106
- uses: actions/checkout@v6
146107
with:
147108
persist-credentials: false
148109
- uses: actions/setup-python@v6
149110
with:
150111
python-version: '3.11'
151-
- name: Build with JIT enabled and GIL disabled
112+
- name: Install LLVM
113+
run: |
114+
brew update
115+
brew install llvm@${{ env.LLVM_VERSION }}
116+
- name: Build
152117
run: |
153-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
154-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
155-
./configure --enable-experimental-jit --with-pydebug --disable-gil
118+
export SDKROOT="$(xcrun --show-sdk-path)"
119+
# Set MACOSX_DEPLOYMENT_TARGET and -Werror=unguarded-availability to
120+
# make sure we don't break downstream distributors (like uv):
121+
export CFLAGS_JIT='-Werror=unguarded-availability'
122+
export MACOSX_DEPLOYMENT_TARGET=10.15
123+
./configure --enable-experimental-jit --enable-universalsdk --with-universal-archs=universal2 ${{ matrix.debug && '--with-pydebug' || '' }}
156124
make all --jobs 4
157-
- name: Run tests
125+
- name: Test
158126
run: |
159-
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
160-
continue-on-error: true
127+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
161128
162-
no-opt-jit:
163-
name: JIT without optimizations (Debug)
164-
needs: interpreter
165-
runs-on: ubuntu-24.04
166-
timeout-minutes: 90
129+
linux:
130+
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
131+
132+
runs-on: ${{ matrix.runner }}
133+
timeout-minutes: 60
167134
strategy:
168135
fail-fast: false
169136
matrix:
170-
llvm:
171-
- 21
137+
target:
138+
- x86_64-unknown-linux-gnu/gcc
139+
- aarch64-unknown-linux-gnu/gcc
140+
debug:
141+
- true
142+
- false
143+
include:
144+
- target: x86_64-unknown-linux-gnu/gcc
145+
runner: ubuntu-24.04
146+
- target: aarch64-unknown-linux-gnu/gcc
147+
runner: ubuntu-24.04-arm
172148
steps:
173149
- uses: actions/checkout@v6
174150
with:
175151
persist-credentials: false
176152
- uses: actions/setup-python@v6
177153
with:
178154
python-version: '3.11'
179-
- name: Build with JIT
155+
- name: Build
180156
run: |
181-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
182-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
183-
./configure --enable-experimental-jit --with-pydebug
157+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
158+
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
159+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
184160
make all --jobs 4
185-
- name: Run tests without optimizations
161+
- name: Test
186162
run: |
187-
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
164+
165+
linux-extras:
166+
name: ${{ matrix.name }}
188167

189-
tail-call-jit:
190-
name: JIT with tail calling interpreter
191-
needs: interpreter
192168
runs-on: ubuntu-24.04
193-
timeout-minutes: 90
169+
timeout-minutes: 60
194170
strategy:
195171
fail-fast: false
196172
matrix:
197-
llvm:
198-
- 21
173+
include:
174+
- name: Free-Threaded (Debug)
175+
configure_flags: --enable-experimental-jit --with-pydebug --disable-gil
176+
continue_on_error: true
177+
- name: JIT without optimizations (Debug)
178+
configure_flags: --enable-experimental-jit --with-pydebug
179+
test_env: "PYTHON_UOPS_OPTIMIZE=0"
180+
- name: JIT with tail calling interpreter
181+
configure_flags: --enable-experimental-jit --with-tail-call-interp --with-pydebug
182+
use_clang: true
183+
run_tests: false
199184
steps:
200185
- uses: actions/checkout@v6
201186
with:
202187
persist-credentials: false
203188
- uses: actions/setup-python@v6
204189
with:
205190
python-version: '3.11'
206-
- name: Build with JIT and tailcall
191+
- name: Build
207192
run: |
208-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
209-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
210-
CC=clang-${{ matrix.llvm }} ./configure --enable-experimental-jit --with-tail-call-interp --with-pydebug
193+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
194+
export PATH="$(llvm-config-${{ env.LLVM_VERSION }} --bindir):$PATH"
195+
if [ "${{ matrix.use_clang }}" = "true" ]; then
196+
export CC=clang-${{ env.LLVM_VERSION }}
197+
fi
198+
./configure ${{ matrix.configure_flags }}
211199
make all --jobs 4
200+
- name: Test
201+
if: matrix.run_tests != false
202+
run: |
203+
${{ matrix.test_env }} ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
204+
continue-on-error: ${{ matrix.continue_on_error }}

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
build:
1919
name: installer for ${{ inputs.arch }}
20-
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
20+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025-vs2026' }}
2121
timeout-minutes: 60
2222
env:
2323
ARCH: ${{ inputs.arch }}

.github/workflows/reusable-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ env:
2121
jobs:
2222
build:
2323
name: Build and test (${{ inputs.arch }})
24-
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
24+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-2025-vs2026' }}
2525
timeout-minutes: 60
2626
env:
2727
ARCH: ${{ inputs.arch }}

.github/workflows/tail-call.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
- name: Build
5252
shell: pwsh
5353
run: |
54-
$env:PlatformToolset = "v145"
5554
./PCbuild/build.bat --tail-call-interp ${{ matrix.build_flags }} -c Release -p ${{ matrix.architecture }}
5655
- name: Test
5756
if: matrix.run_tests

Doc/c-api/buffer.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
Buffer Protocol
1111
---------------
1212

13-
.. sectionauthor:: Greg Stein <gstein@lyra.org>
14-
.. sectionauthor:: Benjamin Peterson
15-
.. sectionauthor:: Stefan Krah
16-
17-
1813
Certain objects available in Python wrap access to an underlying memory
1914
array or *buffer*. Such objects include the built-in :class:`bytes` and
2015
:class:`bytearray`, and some extension types like :class:`array.array`.

Doc/c-api/code.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
Code Objects
88
------------
99

10-
.. sectionauthor:: Jeffrey Yasskin <jyasskin@gmail.com>
11-
1210
Code objects are a low-level detail of the CPython implementation.
1311
Each one represents a chunk of executable code that hasn't yet been
1412
bound into a function.

Doc/c-api/dict.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ Dictionary objects
5858
5959
Empty an existing dictionary of all key-value pairs.
6060
61+
Do nothing if the argument is not a :class:`dict` or a :class:`!dict`
62+
subclass.
63+
6164
6265
.. c:function:: int PyDict_Contains(PyObject *p, PyObject *key)
6366

0 commit comments

Comments
 (0)