Skip to content

Commit 8923506

Browse files
itamarofacebook-github-bot
authored andcommitted
Import upstream 3.13.2 release
Summary: This applies all upstream changes from upstream git commit `067145177975eadd61a0c907d0d177f7b6a5a3de` to `4f8bb3947cfbc20f970ff9d9531e1132a9e95396`, taking us from 3.13.1 to 3.13.2, released Feb 4th 2025. Reviewed By: ebadawy Differential Revision: D69361903 fbshipit-source-id: 30b2ee93d7c206edbb6ab0514db9d4db1bbc8bbc
1 parent 62258a5 commit 8923506

File tree

398 files changed

+8805
-2271
lines changed

Some content is hidden

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

398 files changed

+8805
-2271
lines changed

.github/CODEOWNERS

+4
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

+15-1
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
@@ -47,6 +50,8 @@ jobs:
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: |
@@ -101,6 +106,7 @@ jobs:
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
@@ -137,6 +143,8 @@ jobs:
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'
@@ -301,6 +309,8 @@ jobs:
301309
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
302310
steps:
303311
- uses: actions/checkout@v4
312+
with:
313+
persist-credentials: false
304314
- name: Runner image version
305315
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
306316
- name: Restore config.cache
@@ -361,6 +371,8 @@ jobs:
361371
PYTHONSTRICTEXTENSIONBUILD: 1
362372
steps:
363373
- uses: actions/checkout@v4
374+
with:
375+
persist-credentials: false
364376
- name: Register gcc problem matcher
365377
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
366378
- name: Install Dependencies
@@ -443,7 +455,7 @@ jobs:
443455
#
444456
# (GH-104097) test_sysconfig is skipped because it has tests that are
445457
# failing when executed from inside a virtual environment.
446-
${{ env.VENV_PYTHON }} -m test \
458+
"${VENV_PYTHON}" -m test \
447459
-W \
448460
-o \
449461
-j4 \
@@ -478,6 +490,8 @@ jobs:
478490
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
479491
steps:
480492
- uses: actions/checkout@v4
493+
with:
494+
persist-credentials: false
481495
- name: Runner image version
482496
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
483497
- name: Restore config.cache

.github/workflows/documentation-links.yml

+3-3
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

+11-4
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,24 +108,24 @@ 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'
109116

110117
- name: Native Windows
111118
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
112119
run: |
113-
choco upgrade llvm -y
114-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
120+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
115121
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
116122
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
117123
118124
# No PGO or tests (yet):
119125
- name: Emulated Windows
120126
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
121127
run: |
122-
choco upgrade llvm -y
123-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
128+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
124129
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
125130
126131
- name: Native macOS
@@ -169,6 +174,8 @@ jobs:
169174
runs-on: ubuntu-latest
170175
steps:
171176
- uses: actions/checkout@v4
177+
with:
178+
persist-credentials: false
172179
- uses: actions/setup-python@v5
173180
with:
174181
python-version: '3.11'

.github/workflows/lint.yml

+2
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

+2
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/require-pr-label.yml

+3-4
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

+2
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

+12-26
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

+6-1
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
@@ -40,7 +45,7 @@ jobs:
4045
run: |
4146
brew install pkg-config [email protected] xz gdbm tcl-tk@8
4247
# Because alternate versions are not symlinked into place by default:
43-
brew link tcl-tk@8
48+
brew link --overwrite tcl-tk@8
4449
- name: Configure CPython
4550
run: |
4651
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \

.github/workflows/reusable-tsan.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,21 @@ on:
1818
required: true
1919
type: string
2020

21+
env:
22+
FORCE_COLOR: 1
23+
2124
jobs:
2225
build_tsan_reusable:
2326
name: 'Thread sanitizer'
2427
runs-on: ubuntu-24.04
2528
timeout-minutes: 60
29+
env:
30+
OPTIONS: ${{ inputs.options }}
31+
SUPPRESSIONS_PATH: ${{ inputs.suppressions_path }}
2632
steps:
2733
- uses: actions/checkout@v4
34+
with:
35+
persist-credentials: false
2836
- name: Runner image version
2937
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
3038
- name: Restore config.cache
@@ -47,7 +55,7 @@ jobs:
4755
sudo sysctl -w vm.mmap_rnd_bits=28
4856
- name: TSAN Option Setup
4957
run: |
50-
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> $GITHUB_ENV
58+
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${SUPPRESSIONS_PATH} handle_segv=0" >> $GITHUB_ENV
5159
echo "CC=clang" >> $GITHUB_ENV
5260
echo "CXX=clang++" >> $GITHUB_ENV
5361
- name: Add ccache to PATH
@@ -59,7 +67,7 @@ jobs:
5967
save: ${{ github.event_name == 'push' }}
6068
max-size: "200M"
6169
- name: Configure CPython
62-
run: ${{ inputs.options }}
70+
run: "${OPTIONS}"
6371
- name: Build CPython
6472
run: make -j4
6573
- name: Display build info

.github/workflows/reusable-ubuntu.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
type: boolean
1313
default: false
1414

15+
env:
16+
FORCE_COLOR: 1
17+
1518
jobs:
1619
build_ubuntu_reusable:
1720
name: 'build and test'
@@ -20,14 +23,15 @@ jobs:
2023
strategy:
2124
fail-fast: false
2225
matrix:
23-
os: [ubuntu-24.04, ubuntu-24.04-aarch64]
26+
os: [ubuntu-24.04, ubuntu-24.04-arm]
2427
env:
25-
FORCE_COLOR: 1
2628
OPENSSL_VER: 3.0.15
2729
PYTHONSTRICTEXTENSIONBUILD: 1
2830
TERM: linux
2931
steps:
3032
- uses: actions/checkout@v4
33+
with:
34+
persist-credentials: false
3135
- name: Register gcc problem matcher
3236
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
3337
- name: Install dependencies

0 commit comments

Comments
 (0)