Skip to content

Commit 94b9221

Browse files
authored
Merge branch '3.13' into backport-128350
2 parents c41a1f9 + 98c25b8 commit 94b9221

File tree

710 files changed

+44546
-33565
lines changed

Some content is hidden

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

710 files changed

+44546
-33565
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,7 @@ Lib/test/test_interpreters/ @ericsnowcurrently
267267
# Config Parser
268268
Lib/configparser.py @jaraco
269269
Lib/test/test_configparser.py @jaraco
270+
271+
# Colorize
272+
Lib/_colorize.py @hugovk
273+
Lib/test/test__colorize.py @hugovk

.github/workflows/build.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
1919
cancel-in-progress: true
2020

21+
env:
22+
FORCE_COLOR: 1
23+
2124
jobs:
2225
check_source:
2326
name: Change detection
@@ -42,11 +45,13 @@ jobs:
4245

4346
check_abi:
4447
name: 'Check if the ABI has changed'
45-
runs-on: ubuntu-22.04
48+
runs-on: ubuntu-22.04 # 24.04 causes spurious errors
4649
needs: check_source
4750
if: needs.check_source.outputs.run_tests == 'true'
4851
steps:
4952
- uses: actions/checkout@v4
53+
with:
54+
persist-credentials: false
5055
- uses: actions/setup-python@v5
5156
- name: Install dependencies
5257
run: |
@@ -96,11 +101,12 @@ jobs:
96101
steps:
97102
- name: Install Git
98103
run: |
99-
apt install git -yq
104+
apt update && apt install git -yq
100105
git config --global --add safe.directory "$GITHUB_WORKSPACE"
101106
- uses: actions/checkout@v4
102107
with:
103108
fetch-depth: 1
109+
persist-credentials: false
104110
- name: Runner image version
105111
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
106112
- name: Check Autoconf and aclocal versions
@@ -131,12 +137,14 @@ jobs:
131137
name: 'Check if generated files are up to date'
132138
# Don't use ubuntu-latest but a specific version to make the job
133139
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
134-
runs-on: ubuntu-22.04
140+
runs-on: ubuntu-24.04
135141
timeout-minutes: 60
136142
needs: check_source
137143
if: needs.check_source.outputs.run_tests == 'true'
138144
steps:
139145
- uses: actions/checkout@v4
146+
with:
147+
persist-credentials: false
140148
- uses: actions/setup-python@v5
141149
with:
142150
python-version: '3.x'
@@ -193,16 +201,28 @@ jobs:
193201
needs: check_source
194202
if: fromJSON(needs.check_source.outputs.run_tests)
195203
strategy:
204+
fail-fast: false
196205
matrix:
206+
os:
207+
- windows-latest
197208
arch:
198-
- Win32
199-
- x64
200-
- arm64
209+
- x64
201210
free-threading:
202-
- false
203-
- true
211+
- false
212+
- true
213+
include:
214+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
215+
arch: arm64
216+
free-threading: false
217+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
218+
arch: arm64
219+
free-threading: true
220+
- os: windows-latest
221+
arch: Win32
222+
free-threading: false
204223
uses: ./.github/workflows/reusable-windows.yml
205224
with:
225+
os: ${{ matrix.os }}
206226
arch: ${{ matrix.arch }}
207227
free-threading: ${{ matrix.free-threading }}
208228

@@ -280,7 +300,7 @@ jobs:
280300
strategy:
281301
fail-fast: false
282302
matrix:
283-
os: [ubuntu-22.04]
303+
os: [ubuntu-24.04]
284304
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
285305
env:
286306
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -289,6 +309,8 @@ jobs:
289309
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
290310
steps:
291311
- uses: actions/checkout@v4
312+
with:
313+
persist-credentials: false
292314
- name: Runner image version
293315
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
294316
- name: Restore config.cache
@@ -340,7 +362,7 @@ jobs:
340362

341363
test_hypothesis:
342364
name: "Hypothesis tests on Ubuntu"
343-
runs-on: ubuntu-22.04
365+
runs-on: ubuntu-24.04
344366
timeout-minutes: 60
345367
needs: check_source
346368
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
@@ -349,6 +371,8 @@ jobs:
349371
PYTHONSTRICTEXTENSIONBUILD: 1
350372
steps:
351373
- uses: actions/checkout@v4
374+
with:
375+
persist-credentials: false
352376
- name: Register gcc problem matcher
353377
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
354378
- name: Install Dependencies
@@ -431,7 +455,7 @@ jobs:
431455
#
432456
# (GH-104097) test_sysconfig is skipped because it has tests that are
433457
# failing when executed from inside a virtual environment.
434-
${{ env.VENV_PYTHON }} -m test \
458+
"${VENV_PYTHON}" -m test \
435459
-W \
436460
-o \
437461
-j4 \
@@ -453,16 +477,21 @@ jobs:
453477

