Skip to content

Commit 7e6deef

Browse files
committed
Merge branch 'main' into use-stackrefs
2 parents 7fb6a48 + faa3272 commit 7e6deef

File tree

230 files changed

+3891
-1671
lines changed

Some content is hidden

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

230 files changed

+3891
-1671
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Makefile.pre.in @erlend-aasland
1717
Modules/Setup* @erlend-aasland
1818

1919
# asyncio
20-
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
20+
**/*asyncio* @1st1 @asvetlov @kumaraditya303 @willingc
2121

2222
# Core
2323
**/*context* @1st1
@@ -281,4 +281,4 @@ Lib/test/test_configparser.py @jaraco
281281
# Doc sections
282282
Doc/reference/ @willingc
283283

284-
**/*weakref* @kumaraditya303
284+
**/*weakref* @kumaraditya303

.github/workflows/build.yml

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
4747
runs-on: ubuntu-24.04
4848
container:
49-
image: ghcr.io/python/autoconf:2024.10.11.11293396815
49+
image: ghcr.io/python/autoconf:2024.10.16.11360930377
5050
timeout-minutes: 60
5151
needs: check_source
5252
if: needs.check_source.outputs.run_tests == 'true'
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
fetch-depth: 1
6161
- name: Runner image version
62-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
62+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
6363
- name: Check Autoconf and aclocal versions
6464
run: |
6565
grep "Generated by GNU Autoconf 2.71" configure
@@ -98,7 +98,7 @@ jobs:
9898
with:
9999
python-version: '3.x'
100100
- name: Runner image version
101-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
101+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
102102
- name: Restore config.cache
103103
uses: actions/cache@v4
104104
with:
@@ -108,7 +108,7 @@ jobs:
108108
- name: Install Dependencies
109109
run: sudo ./.github/workflows/posix-deps-apt.sh
110110
- name: Add ccache to PATH
111-
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
111+
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
112112
- name: Configure ccache action
113113
uses: hendrikmuhs/[email protected]
114114
with:
@@ -247,7 +247,7 @@ jobs:
247247
steps:
248248
- uses: actions/checkout@v4
249249
- name: Runner image version
250-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
250+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
251251
- name: Restore config.cache
252252
uses: actions/cache@v4
253253
with:
@@ -259,9 +259,9 @@ jobs:
259259
run: sudo ./.github/workflows/posix-deps-apt.sh
260260
- name: Configure OpenSSL env vars
261261
run: |
262-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
263-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
264-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
262+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
263+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
264+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
265265
- name: 'Restore OpenSSL build'
266266
id: cache-openssl
267267
uses: actions/cache@v4
@@ -270,16 +270,16 @@ jobs:
270270
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
271271
- name: Install OpenSSL
272272
if: steps.cache-openssl.outputs.cache-hit != 'true'
273-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
273+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
274274
- name: Add ccache to PATH
275275
run: |
276-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
276+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
277277
- name: Configure ccache action
278278
uses: hendrikmuhs/[email protected]
279279
with:
280280
save: false
281281
- name: Configure CPython
282-
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
282+
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
283283
- name: Build CPython
284284
run: make -j4
285285
- name: Display build info
@@ -312,9 +312,9 @@ jobs:
312312
run: sudo ./.github/workflows/posix-deps-apt.sh
313313
- name: Configure OpenSSL env vars
314314
run: |
315-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
316-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
317-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
315+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
316+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
317+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
318318
- name: 'Restore OpenSSL build'
319319
id: cache-openssl
320320
uses: actions/cache@v4
@@ -323,24 +323,24 @@ jobs:
323323
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
324324
- name: Install OpenSSL
325325
if: steps.cache-openssl.outputs.cache-hit != 'true'
326-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
326+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
327327
- name: Add ccache to PATH
328328
run: |
329-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
329+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
330330
- name: Configure ccache action
331331
uses: hendrikmuhs/[email protected]
332332
with:
333333
save: false
334334
- name: Setup directory envs for out-of-tree builds
335335
run: |
336-
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
337-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
336+
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
337+
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
338338
- name: Create directories for read-only out-of-tree builds
339-
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
339+
run: mkdir -p "$CPYTHON_RO_SRCDIR" "$CPYTHON_BUILDDIR"
340340
- name: Bind mount sources read-only
341-
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
341+
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
342342
- name: Runner image version
343-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
343+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
344344
- name: Restore config.cache
345345
uses: actions/cache@v4
346346
with:
@@ -353,7 +353,7 @@ jobs:
353353
--config-cache \
354354
--with-pydebug \
355355
--enable-slower-safety \
356-
--with-openssl=$OPENSSL_DIR
356+
--with-openssl="$OPENSSL_DIR"
357357
- name: Build CPython out-of-tree
358358
working-directory: ${{ env.CPYTHON_BUILDDIR }}
359359
run: make -j4
@@ -362,18 +362,18 @@ jobs:
362362
run: make pythoninfo
363363
- name: Remount sources writable for tests
364364
# some tests write to srcdir, lack of pyc files slows down testing
365-
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
365+
run: sudo mount "$CPYTHON_RO_SRCDIR" -oremount,rw
366366
- name: Setup directory envs for out-of-tree builds
367367
run: |
368-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
368+
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
369369
- name: "Create hypothesis venv"
370370
working-directory: ${{ env.CPYTHON_BUILDDIR }}
371371
run: |
372372
VENV_LOC=$(realpath -m .)/hypovenv
373373
VENV_PYTHON=$VENV_LOC/bin/python
374-
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
375-
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
376-
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -r ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt
374+
echo "HYPOVENV=${VENV_LOC}" >> "$GITHUB_ENV"
375+
echo "VENV_PYTHON=${VENV_PYTHON}" >> "$GITHUB_ENV"
376+
./python -m venv "$VENV_LOC" && "$VENV_PYTHON" -m pip install -r "${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt"
377377
- name: 'Restore Hypothesis database'
378378
id: cache-hypothesis-database
379379
uses: actions/cache@v4
@@ -411,18 +411,21 @@ jobs:
411411

