Skip to content

Commit 7dc830f

Browse files
authored
Merge branch '3.13' into stale-mro-cache-3.13
2 parents 356fb83 + b06ef5b commit 7dc830f

File tree

484 files changed

+28767
-3654
lines changed

Some content is hidden

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

484 files changed

+28767
-3654
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ Include/opcode.h generated
8080
Include/opcode_ids.h generated
8181
Include/token.h generated
8282
Lib/_opcode_metadata.py generated
83-
Lib/keyword.py generated
8483
Lib/idlelib/help.html generated
84+
Lib/keyword.py generated
85+
Lib/pydoc_data/topics.py generated
86+
Lib/pydoc_data/module_docs.py generated
8587
Lib/test/certdata/*.pem generated
8688
Lib/test/certdata/*.0 generated
8789
Lib/test/levenshtein_examples.json generated

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Lib/test/test_patma.py @brandtbucher
4444
Lib/test/test_type_*.py @JelleZijlstra
4545
Lib/test/test_capi/test_misc.py @markshannon
4646
Tools/c-analyzer/ @ericsnowcurrently
47+
Tools/check-c-api-docs/ @ZeroIntensity
4748

4849
# dbm
4950
**/*dbm* @corona10 @erlend-aasland @serhiy-storchaka

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
cooldown:
16+
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
17+
# Cooldowns protect against supply chain attacks by avoiding the
18+
# highest-risk window immediately after new releases.
19+
default-days: 14
1520
- package-ecosystem: "pip"
1621
directory: "/Tools/"
1722
schedule:
1823
interval: "monthly"
1924
labels:
2025
- "skip issue"
2126
- "skip news"
27+
cooldown:
28+
default-days: 14

.github/workflows/build.yml

Lines changed: 22 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,10 @@ jobs:
154154
python-version: '3.x'
155155
- name: Runner image version
156156
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
157-
- name: Restore config.cache
158-
uses: actions/cache@v4
159-
with:
160-
path: config.cache
161-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
162-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
163157
- name: Install dependencies
164158
run: sudo ./.github/workflows/posix-deps-apt.sh
165159
- name: Add ccache to PATH
166160
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
167-
- name: Configure ccache action
168-
uses: hendrikmuhs/ccache-action@v1.2
169-
with:
170-
save: false
171161
- name: Configure CPython
172162
run: |
173163
# Build Python with the libpython dynamic library
@@ -197,6 +187,9 @@ jobs:
197187
- name: Check for unsupported C global variables
198188
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
199189
run: make check-c-globals
190+
- name: Check for undocumented C APIs
191+
run: make check-c-api-docs
192+
200193

201194
build-windows:
202195
name: >-
@@ -251,7 +244,7 @@ jobs:
251244
macOS
252245
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
253246
needs: build-context
254-
if: needs.build-context.outputs.run-tests == 'true'
247+
if: needs.build-context.outputs.run-macos == 'true'
255248
strategy:
256249
fail-fast: false
257250
matrix:
@@ -268,7 +261,6 @@ jobs:
268261
free-threading: true
269262
uses: ./.github/workflows/reusable-macos.yml
270263
with:
271-
config_hash: ${{ needs.build-context.outputs.config-hash }}
272264
free-threading: ${{ matrix.free-threading }}
273265
os: ${{ matrix.os }}
274266

@@ -277,7 +269,7 @@ jobs:
277269
Ubuntu
278270
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
279271
needs: build-context
280-
if: needs.build-context.outputs.run-tests == 'true'
272+
if: needs.build-context.outputs.run-ubuntu == 'true'
281273
strategy:
282274
fail-fast: false
283275
matrix:
@@ -286,15 +278,14 @@ jobs:
286278
- true
287279
uses: ./.github/workflows/reusable-ubuntu.yml
288280
with:
289-
config_hash: ${{ needs.build-context.outputs.config-hash }}
290281
free-threading: ${{ matrix.free-threading }}
291282

292283
build-ubuntu-ssltests:
293284
name: 'Ubuntu SSL tests with OpenSSL'
294285
runs-on: ${{ matrix.os }}
295286
timeout-minutes: 60
296287
needs: build-context
297-
if: needs.build-context.outputs.run-tests == 'true'
288+
if: needs.build-context.outputs.run-ubuntu == 'true'
298289
strategy:
299290
fail-fast: false
300291
matrix:
@@ -314,11 +305,6 @@ jobs:
314305
persist-credentials: false
315306
- name: Runner image version
316307
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
317-
- name: Restore config.cache
318-
uses: actions/cache@v4
319-
with:
320-
path: config.cache
321-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
322308
- name: Register gcc problem matcher
323309
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
324310
- name: Install dependencies
@@ -340,10 +326,6 @@ jobs:
340326
- name: Add ccache to PATH
341327
run: |
342328
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
343-
- name: Configure ccache action
344-
uses: hendrikmuhs/ccache-action@v1.2
345-
with:
346-
save: false
347329
- name: Configure CPython
348330
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
349331
- name: Build CPython
@@ -356,7 +338,7 @@ jobs:
356338
build-android:
357339
name: Android (${{ matrix.arch }})
358340
needs: build-context
359-
if: needs.build-context.outputs.run-tests == 'true'
341+
if: needs.build-context.outputs.run-android == 'true'
360342
timeout-minutes: 60
361343
strategy:
362344
fail-fast: false
@@ -378,17 +360,15 @@ jobs:
378360
build-wasi:
379361
name: 'WASI'
380362
needs: build-context
381-
if: needs.build-context.outputs.run-tests == 'true'
363+
if: needs.build-context.outputs.run-wasi == 'true'
382364
uses: ./.github/workflows/reusable-wasi.yml
383-
with:
384-
config_hash: ${{ needs.build-context.outputs.config-hash }}
385365

