Skip to content

Commit 09869ed

Browse files
Merge branch 'main' into capi-PySys_GetAttr
2 parents 5d793c5 + 0ef4ffe commit 09869ed

File tree

630 files changed

+26791
-13189
lines changed

Some content is hidden

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

630 files changed

+26791
-13189
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Objects/exceptions.c @iritkatriel
106106

107107
# Hashing & cryptographic primitives
108108
**/*hashlib* @gpshead @tiran @picnixz
109+
**/*hashopenssl* @gpshead @tiran @picnixz
109110
**/*pyhash* @gpshead @tiran
110111
**/sha* @gpshead @tiran @picnixz
111112
Modules/md5* @gpshead @tiran @picnixz

.github/workflows/add-issue-header.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
permissions:
2020
issues: write
21+
timeout-minutes: 5
2122
steps:
2223
- uses: actions/github-script@v7
2324
with:

.github/workflows/build.yml

+64-59
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
if: fromJSON(needs.build-context.outputs.run-docs)
4444
uses: ./.github/workflows/reusable-docs.yml
4545

46-
check_autoconf_regen:
46+
check-autoconf-regen:
4747
name: 'Check if Autoconf files are up to date'
4848
# Don't use ubuntu-latest but a specific version to make the job
4949
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
@@ -62,8 +62,6 @@ jobs:
6262
with:
6363
fetch-depth: 1
6464
persist-credentials: false
65-
- name: Runner image version
66-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
6765
- name: Check Autoconf and aclocal versions
6866
run: |
6967
grep "Generated by GNU Autoconf 2.72" configure
@@ -88,7 +86,7 @@ jobs:
8886
exit 1
8987
fi
9088
91-
check_generated_files:
89+
check-generated-files:
9290
name: 'Check if generated files are up to date'
9391
# Don't use ubuntu-latest but a specific version to make the job
9492
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
@@ -104,14 +102,14 @@ jobs:
104102
with:
105103
python-version: '3.x'
106104
- name: Runner image version
107-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
105+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
108106
- name: Restore config.cache
109107
uses: actions/cache@v4
110108
with:
111109
path: config.cache
112110
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
113-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
114-
- name: Install Dependencies
111+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
112+
- name: Install dependencies
115113
run: sudo ./.github/workflows/posix-deps-apt.sh
116114
- name: Add ccache to PATH
117115
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
@@ -149,12 +147,12 @@ jobs:
149147
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
150148
run: make check-c-globals
151149

152-
build_windows:
150+
build-windows:
153151
name: >-
154152
Windows
155153
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
156154
needs: build-context
157-
if: fromJSON(needs.build-context.outputs.run-tests)
155+
if: fromJSON(needs.build-context.outputs.run-windows-tests)
158156
strategy:
159157
fail-fast: false
160158
matrix:
@@ -181,7 +179,7 @@ jobs:
181179
arch: ${{ matrix.arch }}
182180
free-threading: ${{ matrix.free-threading }}
183181

184-
build_windows_msi:
182+
build-windows-msi:
185183
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
186184
Windows MSI${{ '' }}
187185
needs: build-context
@@ -196,7 +194,7 @@ jobs:
196194
with:
197195
arch: ${{ matrix.arch }}
198196

199-
build_macos:
197+
build-macos:
200198
name: >-
201199
macOS
202200
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -230,7 +228,7 @@ jobs:
230228
free-threading: ${{ matrix.free-threading }}
231229
os: ${{ matrix.os }}
232230

233-
build_ubuntu:
231+
build-ubuntu:
234232
name: >-
235233
Ubuntu
236234
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -262,7 +260,7 @@ jobs:
262260
free-threading: ${{ matrix.free-threading }}
263261
os: ${{ matrix.os }}
264262

265-
build_ubuntu_ssltests:
263+
build-ubuntu-ssltests:
266264
name: 'Ubuntu SSL tests with OpenSSL'
267265
runs-on: ${{ matrix.os }}
268266
timeout-minutes: 60
@@ -284,15 +282,15 @@ jobs:
284282
with:
285283
persist-credentials: false
286284
- name: Runner image version
287-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
285+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
288286
- name: Restore config.cache
289287
uses: actions/cache@v4
290288
with:
291289
path: config.cache
292-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
290+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
293291
- name: Register gcc problem matcher
294292
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
295-
- name: Install Dependencies
293+
- name: Install dependencies
296294
run: sudo ./.github/workflows/posix-deps-apt.sh
297295
- name: Configure OpenSSL env vars
298296
run: |
@@ -324,15 +322,15 @@ jobs:
324322
- name: SSL tests
325323
run: ./python Lib/test/ssltests.py
326324