454478
build_asan:
455479
name: 'Address sanitizer'
456-
runs-on: ubuntu-22.04
480+
runs-on: ${{ matrix.os }}
457481
timeout-minutes: 60
458482
needs: check_source
459483
if: needs.check_source.outputs.run_tests == 'true'
484+
strategy:
485+
matrix:
486+
os: [ubuntu-24.04]
460487
env:
461488
OPENSSL_VER: 3.0.15
462489
PYTHONSTRICTEXTENSIONBUILD: 1
463490
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
464491
steps:
465492
- uses: actions/checkout@v4
493+
with:
494+
persist-credentials: false
466495
- name: Runner image version
467496
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
468497
- name: Restore config.cache

.github/workflows/documentation-links.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ on:
1010
- 'Doc/**'
1111
- '.github/workflows/doc.yml'
1212

13-
permissions:
14-
pull-requests: write
15-
1613
concurrency:
1714
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1815
cancel-in-progress: true
1916

2017
jobs:
2118
documentation-links:
2219
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: write
22+
2323
steps:
2424
- uses: readthedocs/actions/preview@v1
2525
with:

.github/workflows/jit.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ concurrency:
2525
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2626
cancel-in-progress: true
2727

28+
env:
29+
FORCE_COLOR: 1
30+
2831
jobs:
2932
interpreter:
3033
name: Interpreter (Debug)
3134
runs-on: ubuntu-latest
3235
timeout-minutes: 90
3336
steps:
3437
- uses: actions/checkout@v4
38+
with:
39+
persist-credentials: false
3540
- name: Build tier two interpreter
3641
run: |
3742
./configure --enable-experimental-jit=interpreter --with-pydebug
@@ -103,6 +108,8 @@ jobs:
103108
CC: ${{ matrix.compiler }}
104109
steps:
105110
- uses: actions/checkout@v4
111+
with:
112+
persist-credentials: false
106113
- uses: actions/setup-python@v5
107114
with:
108115
python-version: '3.11'
@@ -169,6 +176,8 @@ jobs:
169176
runs-on: ubuntu-latest
170177
steps:
171178
- uses: actions/checkout@v4
179+
with:
180+
persist-credentials: false
172181
- uses: actions/setup-python@v5
173182
with:
174183
python-version: '3.11'

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
2325
- uses: actions/setup-python@v5
2426
with:
2527
python-version: "3.x"

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
timeout-minutes: 10
5252
steps:
5353
- uses: actions/checkout@v4
54+
with:
55+
persist-credentials: false
5456
- uses: actions/setup-python@v5
5557
with:
5658
python-version: "3.13"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ apt-get -yq install \
1313
libgdbm-dev \
1414
libgdbm-compat-dev \
1515
liblzma-dev \
16-
libmpdec-dev \
1716
libncurses5-dev \
1817
libreadline6-dev \
1918
libsqlite3-dev \

.github/workflows/require-pr-label.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ on:
44
pull_request:
55
types: [opened, reopened, labeled, unlabeled, synchronize]
66

7-
permissions:
8-
issues: write
9-
pull-requests: write
10-
117
jobs:
128
label:
139
name: DO-NOT-MERGE / unresolved review
1410
if: github.repository_owner == 'python'
1511
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
1615
timeout-minutes: 10
1716

1817
steps:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ jobs:
6161
- run: >-
6262
echo '${{ github.event_name }}'
6363
- uses: actions/checkout@v4
64+
with:
65+
persist-credentials: false
6466
- name: Check for source changes
6567
id: check
6668
run: |

