Skip to content

Commit 3cc7841

Browse files
itamarometa-codesync[bot]
authored andcommitted
Merge upstream 3.13.8 release
Summary: https://discuss.python.org/t/3-13-8-has-been-released/104211 This applies all upstream changes from upstream git commit `bcee1c322115c581da27600f2ae55e5439c027eb` to `a15ae614deb58f78f9f4aa11ed18a0afc6a9df7d` upstream commit: python/cpython@a15ae61 Reviewed By: aleivag Differential Revision: D84112100 fbshipit-source-id: 4d4aa8cc1560e4f3bec805bc5b69f0b8d105f2c2
1 parent 6678f71 commit 3cc7841

290 files changed

Lines changed: 6834 additions & 2998 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: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,20 @@ jobs:
208208
fail-fast: false
209209
matrix:
210210
os:
211-
- windows-latest
211+
- windows-2022
212212
arch:
213213
- x64
214214
free-threading:
215215
- false
216216
- true
217217
include:
218-
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
218+
- os: windows-2022 # FIXME(diegorusso): change to os: windows-aarch64
219219
arch: arm64
220220
free-threading: false
221-
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
221+
- os: windows-2022 # FIXME(diegorusso): change to os: windows-aarch64
222222
arch: arm64
223223
free-threading: true
224-
- os: windows-latest
224+
- os: windows-2022
225225
arch: Win32
226226
free-threading: false
227227
uses: ./.github/workflows/reusable-windows.yml
@@ -307,7 +307,10 @@ jobs:
307307
fail-fast: false
308308
matrix:
309309
os: [ubuntu-24.04]
310-
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
310+
# Keep 1.1.1w in our list despite it being upstream EOL and otherwise
311+
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
312+
# supported by important vendors such as AWS-LC.
313+
openssl_ver: [1.1.1w, 3.0.18, 3.1.7, 3.2.6, 3.3.5]
311314
env:
312315
OPENSSL_VER: ${{ matrix.openssl_ver }}
313316
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -379,7 +382,7 @@ jobs:
379382
with:
380383
persist-credentials: false
381384
- name: Build and test
382-
run: ./Android/android.py ci ${{ matrix.arch }}-linux-android
385+
run: ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
383386

384387
build-wasi:
385388
name: 'WASI'
@@ -396,7 +399,7 @@ jobs:
396399
needs: build-context
397400
if: needs.build-context.outputs.run-tests == 'true'
398401
env:
399-
OPENSSL_VER: 3.0.15
402+
OPENSSL_VER: 3.0.18
400403
PYTHONSTRICTEXTENSIONBUILD: 1
401404
steps:
402405
- uses: actions/checkout@v4
@@ -515,7 +518,7 @@ jobs:
515518
matrix:
516519
os: [ubuntu-24.04]
517520
env:
518-
OPENSSL_VER: 3.0.15
521+
OPENSSL_VER: 3.0.18
519522
PYTHONSTRICTEXTENSIONBUILD: 1
520523
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
521524
steps:

