Skip to content

Commit c5c0f77

Browse files
authored
Merge branch '3.13' into backport-3.13-gh-150771
2 parents 4f61ee3 + 75344c0 commit c5c0f77

410 files changed

Lines changed: 10686 additions & 3668 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,14 @@ jobs:
185185
- name: Check for unsupported C global variables
186186
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
187187
run: make check-c-globals
188-
- name: Check for undocumented C APIs
189-
run: make check-c-api-docs
190188

189+
check-c-api-docs:
190+
name: C API Docs
191+
needs: build-context
192+
if: >-
193+
needs.build-context.outputs.run-tests == 'true'
194+
|| needs.build-context.outputs.run-docs == 'true'
195+
uses: ./.github/workflows/reusable-check-c-api-docs.yml
191196

192197
build-windows:
193198
name: >-
@@ -246,16 +251,16 @@ jobs:
246251
strategy:
247252
fail-fast: false
248253
matrix:
249-
# macos-26 is Apple Silicon, macos-15-intel is Intel.
250-
# macos-15-intel only runs tests against the GIL-enabled CPython.
254+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
255+
# macos-26-intel only runs tests against the GIL-enabled CPython.
251256
os:
252257
- macos-26
253-
- macos-15-intel
258+
- macos-26-intel
254259
free-threading:
255260
- false
256261
- true
257262
exclude:
258-
- os: macos-15-intel
263+
- os: macos-26-intel
259264
free-threading: true
260265
uses: ./.github/workflows/reusable-macos.yml
261266
with:
@@ -351,7 +356,7 @@ jobs:
351356
with:
352357
persist-credentials: false
353358
- name: Build and test
354-
run: JAVA_HOME="${JAVA_HOME_21_X64:-$JAVA_HOME_21_arm64}" ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
359+
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
355360

356361
build-wasi:
357362
name: 'WASI'
@@ -486,10 +491,6 @@ jobs:
486491
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
487492
- name: Install dependencies
488493
run: sudo ./.github/workflows/posix-deps-apt.sh
489-
- name: Set up GCC-10 for ASAN
490-
uses: egor-tensin/setup-gcc@a2861a8b8538f49cf2850980acccf6b05a1b2ae4 # v2.0
491-
with:
492-
version: 10
493494
- name: Configure OpenSSL env vars
494495
run: |
495496
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
@@ -586,6 +587,7 @@ jobs:
586587
- check-docs
587588
- check-autoconf-regen
588589
- check-generated-files
590+
- check-c-api-docs
589591
- build-windows
590592
- build-windows-msi
591593
- build-macos
@@ -618,6 +620,12 @@ jobs:
618620
'
619621
|| ''
620622
}}
623+
${{
624+
!fromJSON(needs.build-context.outputs.run-tests)
625+
&& !fromJSON(needs.build-context.outputs.run-docs)
626+
&& 'check-c-api-docs,'
627+
|| ''
628+
}}
621629
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
622630
${{
623631
!fromJSON(needs.build-context.outputs.run-ci-fuzz)

.github/workflows/jit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
compiler: msvc
8383
- target: x86_64-apple-darwin/clang
8484
architecture: x86_64
85-
runner: macos-15-intel
85+
runner: macos-26-intel
8686
compiler: clang
8787
- target: aarch64-apple-darwin/clang
8888
architecture: aarch64
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Reusable C API Docs Check
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
FORCE_COLOR: 1
11+
12+
jobs:
13+
check-c-api-docs:
14+
name: 'Check if all C APIs are documented'
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
steps:
18+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
19+
with:
20+
persist-credentials: false
21+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
22+
with:
23+
python-version: '3.x'
24+
- name: Check for undocumented C APIs
25+
run: python Tools/check-c-api-docs/main.py

.github/workflows/reusable-docs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ name: Reusable Docs
33
on:
44
workflow_call:
55
workflow_dispatch:
6+
# Pushes to CPython branches seed the pip caches under the exact keys every
7+
# docs PR restores from. Without a branch-scoped copy, each PR saves a
8+
# duplicate into its own refs/pull/N/merge scope that nothing else can read.
9+
push:
10+
branches:
11+
- main
12+
- '3.*'
13+
paths:
14+
- 'Doc/pylock.toml'
15+
- 'Doc/requirements.txt'
16+
- '.github/workflows/reusable-docs.yml'
617

718
permissions:
819
contents: read

.github/workflows/reusable-san.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: |
5656
if [ "${SANITIZER}" = "TSan" ]; then
5757
echo "TSAN_OPTIONS=${SAN_LOG_OPTION} suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{
58-
fromJSON(inputs.free-threading)
58+
inputs.free-threading
5959
&& '_free_threading'
6060
|| ''
6161
}}.txt handle_segv=0" >> "$GITHUB_ENV"
@@ -77,7 +77,7 @@ jobs:
7777
|| '--with-undefined-behavior-sanitizer'
7878
}}
7979
--with-pydebug
80-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
80+
${{ inputs.free-threading && '--disable-gil' || '' }}
8181
- name: Build CPython
8282
run: make -j4
8383
- name: Display build info
@@ -96,7 +96,7 @@ jobs:
9696
with:
9797
name: >-
9898
${{ inputs.sanitizer }}-logs-${{
99-
fromJSON(inputs.free-threading)
99+
inputs.free-threading
100100
&& 'free-threading'
101101
|| 'default'
102102
}}

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
--config-cache
6868
--with-pydebug
6969
--with-openssl="$OPENSSL_DIR"
70-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
70+
${{ inputs.free-threading && '--disable-gil' || '' }}
7171
- name: Build CPython out-of-tree
7272
working-directory: ${{ env.CPYTHON_BUILDDIR }}
7373
run: make -j

