Skip to content

Commit 2886803

Browse files
committed
Merge branch 'main' of https://github.com/python/cpython into pep-788-impl
2 parents 0c2ce02 + c5b3722 commit 2886803

928 files changed

Lines changed: 55806 additions & 21554 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.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Include/opcode_ids.h generated
8383
Include/token.h generated
8484
Lib/_opcode_metadata.py generated
8585
Lib/keyword.py generated
86+
Lib/idlelib/help.html generated
8687
Lib/test/certdata/*.pem generated
8788
Lib/test/certdata/*.0 generated
8889
Lib/test/levenshtein_examples.json generated

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ Doc/howto/clinic.rst @erlend-aasland @AA-Turner
126126
# C Analyser
127127
Tools/c-analyzer/ @ericsnowcurrently
128128

129+
# C API Documentation Checks
130+
Tools/check-c-api-docs/ @ZeroIntensity
131+
129132
# Fuzzing
130133
Modules/_xxtestfuzz/ @ammaraskar
131134

.github/CONTRIBUTING.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ Please be aware that our workflow does deviate slightly from the typical GitHub
2828
project. Details on how to properly submit a pull request are covered in
2929
`Lifecycle of a Pull Request <https://devguide.python.org/getting-started/pull-request-lifecycle.html>`_.
3030
We utilize various bots and status checks to help with this, so do follow the
31-
comments they leave and their "Details" links, respectively. The key points of
32-
our workflow that are not covered by a bot or status check are:
31+
comments they leave and their "Details" links, respectively.
3332

34-
- All discussions that are not directly related to the code in the pull request
35-
should happen on `GitHub Issues <https://github.com/python/cpython/issues>`_.
36-
- Upon your first non-trivial pull request (which includes documentation changes),
37-
feel free to add yourself to ``Misc/ACKS``.
33+
The final key part of our workflow is that all discussions that are not
34+
directly related to the code in the pull request should happen on
35+
`GitHub Issues <https://github.com/python/cpython/issues>`__, generally in the
36+
pull request's parent issue.
3837

3938

4039
Setting Expectations

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ contact_links:
55
- name: "Proposing new features"
66
about: "Submit major feature proposal (e.g. syntax changes) to an ideas forum first."
77
url: "https://discuss.python.org/c/ideas/6"
8+
- name: "Python Install Manager issues"
9+
about: "Report issues with the Python Install Manager (for Windows)"
10+
url: "https://github.com/python/pymanager/issues"

.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: 28 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,10 @@ jobs:
109109
python-version: '3.x'
110110
- name: Runner image version
111111
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
112-
- name: Restore config.cache
113-
uses: actions/cache@v4
114-
with:
115-
path: config.cache
116-
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
117-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
118112
- name: Install dependencies
119113
run: sudo ./.github/workflows/posix-deps-apt.sh
120114
- name: Add ccache to PATH
121115
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
122-
- name: Configure ccache action
123-
uses: hendrikmuhs/ccache-action@v1.2
124-
with:
125-
save: false
126116
- name: Configure CPython
127117
run: |
128118
# Build Python with the libpython dynamic library
@@ -152,6 +142,9 @@ jobs:
152142
- name: Check for unsupported C global variables
153143
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
154144
run: make check-c-globals
145+
- name: Check for undocumented C APIs
146+
run: make check-c-api-docs
147+
155148

156149
build-windows:
157150
name: >-
@@ -215,7 +208,6 @@ jobs:
215208
free-threading: true
216209
uses: ./.github/workflows/reusable-macos.yml
217210
with:
218-
config_hash: ${{ needs.build-context.outputs.config-hash }}
219211
free-threading: ${{ matrix.free-threading }}
220212
os: ${{ matrix.os }}
221213

@@ -247,7 +239,6 @@ jobs:
247239
bolt: true
248240
uses: ./.github/workflows/reusable-ubuntu.yml
249241
with:
250-
config_hash: ${{ needs.build-context.outputs.config-hash }}
251242
bolt-optimizations: ${{ matrix.bolt }}
252243
free-threading: ${{ matrix.free-threading }}
253244
os: ${{ matrix.os }}
@@ -278,11 +269,6 @@ jobs:
278269
persist-credentials: false
279270
- name: Runner image version
280271
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
281-
- name: Restore config.cache
282-
uses: actions/cache@v4
283-
with:
284-
path: config.cache
285-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
286272
- name: Register gcc problem matcher
287273
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
288274
- name: Install dependencies
@@ -304,10 +290,6 @@ jobs:
304290
- name: Add ccache to PATH
305291
run: |
306292
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
307-
- name: Configure ccache action
308-
uses: hendrikmuhs/ccache-action@v1.2
309-
with:
310-
save: false
311293
- name: Configure CPython
312294
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
313295
- name: Build CPython
@@ -339,11 +321,6 @@ jobs:
339321
persist-credentials: false
340322
- name: Runner image version
341323
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
342-
- name: Restore config.cache
343-
uses: actions/cache@v4
344-
with:
345-
path: config.cache
346-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
347324
- name: Register gcc problem matcher
348325
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
349326
- name: Install dependencies
@@ -370,10 +347,6 @@ jobs:
370347
- name: Add ccache to PATH
371348
run: |
372349
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
373-
- name: Configure ccache action
374-
uses: hendrikmuhs/ccache-action@v1.2
375-
with:
376-
save: false
377350
- name: Configure CPython
378351
run: |
379352
./configure CFLAGS="-fdiagnostics-format=json" \
@@ -414,13 +387,34 @@ jobs:
414387
- name: Build and test
415388
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
416389

390+
build-ios:
391+
name: iOS
392+
needs: build-context
393+
if: needs.build-context.outputs.run-tests == 'true'
394+
timeout-minutes: 60
395+
runs-on: macos-15
396+
steps:
397+
- uses: actions/checkout@v4
398+
with:
399+
persist-credentials: false
400+
401+
# GitHub recommends explicitly selecting the desired Xcode version:
402+
# https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
403+
# This became a necessity as a result of
404+
# https://github.com/actions/runner-images/issues/12541 and
405+
# https://github.com/actions/runner-images/issues/12751.
406+
- name: Select Xcode version
407+
run: |
408+
sudo xcode-select --switch /Applications/Xcode_16.4.app
409+
410+
- name: Build and test
411+
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5'
412+
417413
build-wasi:
418414
name: 'WASI'
419415
needs: build-context
420416
if: needs.build-context.outputs.run-tests == 'true'
421417
uses: ./.github/workflows/reusable-wasi.yml
422-
with:
423-
config_hash: ${{ needs.build-context.outputs.config-hash }}
424418

425419
test-hypothesis:
426420
name: "Hypothesis tests on Ubuntu"
@@ -456,10 +450,6 @@ jobs:
456450
- name: Add ccache to PATH
457451
run: |
458452
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
459-
- name: Configure ccache action
460-
uses: hendrikmuhs/ccache-action@v1.2
461-
with:
462-
save: false
463453
- name: Setup directory envs for out-of-tree builds
464454
run: |
465455
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -470,11 +460,6 @@ jobs:
470460
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
471461
- name: Runner image version
472462
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
473-
- name: Restore config.cache
474-
uses: actions/cache@v4
475-
with:
476-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
477-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
478463
- name: Configure CPython out-of-tree
479464
working-directory: ${{ env.CPYTHON_BUILDDIR }}
480465
run: |
@@ -558,11 +543,6 @@ jobs:
558543
persist-credentials: false
559544
- name: Runner image version
560545
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
561-
- name: Restore config.cache
562-
uses: actions/cache@v4
563-
with:
564-
path: config.cache
565-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
566546
- name: Register gcc problem matcher
567547
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
568548
- name: Install dependencies
@@ -588,11 +568,6 @@ jobs:
588568
- name: Add ccache to PATH
589569
run: |
590570
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
591-
- name: Configure ccache action
592-
uses: hendrikmuhs/ccache-action@v1.2
593-
with:
594-
save: ${{ github.event_name == 'push' }}
595-
max-size: "200M"
596571
- name: Configure CPython
597572
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
598573
- name: Build CPython
@@ -624,7 +599,6 @@ jobs:
624599
uses: ./.github/workflows/reusable-san.yml
625600
with:
626601
sanitizer: ${{ matrix.sanitizer }}
627-
config_hash: ${{ needs.build-context.outputs.config-hash }}
628602
free-threading: ${{ matrix.free-threading }}
629603

630604
cross-build-linux:
@@ -639,11 +613,6 @@ jobs:
639613
persist-credentials: false
640614
- name: Runner image version
641615
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
642-
- name: Restore config.cache
643-
uses: actions/cache@v4
644-
with:
645-
path: config.cache
646-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
647616
- name: Register gcc problem matcher
648617
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
649618
- name: Set build dir
@@ -723,6 +692,7 @@ jobs:
723692
- build-ubuntu-ssltests-awslc
724693
- build-ubuntu-ssltests-openssl
725694
- build-android
695+
- build-ios
726696
- build-wasi
727697
- test-hypothesis
728698
- build-asan
@@ -759,6 +729,7 @@ jobs:
759729
build-ubuntu-ssltests-awslc,
760730
build-ubuntu-ssltests-openssl,
761731
build-android,
732+
build-ios,
762733
build-wasi,
763734
test-hypothesis,
764735
build-asan,

.github/workflows/jit.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- true
6969
- false
7070
llvm:
71-
- 19
71+
- 21
7272
include:
7373
- target: i686-pc-windows-msvc/msvc
7474
architecture: Win32
@@ -138,7 +138,7 @@ jobs:
138138
fail-fast: false
139139
matrix:
140140
llvm:
141-
- 19
141+
- 21
142142
steps:
143143
- uses: actions/checkout@v4
144144
with:
@@ -166,7 +166,7 @@ jobs:
166166
fail-fast: false
167167
matrix:
168168
llvm:
169-
- 19
169+
- 21
170170
steps:
171171
- uses: actions/checkout@v4
172172
with:
@@ -183,3 +183,27 @@ jobs:
183183
- name: Run tests without optimizations
184184
run: |
185185
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
186+
187+
tail-call-jit:
188+
name: JIT with tail calling interpreter
189+
needs: interpreter
190+
runs-on: ubuntu-24.04
191+
timeout-minutes: 90
192+
strategy:
193+
fail-fast: false
194+
matrix:
195+
llvm:
196+
- 21
197+
steps:
198+
- uses: actions/checkout@v4
199+
with:
200+
persist-credentials: false
201+
- uses: actions/setup-python@v5
202+
with:
203+
python-version: '3.11'
204+
- name: Build with JIT and tailcall
205+
run: |
206+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
207+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
208+
CC=clang-${{ matrix.llvm }} ./configure --enable-experimental-jit --with-tail-call-interp --with-pydebug
209+
make all --jobs 4

.github/workflows/reusable-context.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ 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
2320
run-docs:
2421
description: Whether to build the docs
2522
value: ${{ jobs.compute-changes.outputs.run-docs }} # bool
@@ -42,7 +39,6 @@ jobs:
4239
runs-on: ubuntu-latest
4340
timeout-minutes: 10
4441
outputs:
45-
config-hash: ${{ steps.config-hash.outputs.hash }}
4642
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
4743
run-docs: ${{ steps.changes.outputs.run-docs }}
4844
run-tests: ${{ steps.changes.outputs.run-tests }}
@@ -100,8 +96,3 @@ jobs:
10096
GITHUB_EVENT_NAME: ${{ github.event_name }}
10197
CCF_TARGET_REF: ${{ github.base_ref || github.event.repository.default_branch }}
10298
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"

.github/workflows/reusable-macos.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: Reusable macOS
33
on:
44
workflow_call:
55
inputs:
6-
config_hash:
7-
required: true
8-
type: string
96
free-threading:
107
required: false
118
type: boolean
@@ -36,11 +33,6 @@ jobs:
3633
persist-credentials: false
3734
- name: Runner image version
3835
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
39-
- name: Restore config.cache
40-
uses: actions/cache@v4
41-
with:
42-
path: config.cache
43-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ inputs.config_hash }}
4436
- name: Install Homebrew dependencies
4537
run: |
4638
brew install pkg-config openssl@3.0 xz gdbm tcl-tk@9 make

0 commit comments

Comments
 (0)