.github/workflows/jit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ jobs:
7070
include:
7171
- target: i686-pc-windows-msvc/msvc
7272
architecture: Win32
73-
runner: windows-latest
73+
runner: windows-2022
7474
compiler: msvc
7575
- target: x86_64-pc-windows-msvc/msvc
7676
architecture: x64
77-
runner: windows-latest
77+
runner: windows-2022
7878
compiler: msvc
7979
- target: aarch64-pc-windows-msvc/msvc
8080
architecture: ARM64
81-
runner: windows-latest
81+
runner: windows-2022
8282
compiler: msvc
8383
- target: x86_64-apple-darwin/clang
8484
architecture: x86_64

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
matrix:
2626
os: [ubuntu-24.04, ubuntu-24.04-arm]
2727
env:
28-
OPENSSL_VER: 3.0.15
28+
OPENSSL_VER: 3.0.18
2929
PYTHONSTRICTEXTENSIONBUILD: 1
3030
TERM: linux
3131
steps:

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
build:
1919
name: installer for ${{ inputs.arch }}
20-
runs-on: windows-latest
20+
runs-on: windows-2022
2121
timeout-minutes: 60
2222
env:
2323
ARCH: ${{ inputs.arch }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ iOS/testbed/Python.xcframework/ios-*/lib
8080
iOS/testbed/Python.xcframework/ios-*/Python.framework
8181
iOS/testbed/iOSTestbed.xcodeproj/project.xcworkspace
8282
iOS/testbed/iOSTestbed.xcodeproj/xcuserdata
83-
iOS/testbed/iOSTestbed.xcodeproj/xcshareddata
8483
Mac/Makefile
8584
Mac/PythonLauncher/Info.plist
8685
Mac/PythonLauncher/Makefile

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ repos:
1010
name: Run Ruff (lint) on Lib/test/
1111
args: [--exit-non-zero-on-fix]
1212
files: ^Lib/test/
13+
- id: ruff
14+
name: Run Ruff (lint) on Tools/i18n/
15+
args: [--exit-non-zero-on-fix, --config=Tools/i18n/.ruff.toml]
16+
files: ^Tools/i18n/
1317
- id: ruff
1418
name: Run Ruff (lint) on Argument Clinic
1519
args: [--exit-non-zero-on-fix, --config=Tools/clinic/.ruff.toml]
1620
files: ^Tools/clinic/|Lib/test/test_clinic.py
21+
- id: ruff
22+
name: Run Ruff (lint) on Tools/peg_generator/
23+
args: [--exit-non-zero-on-fix, --config=Tools/peg_generator/.ruff.toml]
24+
files: ^Tools/peg_generator/
1725
- id: ruff-format
1826
name: Run Ruff (format) on Doc/
1927
args: [--check]

.ruff.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Default settings for Ruff in CPython
2+
3+
# PYTHON_FOR_REGEN
4+
target-version = "py310"
5+
6+
# PEP 8
7+
line-length = 79
8+
9+
# Enable automatic fixes by default.
10+
# To override this, use ``fix = false`` in a subdirectory's config file
11+
# or ``--no-fix`` on the command line.
12+
fix = true

Android/android.py

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import argparse
5+
import json
56
import os
67
import platform
78
import re
@@ -184,10 +185,16 @@ def make_build_python(context):
184185
run(["make", "-j", str(os.cpu_count())])
185186

186187

188+
# To create new builds of these dependencies, usually all that's necessary is to
189+
# push a tag to the cpython-android-source-deps repository, and GitHub Actions
190+
# will do the rest.
191+
#
192+
# If you're a member of the Python core team, and you'd like to be able to push
193+
# these tags yourself, please contact Malcolm Smith or Russell Keith-Magee.
187194
def unpack_deps(host, prefix_dir):
188195
os.chdir(prefix_dir)
189196
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
190-
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.15-4",
197+
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.18-0",
191198
"sqlite-3.50.4-0", "xz-5.4.6-1"]:
192199
filename = f"{name_ver}-{host}.tar.gz"
193200
download(f"{deps_url}/{name_ver}/{filename}")
@@ -546,27 +553,33 @@ async def gradle_task(context):
546553
task_prefix = "connected"
547554
env["ANDROID_SERIAL"] = context.connected
548555

549-
if context.command:
550-
mode = "-c"
551-
module = context.command
552-
else:
553-
mode = "-m"
554-
module = context.module or "test"
556+
if context.ci_mode:
557+
context.args[0:0] = [
558+
# See _add_ci_python_opts in libregrtest/main.py.
559+
"-W", "error", "-bb", "-E",
560+
561+
# Randomization is disabled because order-dependent failures are
562+
# much less likely to pass on a rerun in single-process mode.
563+
"-m", "test",
564+
f"--{context.ci_mode}-ci", "--single-process", "--no-randomize"
565+
]
566+
567+
if not any(arg in context.args for arg in ["-c", "-m"]):
568+
context.args[0:0] = ["-m", "test"]
555569

