Skip to content

Commit 1ac1202

Browse files
authored
Merge branch 'main' into patch-103820
2 parents b96e475 + e5b0db0 commit 1ac1202

904 files changed

Lines changed: 73279 additions & 48793 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV WASI_SDK_VERSION=20
66
ENV WASI_SDK_PATH=/opt/wasi-sdk
77

88
ENV WASMTIME_HOME=/opt/wasmtime
9-
ENV WASMTIME_VERSION=9.0.1
9+
ENV WASMTIME_VERSION=14.0.4
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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ Objects/type* @markshannon
2828
Objects/codeobject.c @markshannon
2929
Objects/frameobject.c @markshannon
3030
Objects/call.c @markshannon
31-
Python/ceval.c @markshannon
31+
Python/ceval*.c @markshannon @gvanrossum
32+
Python/ceval*.h @markshannon @gvanrossum
3233
Python/compile.c @markshannon @iritkatriel
3334
Python/assemble.c @markshannon @iritkatriel
3435
Python/flowgraph.c @markshannon @iritkatriel
3536
Python/ast_opt.c @isidentical
37+
Python/bytecodes.c @markshannon @gvanrossum
38+
Python/optimizer*.c @markshannon @gvanrossum
3639
Lib/test/test_patma.py @brandtbucher
3740
Lib/test/test_peepholer.py @brandtbucher
3841
Lib/test/test_type_*.py @JelleZijlstra
42+
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
3943

4044
# Exceptions
4145
Lib/traceback.py @iritkatriel
@@ -102,6 +106,9 @@ Include/internal/pycore_time.h @pganssle @abalkin
102106
/Lib/tokenize.py @pablogsal @lysnikolaou
103107
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
104108

109+
# Code generator
110+
/Tools/cases_generator/ @gvanrossum
111+
105112
# AST
106113
Python/ast.c @isidentical
107114
Parser/asdl.py @isidentical
@@ -151,7 +158,7 @@ Doc/c-api/stable.rst @encukou
151158

152159
**/*idlelib* @terryjreedy
153160

154-
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood
161+
**/*typing* @JelleZijlstra @AlexWaygood
155162

156163
**/*ftplib @giampaolo
157164
**/*shutil @giampaolo

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ body:
3939
- "3.10"
4040
- "3.11"
4141
- "3.12"
42+
- "3.13"
4243
- "CPython main branch"
4344
validations:
4445
required: true

.github/workflows/add-issue-header.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
permissions:
2020
issues: write
2121
steps:
22-
- uses: actions/github-script@v6
22+
- uses: actions/github-script@v7
2323
with:
2424
# language=JavaScript
2525
script: |

.github/workflows/build.yml

Lines changed: 56 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
- '3.10'
1414
- '3.9'
1515
- '3.8'
16-
- '3.7'
1716
pull_request:
1817
branches:
1918
- 'main'
@@ -22,7 +21,6 @@ on:
2221
- '3.10'
2322
- '3.9'
2423
- '3.8'
25-
- '3.7'
2624

2725
permissions:
2826
contents: read
@@ -122,20 +120,22 @@ jobs:
122120

123121
check_generated_files:
124122
name: 'Check if generated files are up to date'
125-
runs-on: ubuntu-latest
123+
# Don't use ubuntu-latest but a specific version to make the job
124+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
125+
runs-on: ubuntu-22.04
126126
timeout-minutes: 60
127127
needs: check_source
128128
if: needs.check_source.outputs.run_tests == 'true'
129129
steps:
130130
- uses: actions/checkout@v4
131+
- uses: actions/setup-python@v4
132+
with:
133+
python-version: '3.x'
131134
- name: Restore config.cache
132135
uses: actions/cache@v3
133136
with:
134137
path: config.cache
135-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
136-
- uses: actions/setup-python@v4
137-
with:
138-
python-version: '3.x'
138+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
139139
- name: Install Dependencies
140140
run: sudo ./.github/workflows/posix-deps-apt.sh
141141
- name: Add ccache to PATH
@@ -145,15 +145,16 @@ jobs:
145145
- name: Check Autoconf and aclocal versions
146146
run: |
147147
grep "Generated by GNU Autoconf 2.71" configure
148-
grep "aclocal 1.16.4" aclocal.m4
148+
grep "aclocal 1.16.5" aclocal.m4
149149
grep -q "runstatedir" configure
150150
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
151151
- name: Configure CPython
152152
run: |
153153
# Build Python with the libpython dynamic library
154154
./configure --config-cache --with-pydebug --enable-shared
155-
- name: Regenerate autoconf files with container image
156-
run: make regen-configure
155+
- name: Regenerate autoconf files
156+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
157+
run: autoreconf -ivf -Werror
157158
- name: Build CPython
158159
run: |
159160
make -j4 regen-all
@@ -180,159 +181,63 @@ jobs:
180181
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
181182
run: make check-c-globals
182183

