Skip to content

Commit d28311c

Browse files
Merge branch 'main' into 140052-pytuple-make-pair
2 parents ce29809 + f0291c3 commit d28311c

File tree

239 files changed

+4567
-1503
lines changed

Some content is hidden

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

239 files changed

+4567
-1503
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"image": "ghcr.io/python/wasicontainer:latest",
3+
"onCreateCommand": [
4+
// Install common tooling.
5+
"dnf",
6+
"install",
7+
"-y",
8+
// For umask fix below.
9+
"/usr/bin/setfacl"
10+
],
11+
"updateContentCommand": {
12+
// Using the shell for `nproc` usage.
13+
"python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C"
14+
},
15+
"postCreateCommand": {
16+
// https://github.com/orgs/community/discussions/26026
17+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
18+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
19+
},
20+
"customizations": {
21+
"vscode": {
22+
"extensions": [
23+
// Highlighting for Parser/Python.asdl.
24+
"brettcannon.zephyr-asdl",
25+
// Highlighting for configure.ac.
26+
"maelvalais.autoconf",
27+
// C auto-complete.
28+
"ms-vscode.cpptools",
29+
// Python auto-complete.
30+
"ms-python.python"
31+
],
32+
"settings": {
33+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
34+
"C_Cpp.default.cStandard": "c11",
35+
"C_Cpp.default.defines": [
36+
"CONFIG_64",
37+
"Py_BUILD_CORE"
38+
],
39+
"C_Cpp.default.includePath": [
40+
"${workspaceFolder}/*",
41+
"${workspaceFolder}/Include/**"
42+
],
43+
// https://github.com/microsoft/vscode-cpptools/issues/10732
44+
"C_Cpp.errorSquiggles": "disabled",
45+
"editor.insertSpaces": true,
46+
"editor.rulers": [
47+
80
48+
],
49+
"editor.tabSize": 4,
50+
"editor.trimAutoWhitespace": true,
51+
"files.associations": {
52+
"*.h": "c"
53+
},
54+
"files.encoding": "utf8",
55+
"files.eol": "\n",
56+
"files.insertFinalNewline": true,
57+
"files.trimTrailingWhitespace": true,
58+
"python.analysis.diagnosticSeverityOverrides": {
59+
// Complains about shadowing the stdlib w/ the stdlib.
60+
"reportShadowedImports": "none",
61+
// Doesn't like _frozen_importlib.
62+
"reportMissingImports": "none"
63+
},
64+
"python.analysis.extraPaths": [
65+
"Lib"
66+
],
67+
"[restructuredtext]": {
68+
"editor.tabSize": 3
69+
}
70+
}
71+
}
72+
}
73+
}

.github/workflows/mypy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- "Tools/build/check_extension_modules.py"
1717
- "Tools/build/check_warnings.py"
1818
- "Tools/build/compute-changes.py"
19+
- "Tools/build/consts_getter.py"
1920
- "Tools/build/deepfreeze.py"
2021
- "Tools/build/generate-build-details.py"
2122
- "Tools/build/generate_sbom.py"

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
runs-on: ubuntu-24.04
1717
timeout-minutes: 60
1818
env:
19-
WASMTIME_VERSION: 22.0.0
20-
WASI_SDK_VERSION: 24
19+
WASMTIME_VERSION: 38.0.2
20+
WASI_SDK_VERSION: 25
2121
WASI_SDK_PATH: /opt/wasi-sdk
2222
CROSS_BUILD_PYTHON: cross-build/build
2323
CROSS_BUILD_WASI: cross-build/wasm32-wasip1

