Skip to content

Commit 92a8faa

Browse files
Merge branch 'main' into ft_lzma
2 parents 1acdbc9 + 87942d9 commit 92a8faa

File tree

379 files changed

+9877
-4712
lines changed

Some content is hidden

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

379 files changed

+9877
-4712
lines changed

‎.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/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+
- 20
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+
- 20
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+
- 20
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+
- 20
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-wasi.yml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ env:
1313
jobs:
1414
build-wasi-reusable:
1515
name: 'build and test'
16-
runs-on: ubuntu-24.04
16+
runs-on: ubuntu-24.04-arm
1717
timeout-minutes: 60
1818
env:
19-
WASMTIME_VERSION: 38.0.2
19+
WASMTIME_VERSION: 38.0.3
2020
WASI_SDK_VERSION: 25
2121
WASI_SDK_PATH: /opt/wasi-sdk
2222
CROSS_BUILD_PYTHON: cross-build/build
@@ -40,7 +40,7 @@ jobs:
4040
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
4141
run: |
4242
mkdir "${WASI_SDK_PATH}" && \
43-
curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz" | \
43+
curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-arm64-linux.tar.gz" | \
4444
tar --strip-components 1 --directory "${WASI_SDK_PATH}" --extract --gunzip
4545
- name: "Configure ccache action"
4646
uses: hendrikmuhs/[email protected]
@@ -60,24 +60,24 @@ jobs:
6060
with:
6161
path: ${{ env.CROSS_BUILD_PYTHON }}/config.cache
6262
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python.
63-
# Include the hash of `Tools/wasm/wasi.py` as it may change the environment variables.
63+
# Include the hash of `Tools/wasm/wasi/__main__.py` as it may change the environment variables.
6464
# (Make sure to keep the key in sync with the other config.cache step below.)
65-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
65+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi/__main__.py') }}-${{ env.pythonLocation }}
6666
- name: "Configure build Python"
67-
run: python3 Tools/wasm/wasi.py configure-build-python -- --config-cache --with-pydebug
67+
run: python3 Tools/wasm/wasi configure-build-python -- --config-cache --with-pydebug
6868
- name: "Make build Python"
69-
run: python3 Tools/wasm/wasi.py make-build-python
69+
run: python3 Tools/wasm/wasi make-build-python
7070
- name: "Restore host config.cache"
7171
uses: actions/cache@v4
7272
with:
7373
path: ${{ env.CROSS_BUILD_WASI }}/config.cache
7474
# Should be kept in sync with the other config.cache step above.
75-
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi.py') }}-${{ env.pythonLocation }}
75+
key: ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ env.WASI_SDK_VERSION }}-${{ env.WASMTIME_VERSION }}-${{ inputs.config_hash }}-${{ hashFiles('Tools/wasm/wasi/__main__.py') }}-${{ env.pythonLocation }}
7676
- name: "Configure host"
7777
# `--with-pydebug` inferred from configure-build-python
78-
run: python3 Tools/wasm/wasi.py configure-host -- --config-cache
78+
run: python3 Tools/wasm/wasi configure-host -- --config-cache
7979
- name: "Make host"
80-
run: python3 Tools/wasm/wasi.py make-host
80+
run: python3 Tools/wasm/wasi make-host
8181
- name: "Display build info"
8282
run: make --directory "${CROSS_BUILD_WASI}" pythoninfo
8383
- name: "Test"

‎Apple/__main__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def lib_non_platform_files(dirname, names):
507507
def create_xcframework(platform: str) -> str:
508508
"""Build an XCframework from the component parts for the platform.
509509
510-
:return: The version number of the Python verion that was packaged.
510+
:return: The version number of the Python version that was packaged.
511511
"""
512512
package_path = CROSS_BUILD_DIR / platform
513513
try:

‎Apple/iOS/README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,17 @@ Once you have a built an XCframework, you can test that framework by running:
224224

225225
$ python Apple test iOS
226226

