Skip to content

Commit 2845723

Browse files
Merge branch 'main' into bigmemtest-isolate
2 parents 3a0c86a + 350fc64 commit 2845723

413 files changed

Lines changed: 9437 additions & 2491 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ Include/internal/pycore_ast_state.h generated
8080
Include/internal/pycore_opcode.h generated
8181
Include/internal/pycore_opcode_metadata.h generated
8282
Include/internal/pycore_*_generated.h generated
83+
Include/internal/pycore_token.h generated
8384
Include/internal/pycore_uop_ids.h generated
8485
Include/internal/pycore_uop_metadata.h generated
8586
Include/opcode.h generated
8687
Include/opcode_ids.h generated
8788
Include/slots_generated.h generated
88-
Include/token.h generated
8989
Lib/_opcode_metadata.py generated
9090
Lib/idlelib/help.html generated
9191
Lib/keyword.py generated

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Tools/cases_generator/ @markshannon
223223
Python/assemble.c @markshannon @iritkatriel
224224
Python/codegen.c @markshannon @iritkatriel
225225
Python/compile.c @markshannon @iritkatriel
226-
Python/flowgraph.c @markshannon @iritkatriel
226+
Python/flowgraph.c @markshannon @iritkatriel @eclips4
227227
Python/instruction_sequence.c @iritkatriel
228228
Python/symtable.c @JelleZijlstra @carljm
229229

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ jobs:
245245
os: ${{ matrix.os }}
246246
test-opts: ${{ matrix.test-opts || '' }}
247247

248+
build-ubuntu-installed:
249+
name: 'Ubuntu (installed)'
250+
needs: build-context
251+
if: needs.build-context.outputs.run-ubuntu == 'true'
252+
uses: ./.github/workflows/reusable-install.yml
253+
248254
build-ubuntu-ssltests:
249255
name: 'Ubuntu SSL tests'
250256
runs-on: ${{ matrix.os }}
@@ -636,6 +642,7 @@ jobs:
636642
- build-windows
637643
- build-macos
638644
- build-ubuntu
645+
- build-ubuntu-installed
639646
- build-ubuntu-ssltests
640647
- build-ios
641648
- build-emscripten
@@ -685,6 +692,7 @@ jobs:
685692
!fromJSON(needs.build-context.outputs.run-ubuntu)
686693
&& '
687694
build-ubuntu,
695+
build-ubuntu-installed,
688696
build-ubuntu-ssltests,
689697
test-hypothesis,
690698
build-asan,

.github/workflows/reusable-check-html-ids.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ jobs:
2020
with:
2121
persist-credentials: false
2222
ref: ${{ github.event.pull_request.head.sha }}
23+
- name: 'Downgrade Git'
24+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
25+
# to avoid "fatal: shallow file has changed since we read it" bug.
26+
# See https://github.com/python/cpython/issues/151365.
27+
run: |
28+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
29+
git --version
2330
- name: 'Find merge base'
2431
id: merge-base
2532
run: |

.github/workflows/reusable-context.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ jobs:
9090
|| ''
9191
}}
9292
93+
- name: 'Downgrade Git'
94+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
95+
# to avoid "fatal: shallow file has changed since we read it" bug.
96+
# See https://github.com/python/cpython/issues/151365.
97+
if: github.event_name == 'pull_request'
98+
run: |
99+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
100+
git --version
101+
93102
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
94103
- name: Fetch commits to get branch diff
95104
if: github.event_name == 'pull_request'