327-
build_wasi:
325+
build-wasi:
328326
name: 'WASI'
329327
needs: build-context
330328
if: needs.build-context.outputs.run-tests == 'true'
331329
uses: ./.github/workflows/reusable-wasi.yml
332330
with:
333331
config_hash: ${{ needs.build-context.outputs.config-hash }}
334332

335-
test_hypothesis:
333+
test-hypothesis:
336334
name: "Hypothesis tests on Ubuntu"
337335
runs-on: ubuntu-24.04
338336
timeout-minutes: 60
@@ -347,7 +345,7 @@ jobs:
347345
persist-credentials: false
348346
- name: Register gcc problem matcher
349347
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
350-
- name: Install Dependencies
348+
- name: Install dependencies
351349
run: sudo ./.github/workflows/posix-deps-apt.sh
352350
- name: Configure OpenSSL env vars
353351
run: |
@@ -379,12 +377,12 @@ jobs:
379377
- name: Bind mount sources read-only
380378
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
381379
- name: Runner image version
382-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
380+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
383381
- name: Restore config.cache
384382
uses: actions/cache@v4
385383
with:
386384
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
387-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
385+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
388386
- name: Configure CPython out-of-tree
389387
working-directory: ${{ env.CPYTHON_BUILDDIR }}
390388
run: |
@@ -447,8 +445,7 @@ jobs:
447445
name: hypothesis-example-db
448446
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/examples/
449447

450-
451-
build_asan:
448+
build-asan:
452449
name: 'Address sanitizer'
453450
runs-on: ${{ matrix.os }}
454451
timeout-minutes: 60
@@ -466,15 +463,15 @@ jobs:
466463
with:
467464
persist-credentials: false
468465
- name: Runner image version
469-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
466+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
470467
- name: Restore config.cache
471468
uses: actions/cache@v4
472469
with:
473470
path: config.cache
474-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
471+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
475472
- name: Register gcc problem matcher
476473
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
477-
- name: Install Dependencies
474+
- name: Install dependencies
478475
run: sudo ./.github/workflows/posix-deps-apt.sh
479476
- name: Set up GCC-10 for ASAN
480477
uses: egor-tensin/setup-gcc@v1
@@ -511,7 +508,7 @@ jobs:
511508
- name: Tests
512509
run: xvfb-run make ci
513510

514-
build_tsan:
511+
build-tsan:
515512
name: >-
516513
Thread sanitizer
517514
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
@@ -530,26 +527,27 @@ jobs:
530527
cross-build-linux:
531528
name: Cross build Linux
532529
runs-on: ubuntu-latest
530+
timeout-minutes: 60
533531
needs: build-context
534532
if: needs.build-context.outputs.run-tests == 'true'
535533
steps:
536534
- uses: actions/checkout@v4
537535
with:
538536
persist-credentials: false
539537
- name: Runner image version
540-
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
538+
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
541539
- name: Restore config.cache
542540
uses: actions/cache@v4
543541
with:
544542
path: config.cache
545-
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}
543+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
546544
- name: Register gcc problem matcher
547545
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
548546
- name: Set build dir
549547
run:
550548
# an absolute path outside of the working directoy
551549
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552-
- name: Install Dependencies
550+
- name: Install dependencies
553551
run: sudo ./.github/workflows/posix-deps-apt.sh
554552
- name: Configure host build
555553
run: ./configure --prefix="$BUILD_DIR/host-python"
@@ -594,8 +592,8 @@ jobs:
594592
output-sarif: true
595593
sanitizer: ${{ matrix.sanitizer }}
596594
- name: Upload crash
597-
uses: actions/upload-artifact@v4
598595
if: failure() && steps.build.outcome == 'success'
596+
uses: actions/upload-artifact@v4
599597
with:
600598
name: ${{ matrix.sanitizer }}-artifacts
601599
path: ./out/artifacts
@@ -608,35 +606,35 @@ jobs:
608606

