Skip to content

Commit 529eff5

Browse files
itamarofacebook-github-bot
authored andcommitted
Merge upstream 3.12.8 release
Summary: This applies all upstream changes from upstream git commit `8e8a4baf652f6e1cee7acde9d78c4b6154539748` to `2dc476bcb9142cd25d7e1d52392b73a3dcdf1756`, which upgrades us from 3.12.4 to 3.12.8 Reviewed By: parulgupta1004, aleivag Differential Revision: D68864264 fbshipit-source-id: 3e6ba4815229c6e56ae2228f45eba7c606d9a82d
1 parent ce45664 commit 529eff5

File tree

824 files changed

+54973
-38447
lines changed

Some content is hidden

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

824 files changed

+54973
-38447
lines changed

.azure-pipelines/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
trigger: ['main', '3.12', '3.11', '3.10', '3.9', '3.8', '3.7']
1+
trigger: ['main', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
22

33
jobs:
44
- job: Prebuild
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

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Lib/ast.py @isidentical
141141
**/*dataclasses* @ericvsmith
142142

143143
**/*idlelib* @terryjreedy
144+
/Doc/library/idle.rst @terryjreedy
144145

145146
**/*typing* @gvanrossum @JelleZijlstra @AlexWaygood
146147

.github/workflows/build.yml

+134-95
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Tests
22

3-
# gh-84728: "paths-ignore" is not used to skip documentation-only PRs, because
4-
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
5-
# mandatory but not scheduled because of "paths-ignore".
63
on:
74
workflow_dispatch:
85
push:
@@ -31,70 +28,19 @@ concurrency:
3128

3229
jobs:
3330
check_source:
34-
name: 'Check for source changes'
35-
runs-on: ubuntu-latest
36-
timeout-minutes: 10
37-
outputs:
38-
run-docs: ${{ steps.docs-changes.outputs.run-docs || false }}
39-
run_tests: ${{ steps.check.outputs.run_tests }}
40-
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
41-
config_hash: ${{ steps.config_hash.outputs.hash }}
42-
steps:
43-
- uses: actions/checkout@v4
44-
- name: Check for source changes
45-
id: check
46-
run: |
47-
if [ -z "$GITHUB_BASE_REF" ]; then
48-
echo "run_tests=true" >> $GITHUB_OUTPUT
49-
else
50-
git fetch origin $GITHUB_BASE_REF --depth=1
51-
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
52-
# reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots),
53-
# but it requires to download more commits (this job uses
54-
# "git fetch --depth=1").
55-
#
56-
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) works with Git
57-
# 2.26, but Git 2.28 is stricter and fails with "no merge base".
58-
#
59-
# git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on
60-
# GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF
61-
# into the PR branch anyway.
62-
#
63-
# https://github.com/python/core-workflow/issues/373
64-
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
65-
fi
66-
67-
# Check if we should run hypothesis tests
68-
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
69-
echo $GIT_BRANCH
70-
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then
71-
echo "Branch too old for hypothesis tests"
72-
echo "run_hypothesis=false" >> $GITHUB_OUTPUT
73-
else
74-
echo "Run hypothesis tests"
75-
echo "run_hypothesis=true" >> $GITHUB_OUTPUT
76-
fi
77-
- name: Compute hash for config cache key
78-
id: config_hash
79-
run: |
80-
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT
81-
- name: Get a list of the changed documentation-related files
82-
if: github.event_name == 'pull_request'
83-
id: changed-docs-files
84-
uses: Ana06/[email protected]
85-
with:
86-
filter: |
87-
Doc/**
88-
Misc/**
89-
.github/workflows/reusable-docs.yml
90-
format: csv # works for paths with spaces
91-
- name: Check for docs changes
92-
if: >-
93-
github.event_name == 'pull_request'
94-
&& steps.changed-docs-files.outputs.added_modified_renamed != ''
95-
id: docs-changes
96-
run: |
97-
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
31+
name: Change detection
32+
# To use boolean outputs from this job, parse them as JSON.
33+
# Here's some examples:
34+
#
35+
# if: fromJSON(needs.check_source.outputs.run-docs)
36+
#
37+
# ${{
38+
# fromJSON(needs.check_source.outputs.run_tests)
39+
# && 'truthy-branch'
40+
# || 'falsy-branch'
41+
# }}
42+
#
43+
uses: ./.github/workflows/reusable-change-detection.yml
9844

9945
check-docs:
10046
name: Docs
@@ -145,6 +91,50 @@ jobs:
14591
name: abi-data
14692
path: ./Doc/data/*.abi
14793

94+
check_autoconf_regen:
95+
name: 'Check if Autoconf files are up to date'
96+
# Don't use ubuntu-latest but a specific version to make the job
97+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
98+
runs-on: ubuntu-24.04
99+
container:
100+
image: ghcr.io/python/autoconf:2024.10.16.11360930377
101+
timeout-minutes: 60
102+
needs: check_source
103+
if: needs.check_source.outputs.run_tests == 'true'
104+
steps:
105+
- name: Install Git
106+
run: |
107+
apt update && apt install git -yq
108+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
109+
- uses: actions/checkout@v4
110+
with:
111+
fetch-depth: 1
112+
- name: Runner image version
113+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
114+
- name: Check Autoconf and aclocal versions
115+
run: |
116+
grep "Generated by GNU Autoconf 2.71" configure
117+
grep "aclocal 1.16.5" aclocal.m4
118+
grep -q "runstatedir" configure
119+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
120+
- name: Regenerate autoconf files
121+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
122+
run: autoreconf -ivf -Werror
123+
- name: Check for changes
124+
run: |
125+
git add -u
126+
changes=$(git status --porcelain)
127+
# Check for changes in regenerated files
128+
if test -n "$changes"; then
129+
echo "Generated files not up to date."
130+
echo "Perhaps you forgot to run make regen-configure ;)"
131+
echo "configure files must be regenerated with a specific version of autoconf."
132+
echo "$changes"
133+
echo ""
134+
git diff --staged || true
135+
exit 1
136+
fi
137+
148138
check_generated_files:
149139
name: 'Check if generated files are up to date'
150140
# Don't use ubuntu-latest but a specific version to make the job
@@ -173,19 +163,10 @@ jobs:
173163
uses: hendrikmuhs/[email protected]
174164
with:
175165
save: false
176-
- name: Check Autoconf and aclocal versions
177-
run: |
178-
grep "Generated by GNU Autoconf 2.71" configure
179-
grep "aclocal 1.16.5" aclocal.m4
180-
grep -q "runstatedir" configure
181-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
182166
- name: Configure CPython
183167
run: |
184168
# Build Python with the libpython dynamic library
185169
./configure --config-cache --with-pydebug --enable-shared
186-
- name: Regenerate autoconf files
187-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
188-
run: autoreconf -ivf -Werror
189170
- name: Build CPython
190171
run: |
191172
# Deepfreeze will usually cause global objects to be added or removed,
@@ -216,45 +197,101 @@ jobs:
216197
run: make check-c-globals
217198

218199
build_windows:
219-
name: 'Windows'
200+
name: >-
201+
Windows
202+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
220203
needs: check_source
221-
if: needs.check_source.outputs.run_tests == 'true'
204+
if: fromJSON(needs.check_source.outputs.run_tests)
205+
strategy:
206+
matrix:
207+
arch:
208+
- Win32
209+
- x64
210+
- arm64
211+
free-threading:
212+
- false
213+
# - true
222214
uses: ./.github/workflows/reusable-windows.yml
215+
with:
216+
arch: ${{ matrix.arch }}
217+
free-threading: ${{ matrix.free-threading }}
218+
219+
build_windows_msi:
220+
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
221+
Windows MSI${{ '' }}
222+
needs: check_source
223+
if: fromJSON(needs.check_source.outputs.run-win-msi)
224+
strategy:
225+
matrix:
226+
arch:
227+
- x86
228+
- x64
229+
- arm64
230+
uses: ./.github/workflows/reusable-windows-msi.yml
231+
with:
232+
arch: ${{ matrix.arch }}
223233

224234
build_macos:
225-
name: 'macOS'
235+
name: >-
236+
macOS
237+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
226238
needs: check_source
227239
if: needs.check_source.outputs.run_tests == 'true'
240+
strategy:
241+
fail-fast: false
242+
matrix:
243+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
244+
# macOS 13 only runs tests against the GIL-enabled CPython.
245+
# Cirrus used for upstream, macos-14 for forks.
246+
os:
247+
- ghcr.io/cirruslabs/macos-runner:sonoma
248+
- macos-14
249+
- macos-13
250+
is-fork: # only used for the exclusion trick
251+
- ${{ github.repository_owner != 'python' }}
252+
free-threading:
253+
- false
254+
# - true
255+
exclude:
256+
- os: ghcr.io/cirruslabs/macos-runner:sonoma
257+
is-fork: true
258+
- os: macos-14
259+
is-fork: false
260+
- os: macos-13
261+
free-threading: true
228262
uses: ./.github/workflows/reusable-macos.yml
229263
with:
230264
config_hash: ${{ needs.check_source.outputs.config_hash }}
231-
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
232-
# Cirrus used for upstream, macos-14 for forks.
233-
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
265+
free-threading: ${{ matrix.free-threading }}
266+
os: ${{ matrix.os }}
234267

235268
build_ubuntu:
236-
name: 'Ubuntu'
269+
name: >-
270+
Ubuntu
271+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
237272
needs: check_source
238273
if: needs.check_source.outputs.run_tests == 'true'
274+
strategy:
275+
matrix:
276+
free-threading:
277+
- false
278+
# - true
239279
uses: ./.github/workflows/reusable-ubuntu.yml
240280
with:
241281
config_hash: ${{ needs.check_source.outputs.config_hash }}
242-
options: |
243-
../cpython-ro-srcdir/configure \
244-
--config-cache \
245-
--with-pydebug \
246-
--with-openssl=$OPENSSL_DIR
282+
free-threading: ${{ matrix.free-threading }}
247283

248284
build_ubuntu_ssltests:
249285
name: 'Ubuntu SSL tests with OpenSSL'
250-
runs-on: ubuntu-22.04
286+
runs-on: ${{ matrix.os }}
251287
timeout-minutes: 60
252288
needs: check_source
253289
if: needs.check_source.outputs.run_tests == 'true'
254290
strategy:
255291
fail-fast: false
256292
matrix:
257-
openssl_ver: [1.1.1w, 3.0.13, 3.1.5, 3.2.1]
293+
os: [ubuntu-22.04]
294+
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
258295
env:
259296
OPENSSL_VER: ${{ matrix.openssl_ver }}
260297
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -283,7 +320,7 @@ jobs:
283320
uses: actions/cache@v4
284321
with:
285322
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
286-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
323+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
287324
- name: Install OpenSSL
288325
if: steps.cache-openssl.outputs.cache-hit != 'true'
289326
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -310,7 +347,7 @@ jobs:
310347
needs: check_source
311348
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
312349
env:
313-
OPENSSL_VER: 3.0.13
350+
OPENSSL_VER: 3.0.15
314351
PYTHONSTRICTEXTENSIONBUILD: 1
315352
steps:
316353
- uses: actions/checkout@v4
@@ -388,7 +425,7 @@ jobs:
388425
path: ./hypothesis
389426
key: hypothesis-database-${{ github.head_ref || github.run_id }}
390427
restore-keys: |
391-
- hypothesis-database-
428+
hypothesis-database-
392429
- name: "Run tests"
393430
working-directory: ${{ env.CPYTHON_BUILDDIR }}
394431
run: |
@@ -423,7 +460,7 @@ jobs:
423460
needs: check_source
424461
if: needs.check_source.outputs.run_tests == 'true'
425462
env:
426-
OPENSSL_VER: 3.0.13
463+
OPENSSL_VER: 3.0.15
427464
PYTHONSTRICTEXTENSIONBUILD: 1
428465
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
429466
steps:
@@ -453,7 +490,7 @@ jobs:
453490
uses: actions/cache@v4
454491
with:
455492
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
456-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
493+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
457494
- name: Install OpenSSL
458495
if: steps.cache-openssl.outputs.cache-hit != 'true'
459496
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -495,6 +532,7 @@ jobs:
495532
- build_ubuntu
496533
- build_ubuntu_ssltests
497534
- build_windows
535+
- build_windows_msi
498536
- test_hypothesis
499537
- build_asan
500538
- build_tsan
@@ -508,6 +546,7 @@ jobs:
508546
allowed-failures: >-
509547
build_macos,
510548
build_ubuntu_ssltests,
549+
build_windows_msi,
511550
test_hypothesis,
512551
allowed-skips: >-
513552
${{

0 commit comments

Comments
 (0)