.github/workflows/reusable-docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ jobs:
4747
&& github.event.pull_request.head.sha
4848
|| ''
4949
}}
50+
- name: 'Downgrade Git'
51+
# Temporarily downgrade to 2.43 until 2.55 is in the runner image,
52+
# to avoid "fatal: shallow file has changed since we read it" bug.
53+
# See https://github.com/python/cpython/issues/151365.
54+
if: github.event_name == 'pull_request'
55+
run: |
56+
sudo apt-get install -y --allow-downgrades 'git=1:2.43.*' 'git-man=1:2.43.*'
57+
git --version
5058
# Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
5159
- name: 'Fetch commits to get branch diff'
5260
if: github.event_name == 'pull_request'
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Reusable Ubuntu (installed)
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
FORCE_COLOR: 1
11+
12+
jobs:
13+
build-install-test:
14+
name: build, install and test
15+
runs-on: ubuntu-26.04-arm
16+
timeout-minutes: 60
17+
env:
18+
PYTHONSTRICTEXTENSIONBUILD: 1
19+
steps:
20+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
21+
with:
22+
persist-credentials: false
23+
- name: Register gcc problem matcher
24+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
25+
- name: Set install dir
26+
run:
27+
echo "INSTALL_DIR=$(realpath "${GITHUB_WORKSPACE}/../installed-python")" >> "$GITHUB_ENV"
28+
- name: Install dependencies
29+
run: sudo ./.github/workflows/posix-deps-apt.sh
30+
- name: Configure CPython
31+
run: ./configure --config-cache --prefix="$INSTALL_DIR"
32+
- name: Build CPython
33+
run: make -j
34+
- name: Install CPython
35+
run: make install
36+
- name: Set installed interpreter
37+
run: |
38+
ldversion=$(./python -c 'import sysconfig; print(sysconfig.get_config_var("LDVERSION"))')
39+
echo "INSTALLED_PYTHON=${INSTALL_DIR}/bin/python${ldversion}" >> "$GITHUB_ENV"
40+
- name: Display build info
41+
run: |
42+
"$INSTALLED_PYTHON" -m test.pythoninfo
43+
- name: Test the installed Python
44+
run: xvfb-run "$INSTALLED_PYTHON" -m test --fast-ci --timeout=900

Doc/c-api/arg.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,18 @@ inside nested parentheses. They are:
399399
their default value --- when an optional argument is not specified,
400400
:c:func:`PyArg_ParseTuple` does not touch the contents of the corresponding C
401401
variable(s).
402+
For example, the format string ``"OO|OO"`` corresponds to the Python
403+
signature ``f(a, b, c=None, d=None)``.
402404

403405
``$``
404406
:c:func:`PyArg_ParseTupleAndKeywords` only:
405407
Indicates that the remaining arguments in the Python argument list are
406-
keyword-only. Currently, all keyword-only arguments must also be optional
407-
arguments, so ``|`` must always be specified before ``$`` in the format
408-
string.
408+
keyword-only.
409+
They are optional if ``|`` was specified before ``$``, and required otherwise.
410+
``|`` cannot be specified after ``$``.
411+
For example, the format string ``"O|O$O"`` corresponds to the Python
412+
signature ``f(a, b=None, *, c=None)``,
413+
and the format string ``"OO$OO"`` corresponds to ``f(a, b, *, c, d)``.
409414

410415
.. versionadded:: 3.3
411416

Doc/c-api/capsule.rst

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,20 @@ Refer to :ref:`using-capsules` for more information on using these objects.
108108
109109
Import a pointer to a C object from a capsule attribute in a module. The
110110
*name* parameter should specify the full name to the attribute, as in
111-
``module.attribute``. The *name* stored in the capsule must match this
112-
string exactly.
113-
114-
This function splits *name* on the ``.`` character, and imports the first
115-
element. It then processes further elements using attribute lookups.
111+
``package.module.attribute``.
112+
Modules are imported if needed,
113+
other components are looked up as attributes.
114+
The *name* stored in the capsule must match this string exactly.
116115
117116
Return the capsule's internal *pointer* on success. On failure, set an
118117
exception and return ``NULL``.
119118
120-
.. note::
121-
122-
If *name* points to an attribute of some submodule or subpackage, this
123-
submodule or subpackage must be previously imported using other means
124-
(for example, by using :c:func:`PyImport_ImportModule`) for the
125-
attribute lookups to succeed.
126-
127119
.. versionchanged:: 3.3
128120
*no_block* has no effect anymore.
129121
122+
.. versionchanged:: next
123+
Submodules are now imported if needed.
124+
130125
131126
.. c:function:: int PyCapsule_IsValid(PyObject *capsule, const char *name)
132127

Doc/extending/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ Finally it should be mentioned that Capsules offer additional functionality,
11061106
which is especially useful for memory allocation and deallocation of the pointer
11071107
stored in a Capsule. The details are described in the Python/C API Reference
11081108
Manual in the section :ref:`capsules` and in the implementation of Capsules (files
1109-
:file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c` in the Python source
1109+
:file:`Include/pycapsule.h` and :file:`Objects/capsule.c` in the Python source
11101110
code distribution).
11111111

11121112
.. rubric:: Footnotes

0 commit comments

Comments
 (0)