183-
build_win32:
184-
name: 'Windows (x86)'
185-
runs-on: windows-latest
186-
timeout-minutes: 60
184+
build_windows:
185+
name: 'Windows'
187186
needs: check_source
188187
if: needs.check_source.outputs.run_tests == 'true'
189-
env:
190-
IncludeUwp: 'true'
191-
steps:
192-
- uses: actions/checkout@v4
193-
- name: Build CPython
194-
run: .\PCbuild\build.bat -e -d -p Win32
195-
- name: Display build info
196-
run: .\python.bat -m test.pythoninfo
197-
- name: Tests
198-
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
188+
uses: ./.github/workflows/reusable-windows.yml
199189

200-
build_win_amd64:
201-
name: 'Windows (x64)'
202-
runs-on: windows-latest
203-
timeout-minutes: 60
190+
build_windows_free_threaded:
191+
name: 'Windows (free-threaded)'
204192
needs: check_source
205193
if: needs.check_source.outputs.run_tests == 'true'
206-
env:
207-
IncludeUwp: 'true'
208-
steps:
209-
- uses: actions/checkout@v4
210-
- name: Register MSVC problem matcher
211-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
212-
- name: Build CPython
213-
run: .\PCbuild\build.bat -e -d -p x64
214-
- name: Display build info
215-
run: .\python.bat -m test.pythoninfo
216-
- name: Tests
217-
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
194+
uses: ./.github/workflows/reusable-windows.yml
195+
with:
196+
free-threaded: true
218197

219-
build_win_arm64:
220-
name: 'Windows (arm64)'
221-
runs-on: windows-latest
222-
timeout-minutes: 60
198+
build_macos:
199+
name: 'macOS'
223200
needs: check_source
224201
if: needs.check_source.outputs.run_tests == 'true'
225-
env:
226-
IncludeUwp: 'true'
227-
steps:
228-
- uses: actions/checkout@v4
229-
- name: Register MSVC problem matcher
230-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
231-
- name: Build CPython
232-
run: .\PCbuild\build.bat -e -d -p arm64
202+
uses: ./.github/workflows/reusable-macos.yml
203+
with:
204+
config_hash: ${{ needs.check_source.outputs.config_hash }}
233205

234-
build_macos:
235-
name: 'macOS'
236-
runs-on: macos-latest
237-
timeout-minutes: 60
206+
build_macos_free_threaded:
207+
name: 'macOS (free-threaded)'
238208
needs: check_source
239209
if: needs.check_source.outputs.run_tests == 'true'
240-
env:
241-
HOMEBREW_NO_ANALYTICS: 1
242-
HOMEBREW_NO_AUTO_UPDATE: 1
243-
HOMEBREW_NO_INSTALL_CLEANUP: 1
244-
PYTHONSTRICTEXTENSIONBUILD: 1
245-
steps:
246-
- uses: actions/checkout@v4
247-
- name: Restore config.cache
248-
uses: actions/cache@v3
249-
with:
250-
path: config.cache
251-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
252-
- name: Install Homebrew dependencies
253-
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
254-
- name: Configure CPython
255-
run: |
256-
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
257-
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
258-
./configure \
259-
--config-cache \
260-
--with-pydebug \
261-
--prefix=/opt/python-dev \
262-
--with-openssl="$(brew --prefix openssl@3.0)"
263-
- name: Build CPython
264-
run: make -j4
265-
- name: Display build info
266-
run: make pythoninfo
267-
- name: Tests
268-
run: make test
210+
uses: ./.github/workflows/reusable-macos.yml
211+
with:
212+
config_hash: ${{ needs.check_source.outputs.config_hash }}
213+
free-threaded: true
269214