556570
args = [
557571
gradlew, "--console", "plain", f"{task_prefix}DebugAndroidTest",
558572
] + [
559-
# Build-time properties
560-
f"-Ppython.{name}={value}"
561-
for name, value in [
562-
("sitePackages", context.site_packages), ("cwd", context.cwd)
563-
] if value
564-
] + [
565-
# Runtime properties
566-
f"-Pandroid.testInstrumentationRunnerArguments.python{name}={value}"
573+
f"-P{name}={value}"
567574
for name, value in [
568-
("Mode", mode), ("Module", module), ("Args", join_command(context.args))
569-
] if value
575+
("python.sitePackages", context.site_packages),
576+
("python.cwd", context.cwd),
577+
(
578+
"android.testInstrumentationRunnerArguments.pythonArgs",
579+
json.dumps(context.args),
580+
),
581+
]
582+
if value
570583
]
571584
if context.verbose >= 2:
572585
args.append("--info")
@@ -734,17 +747,14 @@ def ci(context):
734747
else:
735748
with TemporaryDirectory(prefix=SCRIPT_NAME) as temp_dir:
736749
print("::group::Tests")
750+
737751
# Prove the package is self-contained by using it to run the tests.
738752
shutil.unpack_archive(package_path, temp_dir)
739-
740-
# Arguments are similar to --fast-ci, but in single-process mode.
741-
launcher_args = ["--managed", "maxVersion", "-v"]
742-
test_args = [
743-
"--single-process", "--fail-env-changed", "--rerun", "--slowest",
744-
"--verbose3", "-u", "all,-cpu", "--timeout=600"
753+
launcher_args = [
754+
"--managed", "maxVersion", "-v", f"--{context.ci_mode}-ci"
745755
]
746756
run(
747-
["./android.py", "test", *launcher_args, "--", *test_args],
757+
["./android.py", "test", *launcher_args],
748758
cwd=temp_dir
749759
)
750760
print("::endgroup::")
@@ -827,25 +837,28 @@ def add_parser(*args, **kwargs):
827837
test.add_argument(
828838
"--cwd", metavar="DIR", type=abspath,
829839
help="Directory to copy as the app's working directory.")
830-
831-
mode_group = test.add_mutually_exclusive_group()
832-
mode_group.add_argument(
833-
"-c", dest="command", help="Execute the given Python code.")
834-
mode_group.add_argument(
835-
"-m", dest="module", help="Execute the module with the given name.")
836-
test.epilog = (
837-
"If neither -c nor -m are passed, the default is '-m test', which will "
838-
"run Python's own test suite.")
839840
test.add_argument(
840-
"args", nargs="*", help=f"Arguments to add to sys.argv. "
841-
f"Separate them from {SCRIPT_NAME}'s own arguments with `--`.")
841+
"args", nargs="*", help=f"Python command-line arguments. "
842+
f"Separate them from {SCRIPT_NAME}'s own arguments with `--`. "
843+
f"If neither -c nor -m are included, `-m test` will be prepended, "
844+
f"which will run Python's own test suite.")
842845

843846
# Package arguments.
844847
for subcommand in [package, ci]:
845848
subcommand.add_argument(
846849
"-g", action="store_true", default=False, dest="debug",
847850
help="Include debug information in package")
848851

852+
# CI arguments
853+
for subcommand in [test, ci]:
854+
group = subcommand.add_mutually_exclusive_group(required=subcommand is ci)
855+
group.add_argument(
856+
"--fast-ci", action="store_const", dest="ci_mode", const="fast",
857+
help="Add test arguments for GitHub Actions")
858+
group.add_argument(
859+
"--slow-ci", action="store_const", dest="ci_mode", const="slow",
860+
help="Add test arguments for buildbots")
861+
849862
return parser.parse_args()
850863

851864

Android/testbed/app/src/androidTest/java/org/python/testbed/PythonSuite.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PythonSuite {
2020
val status = PythonTestRunner(
2121
InstrumentationRegistry.getInstrumentation().targetContext
2222
).run(
23-
InstrumentationRegistry.getArguments()
23+
InstrumentationRegistry.getArguments().getString("pythonArgs")!!,
2424
)
2525
assertEquals(0, status)
2626
} finally {

0 commit comments

Comments
 (0)