Android/testbed/app/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ for ((i, prefix) in prefixes.withIndex()) {
4747
val libDir = file("$prefix/lib")
4848
val version = run {
4949
for (filename in libDir.list()!!) {
50-
"""python(\d+\.\d+)""".toRegex().matchEntire(filename)?.let {
50+
"""python(\d+\.\d+[a-z]*)""".toRegex().matchEntire(filename)?.let {
5151
return@run it.groupValues[1]
5252
}
5353
}
@@ -64,9 +64,10 @@ for ((i, prefix) in prefixes.withIndex()) {
6464
val libPythonDir = file("$libDir/python$pythonVersion")
6565
val triplet = run {
6666
for (filename in libPythonDir.list()!!) {
67-
"""_sysconfigdata__android_(.+).py""".toRegex().matchEntire(filename)?.let {
68-
return@run it.groupValues[1]
69-
}
67+
"""_sysconfigdata_[a-z]*_android_(.+).py""".toRegex()
68+
.matchEntire(filename)?.let {
69+
return@run it.groupValues[1]
70+
}
7071
}
7172
throw GradleException("Failed to find Python triplet in $libPythonDir")
7273
}

Doc/bugs.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ If you find a bug in this documentation or would like to propose an improvement,
1919
please submit a bug report on the :ref:`issue tracker <using-the-tracker>`. If you
2020
have a suggestion on how to fix it, include that as well.
2121

22+
.. only:: translation
23+
24+
If the bug or suggested improvement concerns the translation of this
25+
documentation, submit the report to the
26+
`translation’s repository <TRANSLATION_REPO_>`_ instead.
27+
2228
You can also open a discussion item on our
2329
`Documentation Discourse forum <https://discuss.python.org/c/documentation/26>`_.
2430

Doc/c-api/bytes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ Create, Finish, Discard
259259
If *size* is greater than zero, allocate *size* bytes, and set the
260260
writer size to *size*. The caller is responsible to write *size*
261261
bytes using :c:func:`PyBytesWriter_GetData`.
262+
This function does not overallocate.
262263
263264
On error, set an exception and return ``NULL``.
264265
@@ -349,6 +350,8 @@ Low-level API
349350
350351
Resize the writer to *size* bytes. It can be used to enlarge or to
351352
shrink the writer.
353+
This function typically overallocates to achieve amortized performance when
354+
resizing multiple times.
352355
353356
Newly allocated bytes are left uninitialized.
354357
@@ -360,6 +363,8 @@ Low-level API
360363
.. c:function:: int PyBytesWriter_Grow(PyBytesWriter *writer, Py_ssize_t grow)
361364
362365
Resize the writer by adding *grow* bytes to the current writer size.
366+
This function typically overallocates to achieve amortized performance when
367+
resizing multiple times.
363368
364369
Newly allocated bytes are left uninitialized.
365370

Doc/c-api/iter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ There are two functions specifically for working with iterators.
5454
5555
- ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
5656
- ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
57-
- ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.
57+
- ``PYGEN_ERROR`` if iterator has raised an exception. *presult* is set to ``NULL``.
5858
5959
.. versionadded:: 3.10

Doc/c-api/long.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
4343
.. impl-detail::
4444
4545
CPython keeps an array of integer objects for all integers
46-
between ``-5`` and ``256``. When you create an int in that range
46+
between ``-5`` and ``1024``. When you create an int in that range
4747
you actually just get back a reference to the existing object.
4848
4949

Doc/c-api/stable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ The full API is described below for advanced use cases.
294294
Default flags, based on current values of macros such as
295295
:c:macro:`Py_LIMITED_API` and :c:macro:`Py_GIL_DISABLED`.
296296

297-
Alternately, the field can be set to to the following flags, combined
297+
Alternately, the field can be set to the following flags, combined
298298
by bitwise OR.
299299
Unused bits must be set to zero.
300300

Doc/conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,25 @@
444444
# https://github.com/sphinx-doc/sphinx/issues/12359
445445
epub_use_index = False
446446

447+
# translation tag
448+
# ---------------
449+
450+
language_code = None
451+
for arg in sys.argv:
452+
if arg.startswith('language='):
453+
language_code = arg.split('=', 1)[1]
454+
455+
if language_code:
456+
tags.add('translation') # noqa: F821
457+
458+
rst_epilog += f"""\
459+
.. _TRANSLATION_REPO: https://github.com/python/python-docs-{language_code.replace("_", "-").lower()}
460+
""" # noqa: F821
461+
else:
462+
rst_epilog += """\
463+
.. _TRANSLATION_REPO: https://github.com/python
464+
"""
465+
447466
# Options for the coverage checker
448467
# --------------------------------
449468

0 commit comments

Comments
 (0)