270215
build_ubuntu:
271216
name: 'Ubuntu'
272-
runs-on: ubuntu-20.04
273-
timeout-minutes: 60
274217
needs: check_source
275218
if: needs.check_source.outputs.run_tests == 'true'
276-
env:
277-
OPENSSL_VER: 3.0.11
278-
PYTHONSTRICTEXTENSIONBUILD: 1
279-
steps:
280-
- uses: actions/checkout@v4
281-
- name: Register gcc problem matcher
282-
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
283-
- name: Install Dependencies
284-
run: sudo ./.github/workflows/posix-deps-apt.sh
285-
- name: Configure OpenSSL env vars
286-
run: |
287-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
288-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
289-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
290-
- name: 'Restore OpenSSL build'
291-
id: cache-openssl
292-
uses: actions/cache@v3
293-
with:
294-
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
295-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
296-
- name: Install OpenSSL
297-
if: steps.cache-openssl.outputs.cache-hit != 'true'
298-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
299-
- name: Add ccache to PATH
300-
run: |
301-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
302-
- name: Configure ccache action
303-
uses: hendrikmuhs/ccache-action@v1.2
304-
- name: Setup directory envs for out-of-tree builds
305-
run: |
306-
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
307-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
308-
- name: Create directories for read-only out-of-tree builds
309-
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
310-
- name: Bind mount sources read-only
311-
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
312-
- name: Restore config.cache
313-
uses: actions/cache@v3
314-
with:
315-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
316-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
317-
- name: Configure CPython out-of-tree
318-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
319-
run: |
219+
uses: ./.github/workflows/reusable-ubuntu.yml
220+
with:
221+
config_hash: ${{ needs.check_source.outputs.config_hash }}
222+
options: |
320223
../cpython-ro-srcdir/configure \
321224
--config-cache \
322225
--with-pydebug \
323226
--with-openssl=$OPENSSL_DIR
324-
- name: Build CPython out-of-tree
325-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
326-
run: make -j4
327-
- name: Display build info
328-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
329-
run: make pythoninfo
330-
- name: Remount sources writable for tests
331-
# some tests write to srcdir, lack of pyc files slows down testing
332-
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
333-
- name: Tests
334-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
335-
run: xvfb-run make test
227+
228+
build_ubuntu_free_threaded:
229+
name: 'Ubuntu (free-threaded)'
230+
needs: check_source
231+
if: needs.check_source.outputs.run_tests == 'true'
232+
uses: ./.github/workflows/reusable-ubuntu.yml
233+
with:
234+
config_hash: ${{ needs.check_source.outputs.config_hash }}
235+
options: |
236+
../cpython-ro-srcdir/configure \
237+
--config-cache \
238+
--with-pydebug \
239+
--with-openssl=$OPENSSL_DIR \
240+
--disable-gil
336241
337242
build_ubuntu_ssltests:
338243
name: 'Ubuntu SSL tests with OpenSSL'
@@ -598,12 +503,13 @@ jobs:
598503
- check_source # Transitive dependency, needed to access `run_tests` value
599504
- check-docs
600505
- check_generated_files
601-
- build_win32
602-
- build_win_amd64
603-
- build_win_arm64
604506
- build_macos
507+
- build_macos_free_threaded
605508
- build_ubuntu
509+
- build_ubuntu_free_threaded
606510
- build_ubuntu_ssltests
511+
- build_windows
512+
- build_windows_free_threaded
607513
- test_hypothesis
608514
- build_asan
609515
- cifuzz
@@ -615,10 +521,7 @@ jobs:
615521
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
616522
with:
617523
allowed-failures: >-
618-
build_macos,
619524
build_ubuntu_ssltests,
620-
build_win32,
621-
build_win_arm64,
622525
cifuzz,
623526
test_hypothesis,
624527
allowed-skips: >-
@@ -633,12 +536,13 @@ jobs:
633536
needs.check_source.outputs.run_tests != 'true'
634537
&& '
635538
check_generated_files,
636-
build_win32,
637-
build_win_amd64,
638-
build_win_arm64,
639539
build_macos,
540+
build_macos_free_threaded,
640541
build_ubuntu,
542+
build_ubuntu_free_threaded,
641543
build_ubuntu_ssltests,
544+
build_windows,
545+
build_windows_free_threaded,
642546
build_asan,
643547
'
644548
|| ''

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
paths:
1010
- ".github/workflows/mypy.yml"
11+
- "Lib/test/libregrtest/**"
1112
- "Tools/cases_generator/**"
1213
- "Tools/clinic/**"
1314
- "Tools/peg_generator/**"
@@ -32,6 +33,7 @@ jobs:
3233
strategy:
3334
matrix:
3435
target: [
36+
"Lib/test/libregrtest",
3537
"Tools/cases_generator",
3638
"Tools/clinic",
3739
"Tools/peg_generator",

0 commit comments

Comments
 (0)