Skip to content

Commit 2449f59

Browse files
authored
Merge branch '3.13' into backport-ee1b8ce-3.13
2 parents 70d359b + ae3f347 commit 2449f59

File tree

1,060 files changed

+58052
-40109
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,060 files changed

+58052
-40109
lines changed

.azure-pipelines/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
displayName: Pre-build checks
66

77
pool:
8-
vmImage: ubuntu-22.04
8+
vmImage: ubuntu-24.04
99

1010
steps:
1111
- template: ./prebuild-checks.yml

.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/workflows/build.yml

Lines changed: 77 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
check_abi:
4444
name: 'Check if the ABI has changed'
45-
runs-on: ubuntu-latest
45+
runs-on: ubuntu-22.04 # 24.04 causes spurious errors
4646
needs: check_source
4747
if: needs.check_source.outputs.run_tests == 'true'
4848
steps:
@@ -83,11 +83,55 @@ jobs:
8383
name: abi-data
8484
path: ./Doc/data/*.abi
8585

86+
check_autoconf_regen:
87+
name: 'Check if Autoconf files are up to date'
88+
# Don't use ubuntu-latest but a specific version to make the job
89+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
90+
runs-on: ubuntu-24.04
91+
container:
92+
image: ghcr.io/python/autoconf:2024.10.16.11360930377
93+
timeout-minutes: 60
94+
needs: check_source
95+
if: needs.check_source.outputs.run_tests == 'true'
96+
steps:
97+
- name: Install Git
98+
run: |
99+
apt update && apt install git -yq
100+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
101+
- uses: actions/checkout@v4
102+
with:
103+
fetch-depth: 1
104+
- name: Runner image version
105+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
106+
- name: Check Autoconf and aclocal versions
107+
run: |
108+
grep "Generated by GNU Autoconf 2.71" configure
109+
grep "aclocal 1.16.5" aclocal.m4
110+
grep -q "runstatedir" configure
111+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
112+
- name: Regenerate autoconf files
113+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
114+
run: autoreconf -ivf -Werror
115+
- name: Check for changes
116+
run: |
117+
git add -u
118+
changes=$(git status --porcelain)
119+
# Check for changes in regenerated files
120+
if test -n "$changes"; then
121+
echo "Generated files not up to date."
122+
echo "Perhaps you forgot to run make regen-configure ;)"
123+
echo "configure files must be regenerated with a specific version of autoconf."
124+
echo "$changes"
125+
echo ""
126+
git diff --staged || true
127+
exit 1
128+
fi
129+
86130
check_generated_files:
87131
name: 'Check if generated files are up to date'
88132
# Don't use ubuntu-latest but a specific version to make the job
89133
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
90-
runs-on: ubuntu-22.04
134+
runs-on: ubuntu-24.04
91135
timeout-minutes: 60
92136
needs: check_source
93137
if: needs.check_source.outputs.run_tests == 'true'
@@ -112,19 +156,10 @@ jobs:
112156
uses: hendrikmuhs/ccache-action@v1.2
113157
with:
114158
save: false
115-
- name: Check Autoconf and aclocal versions
116-
run: |
117-
grep "Generated by GNU Autoconf 2.71" configure
118-
grep "aclocal 1.16.5" aclocal.m4
119-
grep -q "runstatedir" configure
120-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
121159
- name: Configure CPython
122160
run: |
123161
# Build Python with the libpython dynamic library
124162
./configure --config-cache --with-pydebug --enable-shared
125-
- name: Regenerate autoconf files
126-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
127-
run: autoreconf -ivf -Werror
128163
- name: Build CPython
129164
run: |
130165
make -j4 regen-all
@@ -158,16 +193,28 @@ jobs:
158193
needs: check_source
159194
if: fromJSON(needs.check_source.outputs.run_tests)
160195
strategy:
196+
fail-fast: false
161197
matrix:
198+
os:
199+
- windows-latest
162200
arch:
163-
- Win32
164-
- x64
165-
- arm64
201+
- x64
166202
free-threading:
167-
- false
168-
- true
203+
- false
204+
- true
205+
include:
206+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
207+
arch: arm64
208+
free-threading: false
209+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
210+
arch: arm64
211+
free-threading: true
212+
- os: windows-latest
213+
arch: Win32
214+
free-threading: false
169215
uses: ./.github/workflows/reusable-windows.yml
170216
with:
217+
os: ${{ matrix.os }}
171218
arch: ${{ matrix.arch }}
172219
free-threading: ${{ matrix.free-threading }}
173220

@@ -238,14 +285,15 @@ jobs:
238285

239286
build_ubuntu_ssltests:
240287
name: 'Ubuntu SSL tests with OpenSSL'
241-
runs-on: ubuntu-22.04
288+
runs-on: ${{ matrix.os }}
242289
timeout-minutes: 60
243290
needs: check_source
244291
if: needs.check_source.outputs.run_tests == 'true'
245292
strategy:
246293
fail-fast: false
247294
matrix:
248-
openssl_ver: [1.1.1w, 3.0.13, 3.1.5, 3.2.1]
295+
os: [ubuntu-24.04]
296+
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
249297
env:
250298
OPENSSL_VER: ${{ matrix.openssl_ver }}
251299
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -274,7 +322,7 @@ jobs:
274322
uses: actions/cache@v4
275323
with:
276324
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
277-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
325+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
278326
- name: Install OpenSSL
279327
if: steps.cache-openssl.outputs.cache-hit != 'true'
280328
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -304,12 +352,12 @@ jobs:
304352

305353
test_hypothesis:
306354
name: "Hypothesis tests on Ubuntu"
307-
runs-on: ubuntu-22.04
355+
runs-on: ubuntu-24.04
308356
timeout-minutes: 60
309357
needs: check_source
310358
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
311359
env:
312-
OPENSSL_VER: 3.0.13
360+
OPENSSL_VER: 3.0.15
313361
PYTHONSTRICTEXTENSIONBUILD: 1
314362
steps:
315363
- uses: actions/checkout@v4
@@ -417,12 +465,15 @@ jobs:
417465

418466
build_asan:
419467
name: 'Address sanitizer'
420-
runs-on: ubuntu-22.04
468+
runs-on: ${{ matrix.os }}
421469
timeout-minutes: 60
422470
needs: check_source
423471
if: needs.check_source.outputs.run_tests == 'true'
472+
strategy:
473+
matrix:
474+
os: [ubuntu-24.04]
424475
env:
425-
OPENSSL_VER: 3.0.13
476+
OPENSSL_VER: 3.0.15
426477
PYTHONSTRICTEXTENSIONBUILD: 1
427478
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
428479
steps:
@@ -452,7 +503,7 @@ jobs:
452503
uses: actions/cache@v4
453504
with:
454505
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
455-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
506+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
456507
- name: Install OpenSSL
457508
if: steps.cache-openssl.outputs.cache-hit != 'true'
458509
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -542,6 +593,7 @@ jobs:
542593
needs:
543594
- check_source # Transitive dependency, needed to access `run_tests` value
544595
- check-docs
596+
- check_autoconf_regen
545597
- check_generated_files
546598
- build_macos
547599
- build_ubuntu
@@ -577,6 +629,7 @@ jobs:
577629
${{
578630
needs.check_source.outputs.run_tests != 'true'
579631
&& '
632+
check_autoconf_regen,
580633
check_generated_files,
581634
build_macos,
582635
build_ubuntu,

.github/workflows/mypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- uses: actions/setup-python@v5
5555
with:
56-
python-version: "3.11"
56+
python-version: "3.13"
5757
cache: pip
5858
cache-dependency-path: Tools/requirements-dev.txt
5959
- run: pip install -r Tools/requirements-dev.txt

.github/workflows/posix-deps-apt.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/sh
22
apt-get update
33

4-
# autoconf-archive is needed by autoreconf (check_generated_files job)
54
apt-get -yq install \
65
build-essential \
76
pkg-config \
8-
autoconf-archive \
97
ccache \
108
gdb \
119
lcov \
@@ -15,7 +13,6 @@ apt-get -yq install \
1513
libgdbm-dev \
1614
libgdbm-compat-dev \
1715
liblzma-dev \
18-
libmpdec-dev \
1916
libncurses5-dev \
2017
libreadline6-dev \
2118
libsqlite3-dev \

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
2-
3-
name: Change detection
1+
name: Reusable change detection
42

53
on: # yamllint disable-line rule:truthy
64
workflow_call:
@@ -126,13 +124,18 @@ jobs:
126124
.github/workflows/reusable-docs.yml
127125
format: csv # works for paths with spaces
128126
- name: Check for docs changes
127+
# We only want to run this on PRs when related files are changed,
128+
# or when user triggers manual workflow run.
129129
if: >-
130-
github.event_name == 'pull_request'
131-
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
130+
(
131+
github.event_name == 'pull_request'
132+
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
133+
) || github.event_name == 'workflow_dispatch'
132134
id: docs-changes
133135
run: |
134136
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
135137
- name: Get a list of the MSI installer-related files
138+
if: github.event_name == 'pull_request'
136139
id: changed-win-msi-files
137140
uses: Ana06/get-changed-files@v2.3.0
138141
with:
@@ -141,10 +144,13 @@ jobs:
141144
.github/workflows/reusable-windows-msi.yml
142145
format: csv # works for paths with spaces
143146
- name: Check for changes in MSI installer-related files
147+
# We only want to run this on PRs when related files are changed,
148+
# or when user triggers manual workflow run.
144149
if: >-
145-
steps.changed-win-msi-files.outputs.added_modified_renamed != ''
150+
(
151+
github.event_name == 'pull_request'
152+
&& steps.changed-win-msi-files.outputs.added_modified_renamed != ''
153+
) || github.event_name == 'workflow_dispatch'
146154
id: win-msi-changes
147155
run: |
148156
echo "run-win-msi=true" >> "${GITHUB_OUTPUT}"
149-
150-
...

.github/workflows/reusable-docs.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docs
1+
name: Reusable Docs
22

33
on:
44
workflow_call:
@@ -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 )) \
@@ -75,7 +84,7 @@ jobs:
7584
- name: 'Set up Python'
7685
uses: actions/setup-python@v5
7786
with:
78-
python-version: '3.12' # known to work with Sphinx 6.2.1
87+
python-version: '3.13' # known to work with Sphinx 7.2.6
7988
cache: 'pip'
8089
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
8190
- name: 'Install build dependencies'
@@ -86,7 +95,7 @@ jobs:
8695
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
8796
doctest:
8897
name: 'Doctest'
89-
runs-on: ubuntu-latest
98+
runs-on: ubuntu-22.04
9099
timeout-minutes: 60
91100
steps:
92101
- uses: actions/checkout@v4

.github/workflows/reusable-macos.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable macOS
2+
13
on:
24
workflow_call:
35
inputs:
@@ -35,7 +37,10 @@ jobs:
3537
path: config.cache
3638
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
3739
- name: Install Homebrew dependencies
38-
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
40+
run: |
41+
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
42+
# Because alternate versions are not symlinked into place by default:
43+
brew link tcl-tk@8
3944
- name: Configure CPython
4045
run: |
4146
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

.github/workflows/reusable-tsan.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Thread Sanitizer
2+
13
on:
24
workflow_call:
35
inputs:
@@ -19,7 +21,7 @@ on:
1921
jobs:
2022
build_tsan_reusable:
2123
name: 'Thread sanitizer'
22-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
2325
timeout-minutes: 60
2426
steps:
2527
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)