.github/workflows/reusable-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
.\\PCbuild\\build.bat
4545
-e -d -v
4646
-p "${ARCH}"
47-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
47+
${{ inputs.free-threading && '--disable-gil' || '' }}
4848
shell: bash
4949
- name: Display build info # FIXME(diegorusso): remove the `if`
5050
if: inputs.arch != 'arm64'
@@ -55,5 +55,5 @@ jobs:
5555
.\\PCbuild\\rt.bat
5656
-p "${ARCH}"
5757
-d -q --fast-ci
58-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
58+
${{ inputs.free-threading && '--disable-gil' || '' }}
5959
shell: bash

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ repos:
9494
- id: check-readthedocs
9595

9696
- repo: https://github.com/rhysd/actionlint
97-
rev: 393031adb9afb225ee52ae2ccd7a5af5525e03e8 # frozen: v1.7.11
97+
rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12
9898
hooks:
9999
- id: actionlint
100100

.readthedocs.yml

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,50 @@ build:
1111
os: ubuntu-24.04
1212
tools:
1313
python: "3"
14+
apt_packages:
15+
- jq
1416

15-
commands:
16-
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
17-
#
18-
# Cancel building pull requests when there aren't changes in the Doc directory.
19-
#
20-
# If there are no changes (git diff exits with 0) we force the command to return with 183.
21-
# This is a special exit code on Read the Docs that will cancel the build immediately.
22-
- |
23-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && [ "$(git diff --quiet origin/main -- Doc/ .readthedocs.yml; echo $?)" -eq 0 ];
24-
then
25-
echo "No changes to Doc/ - exiting the build.";
26-
exit 183;
27-
fi
28-
29-
- asdf plugin add uv
30-
- asdf install uv latest
31-
- asdf global uv latest
32-
- make -C Doc venv html
33-
- mkdir _readthedocs
34-
- mv Doc/build/html _readthedocs/html
17+
jobs:
18+
post_system_dependencies:
19+
# https://docs.readthedocs.com/platform/stable/guides/build/skip-build.html#skip-builds-based-on-conditions
20+
#
21+
# Cancel building pull requests when there are no changes in the Doc
22+
# directory or RTD configuration, or if we can't cleanly merge the base
23+
# branch.
24+
- |
25+
set -eEux;
26+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
27+
then
28+
base_branch=$(wget -qO- "https://api.github.com/repos/python/cpython/pulls/$READTHEDOCS_VERSION" | jq -er ".base.ref");
29+
git fetch --depth=50 origin $base_branch:origin-$base_branch;
30+
for attempt in $(seq 10);
31+
do
32+
if ! git merge-base HEAD origin-$base_branch;
33+
then
34+
git fetch --deepen=50 origin $base_branch;
35+
else
36+
break;
37+
fi;
38+
done;
39+
if ! git -c "user.name=rtd" -c "user.email=no-reply@readthedocs.org" merge --no-stat --no-edit origin-$base_branch;
40+
then
41+
echo "Unsuccessful merge with '$base_branch' branch, skipping the build";
42+
exit 183;
43+
fi;
44+
if git diff --exit-code --stat origin-$base_branch -- Doc/ .readthedocs.yml;
45+
then
46+
echo "No changes to Doc/ - skipping the build.";
47+
exit 183;
48+
fi;
49+
fi;
50+
create_environment:
51+
- echo "Skipping default environment creation"
52+
install:
53+
- asdf plugin add uv
54+
- asdf install uv latest
55+
- asdf global uv latest
56+
build:
57+
html:
58+
- make -C Doc venv html
59+
- mkdir -p "$READTHEDOCS_OUTPUT"
60+
- mv Doc/build/html "$READTHEDOCS_OUTPUT/"

Android/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The script also requires the following commands to be on the `PATH`:
3232

3333
* `curl`
3434
* `java` (or set the `JAVA_HOME` environment variable).
35-
Java versions 17 and 21 are supported.
35+
Java versions 17, 21 and 25 are supported.
3636

3737

3838
## Building

0 commit comments

Comments
 (0)