412412
build_asan:
413413
name: 'Address sanitizer'
414-
runs-on: ubuntu-22.04
414+
runs-on: ${{ matrix.os }}
415415
timeout-minutes: 60
416416
needs: check_source
417417
if: needs.check_source.outputs.run_tests == 'true'
418+
strategy:
419+
matrix:
420+
os: [ubuntu-22.04]
418421
env:
419422
OPENSSL_VER: 3.0.15
420423
PYTHONSTRICTEXTENSIONBUILD: 1
421424
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
422425
steps:
423426
- uses: actions/checkout@v4
424427
- name: Runner image version
425-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
428+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
426429
- name: Restore config.cache
427430
uses: actions/cache@v4
428431
with:
@@ -438,9 +441,9 @@ jobs:
438441
version: 10
439442
- name: Configure OpenSSL env vars
440443
run: |
441-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
442-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
443-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
444+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
445+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
446+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
444447
- name: 'Restore OpenSSL build'
445448
id: cache-openssl
446449
uses: actions/cache@v4
@@ -449,10 +452,10 @@ jobs:
449452
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
450453
- name: Install OpenSSL
451454
if: steps.cache-openssl.outputs.cache-hit != 'true'
452-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
455+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
453456
- name: Add ccache to PATH
454457
run: |
455-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
458+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
456459
- name: Configure ccache action
457460
uses: hendrikmuhs/[email protected]
458461
with:

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

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,53 @@ permissions:
99
pull-requests: write
1010

1111
jobs:
12-
label:
13-
name: DO-NOT-MERGE / unresolved review
12+
label-dnm:
13+
name: DO-NOT-MERGE
1414
if: github.repository_owner == 'python'
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 10
1717