609607
all-required-green: # This job does nothing and is only used for the branch protection
610608
name: All required checks pass
611-
if: always()
612-
609+
runs-on: ubuntu-latest
610+
timeout-minutes: 5
613611
needs:
614612
- build-context # Transitive dependency, needed to access `run-tests` value
615613
- check-docs
616-
- check_autoconf_regen
617-
- check_generated_files
618-
- build_macos
619-
- build_ubuntu
620-
- build_ubuntu_ssltests
621-
- build_wasi
622-
- build_windows
623-
- build_windows_msi
624-
- test_hypothesis
625-
- build_asan
626-
- build_tsan
614+
- check-autoconf-regen
615+
- check-generated-files
616+
- build-windows
617+
- build-windows-msi
618+
- build-macos
619+
- build-ubuntu
620+
- build-ubuntu-ssltests
621+
- build-wasi
622+
- test-hypothesis
623+
- build-asan
624+
- build-tsan
625+
- cross-build-linux
627626
- cifuzz
628-
629-
runs-on: ubuntu-latest
627+
if: always()
630628

631629
steps:
632630
- name: Check whether the needed jobs succeeded or failed
633631
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
634632
with:
635633
allowed-failures: >-
636-
build_ubuntu_ssltests,
637-
build_windows_msi,
634+
build-windows-msi,
635+
build-ubuntu-ssltests,
636+
test-hypothesis,
638637
cifuzz,
639-
test_hypothesis,
640638
allowed-skips: >-
641639
${{
642640
!fromJSON(needs.build-context.outputs.run-docs)
@@ -648,16 +646,23 @@ jobs:
648646
${{
649647
needs.build-context.outputs.run-tests != 'true'
650648
&& '
651-
check_autoconf_regen,
652-
check_generated_files,
653-
build_macos,
654-
build_ubuntu,
655-
build_ubuntu_ssltests,
656-
build_wasi,
657-
build_windows,
658-
build_asan,
659-
build_tsan,
660-
test_hypothesis,
649+
check-autoconf-regen,
650+
check-generated-files,
651+
build-macos,
652+
build-ubuntu,
653+
build-ubuntu-ssltests,
654+
build-wasi,
655+
test-hypothesis,
656+
build-asan,
657+
build-tsan,
658+
cross-build-linux,
659+
'
660+
|| ''
661+
}}
662+
${{
663+
!fromJSON(needs.build-context.outputs.run-windows-tests)
664+
&& '
665+
build-windows,
661666
'
662667
|| ''
663668
}}

.github/workflows/documentation-links.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
permissions:
2121
pull-requests: write
22+
timeout-minutes: 5
2223

2324
steps:
2425
- uses: readthedocs/actions/preview@v1

.github/workflows/jit.yml

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ jobs:
137137
name: Free-Threaded (Debug)
138138
needs: interpreter
139139
runs-on: ubuntu-24.04
140+
timeout-minutes: 90
140141
strategy:
141142
matrix:
142143
llvm:

.github/workflows/mypy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ concurrency:
3333

3434
jobs:
3535
mypy:
36+
name: Run mypy on ${{ matrix.target }}
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 10
3639
strategy:
3740
fail-fast: false
3841
matrix:
@@ -46,9 +49,6 @@ jobs:
4649
"Tools/peg_generator",
4750
"Tools/wasm",
4851
]
49-
name: Run mypy on ${{ matrix.target }}
50-
runs-on: ubuntu-latest
51-
timeout-minutes: 10
5252
steps:
5353
- uses: actions/checkout@v4
5454
with:

.github/workflows/reusable-context.yml

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on: # yamllint disable-line rule:truthy
2626
run-tests:
2727
description: Whether to run the regular tests
2828
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
2932
run-windows-msi:
3033
description: Whether to run the MSI installer smoke tests
3134
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
@@ -44,6 +47,7 @@ jobs:
4447
run-docs: ${{ steps.changes.outputs.run-docs }}
4548
run-tests: ${{ steps.changes.outputs.run-tests }}
4649
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
50+
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
4751
steps:
4852
- name: Set up Python
4953
uses: actions/setup-python@v5

0 commit comments

Comments
 (0)