386366
test-hypothesis:
387367
name: "Hypothesis tests on Ubuntu"
388368
runs-on: ubuntu-24.04
389369
timeout-minutes: 60
390370
needs: build-context
391-
if: needs.build-context.outputs.run-tests == 'true'
371+
if: needs.build-context.outputs.run-ubuntu == 'true'
392372
env:
393373
OPENSSL_VER: 3.0.18
394374
PYTHONSTRICTEXTENSIONBUILD: 1
@@ -417,10 +397,6 @@ jobs:
417397
- name: Add ccache to PATH
418398
run: |
419399
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
420-
- name: Configure ccache action
421-
uses: hendrikmuhs/ccache-action@v1.2
422-
with:
423-
save: false
424400
- name: Setup directory envs for out-of-tree builds
425401
run: |
426402
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -431,11 +407,6 @@ jobs:
431407
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
432408
- name: Runner image version
433409
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
434-
- name: Restore config.cache
435-
uses: actions/cache@v4
436-
with:
437-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
438-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
439410
- name: Configure CPython out-of-tree
440411
working-directory: ${{ env.CPYTHON_BUILDDIR }}
441412
run: |
@@ -503,7 +474,7 @@ jobs:
503474
runs-on: ${{ matrix.os }}
504475
timeout-minutes: 60
505476
needs: build-context
506-
if: needs.build-context.outputs.run-tests == 'true'
477+
if: needs.build-context.outputs.run-ubuntu == 'true'
507478
strategy:
508479
fail-fast: false
509480
matrix:
@@ -518,11 +489,6 @@ jobs:
518489
persist-credentials: false
519490
- name: Runner image version
520491
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
521-
- name: Restore config.cache
522-
uses: actions/cache@v4
523-
with:
524-
path: config.cache
525-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
526492
- name: Register gcc problem matcher
527493
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
528494
- name: Install dependencies
@@ -548,11 +514,6 @@ jobs:
548514
- name: Add ccache to PATH
549515
run: |
550516
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
551-
- name: Configure ccache action
552-
uses: hendrikmuhs/ccache-action@v1.2
553-
with:
554-
save: ${{ github.event_name == 'push' }}
555-
max-size: "200M"
556517
- name: Configure CPython
557518
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
558519
- name: Build CPython
@@ -566,7 +527,7 @@ jobs:
566527
# ${{ '' } is a hack to nest jobs under the same sidebar category.
567528
name: Sanitizers${{ '' }} # zizmor: ignore[obfuscation]
568529
needs: build-context
569-
if: needs.build-context.outputs.run-tests == 'true'
530+
if: needs.build-context.outputs.run-ubuntu == 'true'
570531
strategy:
571532
fail-fast: false
572533
matrix:
@@ -580,7 +541,6 @@ jobs:
580541
uses: ./.github/workflows/reusable-san.yml
581542
with:
582543
sanitizer: ${{ matrix.sanitizer }}
583-
config_hash: ${{ needs.build-context.outputs.config-hash }}
584544
free-threading: ${{ matrix.free-threading }}
585545