1818
steps:
19-
- uses: mheap/github-action-required-labels@v5
19+
- name: Check there's no DO-NOT-MERGE
20+
uses: mheap/github-action-required-labels@v5
2021
with:
2122
mode: exactly
2223
count: 0
23-
labels: "DO-NOT-MERGE, awaiting changes, awaiting change review"
24+
labels: |
25+
DO-NOT-MERGE
26+
27+
label-reviews:
28+
name: Unresolved review
29+
if: github.repository_owner == 'python'
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 10
32+
33+
steps:
34+
# Check that the PR is not awaiting changes from the author due to previous review.
35+
- name: Check there's no required changes
36+
uses: mheap/github-action-required-labels@v5
37+
with:
38+
mode: exactly
39+
count: 0
40+
labels: |
41+
awaiting changes
42+
awaiting change review
43+
- id: is-feature
44+
name: Check whether this PR is a feature (contains a "type-feature" label)
45+
uses: mheap/github-action-required-labels@v5
46+
with:
47+
mode: exactly
48+
count: 1
49+
labels: |
50+
type-feature
51+
exit_type: success # don't fail the check if the PR is not a feature, just record the result
52+
# In case of a feature PR, check for a complete review (contains an "awaiting merge" label).
53+
- id: awaiting-merge
54+
if: steps.is-feature.outputs.status == 'success'
55+
name: Check for complete review
56+
uses: mheap/github-action-required-labels@v5
57+
with:
58+
mode: exactly
59+
count: 1
60+
labels: |
61+
awaiting merge

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ jobs:
6565
id: check
6666
run: |
6767
if [ -z "$GITHUB_BASE_REF" ]; then
68-
echo "run-tests=true" >> $GITHUB_OUTPUT
68+
echo "run-tests=true" >> "$GITHUB_OUTPUT"
6969
else
70-
git fetch origin $GITHUB_BASE_REF --depth=1
70+
git fetch origin "$GITHUB_BASE_REF" --depth=1
7171
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
7272
# reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots),
7373
# but it requires to download more commits (this job uses
@@ -81,38 +81,38 @@ jobs:
8181
# into the PR branch anyway.
8282
#
8383
# https://github.com/python/core-workflow/issues/373
84-
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run-tests=true" >> $GITHUB_OUTPUT || true
84+
git diff --name-only "origin/$GITHUB_BASE_REF.." | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
8585
fi
8686
8787
# Check if we should run hypothesis tests
8888
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
89-
echo $GIT_BRANCH
89+
echo "$GIT_BRANCH"
9090
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then
9191
echo "Branch too old for hypothesis tests"
92-
echo "run-hypothesis=false" >> $GITHUB_OUTPUT
92+
echo "run-hypothesis=false" >> "$GITHUB_OUTPUT"
9393
else
9494
echo "Run hypothesis tests"
95-
echo "run-hypothesis=true" >> $GITHUB_OUTPUT
95+
echo "run-hypothesis=true" >> "$GITHUB_OUTPUT"
9696
fi
9797
9898
# oss-fuzz maintains a configuration for fuzzing the main branch of
9999
# CPython, so CIFuzz should be run only for code that is likely to be
100100
# merged into the main branch; compatibility with older branches may
101101
# be broken.
102102
FUZZ_RELEVANT_FILES='(\.c$|\.h$|\.cpp$|^configure$|^\.github/workflows/build\.yml$|^Modules/_xxtestfuzz)'
103-
if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE $FUZZ_RELEVANT_FILES; echo $?)" -eq 0 ]; then
103+
if [ "$GITHUB_BASE_REF" = "main" ] && [ "$(git diff --name-only "origin/$GITHUB_BASE_REF.." | grep -qE $FUZZ_RELEVANT_FILES; echo $?)" -eq 0 ]; then
104104
# The tests are pretty slow so they are executed only for PRs
105105
# changing relevant files.
106106
echo "Run CIFuzz tests"
107-
echo "run-cifuzz=true" >> $GITHUB_OUTPUT
107+
echo "run-cifuzz=true" >> "$GITHUB_OUTPUT"
108108
else
109109
echo "Branch too old for CIFuzz tests; or no C files were changed"
110-
echo "run-cifuzz=false" >> $GITHUB_OUTPUT
110+
echo "run-cifuzz=false" >> "$GITHUB_OUTPUT"
111111
fi
112112
- name: Compute hash for config cache key
113113
id: config-hash
114114
run: |
115-
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT
115+
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> "$GITHUB_OUTPUT"
116116
- name: Get a list of the changed documentation-related files
117117
if: github.event_name == 'pull_request'
118118
id: changed-docs-files

.github/workflows/reusable-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v4
3232
- name: Runner image version
33-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
33+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
3434
- name: Restore config.cache
3535
uses: actions/cache@v4
3636
with:

.github/workflows/reusable-tsan.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v4
2828
- name: Runner image version
29-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
29+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
3030
- name: Restore config.cache
3131
uses: actions/cache@v4
3232
with:
@@ -47,12 +47,12 @@ jobs:
4747
sudo sysctl -w vm.mmap_rnd_bits=28
4848
- name: TSAN Option Setup
4949
run: |
50-
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> $GITHUB_ENV
51-
echo "CC=clang" >> $GITHUB_ENV
52-
echo "CXX=clang++" >> $GITHUB_ENV
50+
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> "$GITHUB_ENV"
51+
echo "CC=clang" >> "$GITHUB_ENV"
52+
echo "CXX=clang++" >> "$GITHUB_ENV"
5353
- name: Add ccache to PATH
5454
run: |
55-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
55+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
5656
- name: Configure ccache action
5757
uses: hendrikmuhs/[email protected]
5858
with:
@@ -68,7 +68,7 @@ jobs:
6868
run: ./python -m test --tsan -j4
6969
- name: Display TSAN logs
7070
if: always()
71-
run: find ${GITHUB_WORKSPACE} -name 'tsan_log.*' | xargs head -n 1000
71+
run: find "${GITHUB_WORKSPACE}" -name 'tsan_log.*' | xargs head -n 1000
7272
- name: Archive TSAN logs
7373
if: always()
7474
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)