227+
This test will attempt to find an "SE-class" simulator (i.e., an iPhone SE, or
228+
iPhone 16e, or similar), and run the test suite on the most recent version of
229+
iOS that is available. You can specify a simulator using the `--simulator`
230+
command line argument, providing the name of the simulator (e.g., `--simulator
231+
'iPhone 16 Pro'`). You can also use this argument to control the OS version used
232+
for testing; `--simulator 'iPhone 16 Pro,OS=18.2'` would attempt to run the
233+
tests on an iPhone 16 Pro running iOS 18.2.
234+
235+
If the test runner is executed on GitHub Actions, the `GITHUB_ACTIONS`
236+
environment variable will be exposed to the iOS process at runtime.
237+
227238
### Testing a single-architecture framework
228239

229240
The `Apple/testbed` folder that contains an Xcode project that is able to run

‎Apple/testbed/TestbedTests/TestbedTests.m‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ - (void)testPython {
3535
setenv("NO_COLOR", "1", true);
3636
setenv("PYTHON_COLORS", "0", true);
3737

38+
if (getenv("GITHUB_ACTIONS")) {
39+
NSLog(@"Running in a GitHub Actions environment");
40+
}
3841
// Arguments to pass into the test suite runner.
3942
// argv[0] must identify the process; any subsequent arg
4043
// will be handled as if it were an argument to `python -m test`

‎Apple/testbed/__main__.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import argparse
22
import json
3+
import os
34
import re
45
import shutil
56
import subprocess
@@ -78,13 +79,21 @@ def xcode_test(location: Path, platform: str, simulator: str, verbose: bool):
7879
check=True,
7980
)
8081

82+
# Any environment variable prefixed with TEST_RUNNER_ is exposed into the
83+
# test runner environment. There are some variables (like those identifying
84+
# CI platforms) that can be useful to have access to.
85+
test_env = os.environ.copy()
86+
if "GITHUB_ACTIONS" in os.environ:
87+
test_env["TEST_RUNNER_GITHUB_ACTIONS"] = os.environ["GITHUB_ACTIONS"]
88+
8189
print("Running test project...")
8290
# Test execution *can't* be run -quiet; verbose mode
8391
# is how we see the output of the test output.
8492
process = subprocess.Popen(
8593
["xcodebuild", "test-without-building"] + args,
8694
stdout=subprocess.PIPE,
8795
stderr=subprocess.STDOUT,
96+
env=test_env,
8897
)
8998
while line := (process.stdout.readline()).decode(*DECODE_ARGS):
9099
# Strip the timestamp/process prefix from each log line

‎Doc/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ dist-pdf:
241241
# as otherwise the full latexmk process is run twice.
242242
# ($$ is needed to escape the $; https://www.gnu.org/software/make/manual/make.html#Basics-of-Variable-References)
243243
-sed -i 's/: all-$$(FMT)/:/' build/latex/Makefile
244-
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`nproc`+1)) --output-sync LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
244+
if [ -n "$(filter output-sync,$(value .FEATURES))" ]; then OUTPUTSYNC=--output-sync; else OUTPUTSYNC=; fi && \
245+
(cd build/latex; $(MAKE) clean && $(MAKE) --jobs=$$((`getconf _NPROCESSORS_ONLN`+1)) $$OUTPUTSYNC LATEXMKOPTS='-quiet' all-pdf && $(MAKE) FMT=pdf zip bz2)
245246
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
246247
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
247248
@echo "Build finished and archived!"

‎Doc/c-api/capsule.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ Refer to :ref:`using-capsules` for more information on using these objects.
2222
loaded modules.
2323

2424

25+
.. c:var:: PyTypeObject PyCapsule_Type
26+
27+
The type object corresponding to capsule objects. This is the same object
28+
as :class:`types.CapsuleType` in the Python layer.
29+
30+
2531
.. c:type:: PyCapsule_Destructor
2632
2733
The type of a destructor callback for a capsule. Defined as::

‎Doc/c-api/cell.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Cell Objects
77

88
"Cell" objects are used to implement variables referenced by multiple scopes.
99
For each such variable, a cell object is created to store the value; the local
10-
variables of each stack frame that references the value contains a reference to
10+
variables of each stack frame that references the value contain a reference to
1111
the cells from outer scopes which also use that variable. When the value is
1212
accessed, the value contained in the cell is used instead of the cell object
1313
itself. This de-referencing of the cell object requires support from the

0 commit comments

Comments
 (0)