586546
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
@@ -637,7 +597,6 @@ jobs:
637597
- build-macos
638598
- build-ubuntu
639599
- build-ubuntu-ssltests
640-
- build-android
641600
- build-wasi
642601
- test-hypothesis
643602
- build-asan
@@ -650,46 +609,35 @@ jobs:
650609
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
651610
with:
652611
allowed-failures: >-
612+
build-android,
653613
build-windows-msi,
654614
build-ubuntu-ssltests,
655615
test-hypothesis,
656616
cifuzz,
657617
allowed-skips: >-
618+
${{ !fromJSON(needs.build-context.outputs.run-docs) && 'check-docs,' || '' }}
658619
${{
659-
!fromJSON(needs.build-context.outputs.run-docs)
620+
needs.build-context.outputs.run-tests != 'true'
660621
&& '
661-
check-docs,
622+
check-autoconf-regen,
623+
check-generated-files,
662624
'
663625
|| ''
664626
}}
627+
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
628+
${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }}
629+
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
665630
${{
666-
needs.build-context.outputs.run-tests != 'true'
631+
!fromJSON(needs.build-context.outputs.run-ubuntu)
667632
&& '
668-
check-autoconf-regen,
669-
check-generated-files,
670-
build-macos,
671633
build-ubuntu,
672634
build-ubuntu-ssltests,
673-
build-android,
674-
build-wasi,
675635
test-hypothesis,
676636
build-asan,
677637
build-san,
678638
'
679639
|| ''
680640
}}
681-
${{
682-
!fromJSON(needs.build-context.outputs.run-windows-tests)
683-
&& '
684-
build-windows,
685-
'
686-
|| ''
687-
}}
688-
${{
689-
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
690-
&& '
691-
cifuzz,
692-
'
693-
|| ''
694-
}}
641+
${{ !fromJSON(needs.build-context.outputs.run-android) && 'build-android,' || '' }}
642+
${{ !fromJSON(needs.build-context.outputs.run-wasi) && 'build-wasi,' || '' }}
695643
jobs: ${{ toJSON(needs) }}

.github/workflows/lint.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
25-
- uses: actions/setup-python@v5
26-
with:
27-
python-version: "3.x"
28-
- uses: pre-commit/action@v3.0.1
25+
- uses: j178/prek-action@v1

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- "Tools/build/update_file.py"
2424
- "Tools/build/umarshal.py"
2525
- "Tools/cases_generator/**"
26+
- "Tools/check-c-api-docs/**"
2627
- "Tools/clinic/**"
2728
- "Tools/jit/**"
2829
- "Tools/peg_generator/**"
@@ -55,6 +56,7 @@ jobs:
5556
"Lib/tomllib",
5657
"Tools/build",
5758
"Tools/cases_generator",
59+
"Tools/check-c-api-docs",
5860
"Tools/clinic",
5961
"Tools/jit",
6062
"Tools/peg_generator",

.github/workflows/reusable-context.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,47 @@ on: # yamllint disable-line rule:truthy
1717
# || 'falsy-branch'
1818
# }}
1919
#
20-
config-hash:
21-
description: Config hash value for use in cache keys
22-
value: ${{ jobs.compute-changes.outputs.config-hash }} # str
20+
run-android:
21+
description: Whether to run the Android tests
22+
value: ${{ jobs.compute-changes.outputs.run-android }} # bool
23+
run-ci-fuzz:
24+
description: Whether to run the CIFuzz job
25+
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz }} # bool
2326
run-docs:
2427
description: Whether to build the docs
2528
value: ${{ jobs.compute-changes.outputs.run-docs }} # bool
29+
run-macos:
30+
description: Whether to run the macOS tests
31+
value: ${{ jobs.compute-changes.outputs.run-macos }} # bool
2632
run-tests:
2733
description: Whether to run the regular tests
2834
value: ${{ jobs.compute-changes.outputs.run-tests }} # bool
29-
run-windows-tests:
30-
description: Whether to run the Windows tests
31-
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
35+
run-ubuntu:
36+
description: Whether to run the Ubuntu tests
37+
value: ${{ jobs.compute-changes.outputs.run-ubuntu }} # bool
38+
run-wasi:
39+
description: Whether to run the WASI tests
40+
value: ${{ jobs.compute-changes.outputs.run-wasi }} # bool
3241
run-windows-msi:
3342
description: Whether to run the MSI installer smoke tests
3443
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
35-
run-ci-fuzz:
36-
description: Whether to run the CIFuzz job
37-
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz }} # bool
44+
run-windows-tests:
45+
description: Whether to run the Windows tests
46+
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
3847

3948
jobs:
4049
compute-changes:
4150
name: Create context from changed files
4251
runs-on: ubuntu-latest
4352
timeout-minutes: 10
4453
outputs:
45-
config-hash: ${{ steps.config-hash.outputs.hash }}
54+
run-android: ${{ steps.changes.outputs.run-android }}
4655
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
4756
run-docs: ${{ steps.changes.outputs.run-docs }}
57+
run-macos: ${{ steps.changes.outputs.run-macos }}
4858
run-tests: ${{ steps.changes.outputs.run-tests }}
59+
run-ubuntu: ${{ steps.changes.outputs.run-ubuntu }}
60+
run-wasi: ${{ steps.changes.outputs.run-wasi }}
4961
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
5062
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
5163
steps:
@@ -100,8 +112,3 @@ jobs:
100112
GITHUB_EVENT_NAME: ${{ github.event_name }}
101113
CCF_TARGET_REF: ${{ github.base_ref || github.event.repository.default_branch }}
102114
CCF_HEAD_REF: ${{ github.event.pull_request.head.sha || github.sha }}
103-
104-
- name: Compute hash for config cache key
105-
id: config-hash
106-
run: |
107-
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)