.github/workflows/reusable-docs.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ jobs:
2222
env:
2323
branch_base: 'origin/${{ github.event.pull_request.base.ref }}'
2424
branch_pr: 'origin/${{ github.event.pull_request.head.ref }}'
25+
commits: ${{ github.event.pull_request.commits }}
2526
refspec_base: '+${{ github.event.pull_request.base.sha }}:remotes/origin/${{ github.event.pull_request.base.ref }}'
2627
refspec_pr: '+${{ github.event.pull_request.head.sha }}:remotes/origin/${{ github.event.pull_request.head.ref }}'
2728
steps:
2829
- name: 'Check out latest PR branch commit'
2930
uses: actions/checkout@v4
3031
with:
32+
persist-credentials: false
3133
ref: >-
3234
${{
3335
github.event_name == 'pull_request'
@@ -39,15 +41,15 @@ jobs:
3941
if: github.event_name == 'pull_request'
4042
run: |
4143
# Fetch enough history to find a common ancestor commit (aka merge-base):
42-
git fetch origin ${{ env.refspec_pr }} --depth=$(( ${{ github.event.pull_request.commits }} + 1 )) \
44+
git fetch origin "${refspec_pr}" --depth=$(( commits + 1 )) \
4345
--no-tags --prune --no-recurse-submodules
4446
4547
# This should get the oldest commit in the local fetched history (which may not be the commit the PR branched from):
46-
COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 ${{ env.branch_pr }} )
48+
COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 "${branch_pr}" )
4749
DATE=$( git log --date=iso8601 --format=%cd "${COMMON_ANCESTOR}" )
4850
4951
# Get all commits since that commit date from the base branch (eg: master or main):
50-
git fetch origin ${{ env.refspec_base }} --shallow-since="${DATE}" \
52+
git fetch origin "${refspec_base}" --shallow-since="${DATE}" \
5153
--no-tags --prune --no-recurse-submodules
5254
- name: 'Set up Python'
5355
uses: actions/setup-python@v5
@@ -63,42 +65,26 @@ jobs:
6365
continue-on-error: true
6466
run: |
6567
set -Eeuo pipefail
66-
# Build docs with the '-n' (nit-picky) option; write warnings to file
67-
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going -w sphinx-warnings.txt" html
68+
# Build docs with the nit-picky option; write warnings to file
69+
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --keep-going --warning-file sphinx-warnings.txt" html
6870
- name: 'Check warnings'
6971
if: github.event_name == 'pull_request'
7072
run: |
7173
python Doc/tools/check-warnings.py \
72-
--annotate-diff '${{ env.branch_base }}' '${{ env.branch_pr }}' \
74+
--annotate-diff "${branch_base}" "${branch_pr}" \
7375
--fail-if-regression \
7476
--fail-if-improved \
7577
--fail-if-new-news-nit
7678
77-
# This build doesn't use problem matchers or check annotations
78-
build_doc_oldest_supported_sphinx:
79-
name: 'Docs (Oldest Sphinx)'
80-
runs-on: ubuntu-latest
81-
timeout-minutes: 60
82-
steps:
83-
- uses: actions/checkout@v4
84-
- name: 'Set up Python'
85-
uses: actions/setup-python@v5
86-
with:
87-
python-version: '3.13' # known to work with Sphinx 7.2.6
88-
cache: 'pip'
89-
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
90-
- name: 'Install build dependencies'
91-
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
92-
- name: 'Build HTML documentation'
93-
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
94-
9579
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
9680
doctest:
9781
name: 'Doctest'
98-
runs-on: ubuntu-22.04
82+
runs-on: ubuntu-24.04
9983
timeout-minutes: 60
10084
steps:
10185
- uses: actions/checkout@v4
86+
with:
87+
persist-credentials: false
10288
- uses: actions/cache@v4
10389
with:
10490
path: ~/.cache/pip
@@ -115,4 +101,4 @@ jobs:
115101
run: make -C Doc/ PYTHON=../python venv
116102
# Use "xvfb-run" since some doctest tests open GUI windows
117103
- name: 'Run documentation doctest'
118-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="-W --keep-going" doctest
104+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning --keep-going" doctest

.github/workflows/reusable-macos.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
required: true
1616
type: string
1717

18+
env:
19+
FORCE_COLOR: 1
20+
1821
jobs:
1922
build_macos:
2023
name: build and test (${{ inputs.os }})
@@ -29,6 +32,8 @@ jobs:
2932
runs-on: ${{ inputs.os }}
3033
steps:
3134
- uses: actions/checkout@v4
35+
with:
36+
persist-credentials: false
3237
- name: Runner image version
3338
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
3439
- name: Restore config.cache
@@ -37,7 +42,10 @@ jobs:
3742
path: config.cache
3843
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
3944
- name: Install Homebrew dependencies
40-
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
45+
run: |
46+
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@8
47+
# Because alternate versions are not symlinked into place by default:
48+
brew link --overwrite tcl-tk@8
4149
- name: Configure CPython
4250
run: |
4351
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

0 commit comments

Comments
 (0)