Skip to content

Commit 40040ca

Browse files
Merge main
2 parents cb2163a + 519bee4 commit 40040ca

File tree

293 files changed

+26762
-5120
lines changed

Some content is hidden

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

293 files changed

+26762
-5120
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
macOS
192192
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
193193
needs: build-context
194-
if: needs.build-context.outputs.run-tests == 'true'
194+
if: needs.build-context.outputs.run-macos == 'true'
195195
strategy:
196196
fail-fast: false
197197
matrix:
@@ -217,7 +217,7 @@ jobs:
217217
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
218218
${{ fromJSON(matrix.bolt) && '(bolt)' || '' }}
219219
needs: build-context
220-
if: needs.build-context.outputs.run-tests == 'true'
220+
if: needs.build-context.outputs.run-ubuntu == 'true'
221221
strategy:
222222
fail-fast: false
223223
matrix:
@@ -248,7 +248,7 @@ jobs:
248248
runs-on: ${{ matrix.os }}
249249
timeout-minutes: 60
250250
needs: build-context
251-
if: needs.build-context.outputs.run-tests == 'true'
251+
if: needs.build-context.outputs.run-ubuntu == 'true'
252252
strategy:
253253
fail-fast: false
254254
matrix:
@@ -304,7 +304,7 @@ jobs:
304304
runs-on: ${{ matrix.os }}
305305
timeout-minutes: 60
306306
needs: build-context
307-
if: needs.build-context.outputs.run-tests == 'true'
307+
if: needs.build-context.outputs.run-ubuntu == 'true'
308308
strategy:
309309
fail-fast: false
310310
matrix:
@@ -368,7 +368,7 @@ jobs:
368368
build-android:
369369
name: Android (${{ matrix.arch }})
370370
needs: build-context
371-
if: needs.build-context.outputs.run-tests == 'true'
371+
if: needs.build-context.outputs.run-android == 'true'
372372
timeout-minutes: 60
373373
strategy:
374374
fail-fast: false
@@ -390,9 +390,9 @@ jobs:
390390
build-ios:
391391
name: iOS
392392
needs: build-context
393-
if: needs.build-context.outputs.run-tests == 'true'
393+
if: needs.build-context.outputs.run-ios == 'true'
394394
timeout-minutes: 60
395-
runs-on: macos-15
395+
runs-on: macos-14
396396
steps:
397397
- uses: actions/checkout@v4
398398
with:
@@ -405,23 +405,23 @@ jobs:
405405
# https://github.com/actions/runner-images/issues/12751.
406406
- name: Select Xcode version
407407
run: |
408-
sudo xcode-select --switch /Applications/Xcode_16.4.app
408+
sudo xcode-select --switch /Applications/Xcode_15.4.app
409409
410410
- name: Build and test
411-
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5'
411+
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
412412

413413
build-wasi:
414414
name: 'WASI'
415415
needs: build-context
416-
if: needs.build-context.outputs.run-tests == 'true'
416+
if: needs.build-context.outputs.run-wasi == 'true'
417417
uses: ./.github/workflows/reusable-wasi.yml
418418

419419
test-hypothesis:
420420
name: "Hypothesis tests on Ubuntu"
421421
runs-on: ubuntu-24.04
422422
timeout-minutes: 60
423423
needs: build-context
424-
if: needs.build-context.outputs.run-tests == 'true'
424+
if: needs.build-context.outputs.run-ubuntu == 'true'
425425
env:
426426
OPENSSL_VER: 3.0.18
427427
PYTHONSTRICTEXTENSIONBUILD: 1
@@ -528,7 +528,7 @@ jobs:
528528
runs-on: ${{ matrix.os }}
529529
timeout-minutes: 60
530530
needs: build-context
531-
if: needs.build-context.outputs.run-tests == 'true'
531+
if: needs.build-context.outputs.run-ubuntu == 'true'
532532
strategy:
533533
fail-fast: false
534534
matrix:
@@ -581,7 +581,7 @@ jobs:
581581
# ${{ '' } is a hack to nest jobs under the same sidebar category.
582582
name: Sanitizers${{ '' }} # zizmor: ignore[obfuscation]
583583
needs: build-context
584-
if: needs.build-context.outputs.run-tests == 'true'
584+
if: needs.build-context.outputs.run-ubuntu == 'true'
585585
strategy:
586586
fail-fast: false
587587
matrix:
@@ -606,7 +606,7 @@ jobs:
606606
runs-on: ubuntu-latest
607607
timeout-minutes: 60
608608
needs: build-context
609-
if: needs.build-context.outputs.run-tests == 'true'
609+
if: needs.build-context.outputs.run-ubuntu == 'true'
610610
steps:
611611
- uses: actions/checkout@v4
612612
with:
@@ -706,50 +706,39 @@ jobs:
706706
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
707707
with:
708708
allowed-failures: >-
709+
build-ios,
709710
build-windows-msi,
710711
build-ubuntu-ssltests-awslc,
711712
build-ubuntu-ssltests-openssl,
712713
test-hypothesis,
713714
cifuzz,
714715
allowed-skips: >-
716+
${{ !fromJSON(needs.build-context.outputs.run-docs) && 'check-docs,' || '' }}
715717
${{
716-
!fromJSON(needs.build-context.outputs.run-docs)
718+
needs.build-context.outputs.run-tests != 'true'
717719
&& '
718-
check-docs,
720+
check-autoconf-regen,
721+
check-generated-files,
719722
'
720723
|| ''
721724
}}
725+
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
726+
${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }}
727+
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
722728
${{
723-
needs.build-context.outputs.run-tests != 'true'
729+
!fromJSON(needs.build-context.outputs.run-ubuntu)
724730
&& '
725-
check-autoconf-regen,
726-
check-generated-files,
727-
build-macos,
728731
build-ubuntu,
729732
build-ubuntu-ssltests-awslc,
730733
build-ubuntu-ssltests-openssl,
731-
build-android,
732-
build-ios,
733-
build-wasi,
734734
test-hypothesis,
735735
build-asan,
736736
build-san,
737737
cross-build-linux,
738738
'
739739
|| ''
740740
}}
741-
${{
742-
!fromJSON(needs.build-context.outputs.run-windows-tests)
743-
&& '
744-
build-windows,
745-
'
746-
|| ''
747-
}}
748-
${{
749-
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
750-
&& '
751-
cifuzz,
752-
'
753-
|| ''
754-
}}
741+
${{ !fromJSON(needs.build-context.outputs.run-android) && 'build-android,' || '' }}
742+
${{ !fromJSON(needs.build-context.outputs.run-ios) && 'build-ios,' || '' }}
743+
${{ !fromJSON(needs.build-context.outputs.run-wasi) && 'build-wasi,' || '' }}
755744
jobs: ${{ toJSON(needs) }}

.github/workflows/reusable-context.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,51 @@ on: # yamllint disable-line rule:truthy
1717
# || 'falsy-branch'
1818
# }}
1919
#
20+
run-android:
21+
description: Whether to run the Android tests
22+
value: ${{ jobs.compute-changes.outputs.run-android }} # bool
23+
run-ci-fuzz:
24+
description: Whether to run the CIFuzz job
25+
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz }} # bool
2026
run-docs:
2127
description: Whether to build the docs
2228
value: ${{ jobs.compute-changes.outputs.run-docs }} # bool
29+
run-ios:
30+
description: Whether to run the iOS tests
31+
value: ${{ jobs.compute-changes.outputs.run-ios }} # bool
32+
run-macos:
33+
description: Whether to run the macOS tests
34+
value: ${{ jobs.compute-changes.outputs.run-macos }} # bool
2335
run-tests:
2436
description: Whether to run the regular tests
2537
value: ${{ jobs.compute-changes.outputs.run-tests }} # bool
26-
run-windows-tests:
27-
description: Whether to run the Windows tests
28-
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
38+
run-ubuntu:
39+
description: Whether to run the Ubuntu tests
40+
value: ${{ jobs.compute-changes.outputs.run-ubuntu }} # bool
41+
run-wasi:
42+
description: Whether to run the WASI tests
43+
value: ${{ jobs.compute-changes.outputs.run-wasi }} # bool
2944
run-windows-msi:
3045
description: Whether to run the MSI installer smoke tests
3146
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
32-
run-ci-fuzz:
33-
description: Whether to run the CIFuzz job
34-
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz }} # bool
47+
run-windows-tests:
48+
description: Whether to run the Windows tests
49+
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
3550

3651
jobs:
3752
compute-changes:
3853
name: Create context from changed files
3954
runs-on: ubuntu-latest
4055
timeout-minutes: 10
4156
outputs:
57+
run-android: ${{ steps.changes.outputs.run-android }}
4258
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
4359
run-docs: ${{ steps.changes.outputs.run-docs }}
60+
run-ios: ${{ steps.changes.outputs.run-ios }}
61+
run-macos: ${{ steps.changes.outputs.run-macos }}
4462
run-tests: ${{ steps.changes.outputs.run-tests }}
63+
run-ubuntu: ${{ steps.changes.outputs.run-ubuntu }}
64+
run-wasi: ${{ steps.changes.outputs.run-wasi }}
4565
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
4666
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
4767
steps:

Doc/c-api/gcsupport.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ The :c:member:`~PyTypeObject.tp_traverse` handler must have the following type:
232232
object argument. If *visit* returns a non-zero value that value should be
233233
returned immediately.
234234
235+
The traversal function must not have any side effects. Implementations
236+
may not modify the reference counts of any Python objects nor create or
237+
destroy any Python objects.
238+
235239
To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:func:`Py_VISIT` macro is
236240
provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse` implementation
237241
must name its arguments exactly *visit* and *arg*:

Doc/c-api/import.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ Importing Modules
129129
of :class:`~importlib.machinery.SourceFileLoader` otherwise.
130130
131131
The module's :attr:`~module.__file__` attribute will be set to the code
132-
object's :attr:`~codeobject.co_filename`. If applicable,
133-
:attr:`~module.__cached__` will also be set.
132+
object's :attr:`~codeobject.co_filename`.
134133
135134
This function will reload the module if it was already imported. See
136135
:c:func:`PyImport_ReloadModule` for the intended way to reload a module.
@@ -142,10 +141,13 @@ Importing Modules
142141
:c:func:`PyImport_ExecCodeModuleWithPathnames`.
143142
144143
.. versionchanged:: 3.12
145-
The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__`
144+
The setting of ``__cached__`` and :attr:`~module.__loader__`
146145
is deprecated. See :class:`~importlib.machinery.ModuleSpec` for
147146
alternatives.
148147
148+
.. versionchanged:: 3.15
149+
``__cached__`` is no longer set.
150+
149151
150152
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
151153
@@ -157,16 +159,19 @@ Importing Modules
157159
158160
.. c:function:: PyObject* PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname, PyObject *cpathname)
159161
160-
Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__`
161-
attribute of the module object is set to *cpathname* if it is
162-
non-``NULL``. Of the three functions, this is the preferred one to use.
162+
Like :c:func:`PyImport_ExecCodeModuleEx`, but the path to any compiled file
163+
via *cpathname* is used appropriately when non-``NULL``. Of the three
164+
functions, this is the preferred one to use.
163165
164166
.. versionadded:: 3.3
165167
166168
.. versionchanged:: 3.12
167-
Setting :attr:`~module.__cached__` is deprecated. See
169+
Setting ``__cached__`` is deprecated. See
168170
:class:`~importlib.machinery.ModuleSpec` for alternatives.
169171
172+
.. versionchanged:: 3.15
173+
``__cached__`` no longer set.
174+
170175
171176
.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)
172177

Doc/c-api/typeobj.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,11 @@ and :c:data:`PyType_Type` effectively act as defaults.)
15691569
but the instance has no strong reference to the elements inside it, as they
15701570
are allowed to be removed even if the instance is still alive).
15711571

1572+
.. warning::
1573+
The traversal function must not have any side effects. It must not
1574+
modify the reference counts of any Python objects nor create or destroy
1575+
any Python objects.
1576+
15721577
Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to
15731578
:c:func:`!local_traverse` to have these specific names; don't name them just
15741579
anything.

Doc/deprecations/pending-removal-in-3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Pending removal in Python 3.15
33

44
* The import system:
55

6-
* Setting :attr:`~module.__cached__` on a module while
6+
* Setting ``__cached__`` on a module while
77
failing to set :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>`
8-
is deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or
8+
is deprecated. In Python 3.15, ``__cached__`` will cease to be set or
99
take into consideration by the import system or standard library. (:gh:`97879`)
1010

1111
* Setting :attr:`~module.__package__` on a module while

Doc/howto/gdb_helpers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ enabled::
136136
at Objects/unicodeobject.c:551
137137
#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d "__lltrace__") at Objects/unicodeobject.c:569
138138
#8 0x0000000000584abd in PyDict_GetItemString (v=
139-
{'Yuck': <type at remote 0xad4730>, '__builtins__': <module at remote 0x7ffff7fd5ee8>, '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', '__package__': None, 'y': <Yuck(i=0) at remote 0xaacd80>, 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': <Yuck(i=0) at remote 0xaace60>, '__doc__': None}, key=
139+
{'Yuck': <type at remote 0xad4730>, '__builtins__': <module at remote 0x7ffff7fd5ee8>, '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', '__package__': None, 'y': <Yuck(i=0) at remote 0xaacd80>, 'dict': {0: 0, 1: 1, 2: 2, 3: 3}, '__name__': '__main__', 'z': <Yuck(i=0) at remote 0xaace60>, '__doc__': None}, key=
140140
0x5c2b8d "__lltrace__") at Objects/dictobject.c:2171
141141

142142
Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed

Doc/library/argparse.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ The Namespace object
17001700
Other utilities
17011701
---------------
17021702

1703-
Sub-commands
1703+
Subcommands
17041704
^^^^^^^^^^^^
17051705

17061706
.. method:: ArgumentParser.add_subparsers(*, [title], [description], [prog], \
@@ -1729,7 +1729,7 @@ Sub-commands
17291729
* *description* - description for the sub-parser group in help output, by
17301730
default ``None``
17311731

1732-
* *prog* - usage information that will be displayed with sub-command help,
1732+
* *prog* - usage information that will be displayed with subcommand help,
17331733
by default the name of the program and any positional arguments before the
17341734
subparser argument
17351735

@@ -1739,7 +1739,7 @@ Sub-commands
17391739
* action_ - the basic type of action to be taken when this argument is
17401740
encountered at the command line
17411741

1742-
* dest_ - name of the attribute under which sub-command name will be
1742+
* dest_ - name of the attribute under which subcommand name will be
17431743
stored; by default ``None`` and no value is stored
17441744

17451745
* required_ - Whether or not a subcommand must be provided, by default

Doc/library/calendar.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
158158

159159
:class:`TextCalendar` instances have the following methods:
160160

161+
.. method:: prweek(theweek, width)
162+
163+
Print a week's calendar as returned by :meth:`formatweek` and without a
164+
final newline.
165+
161166

162167
.. method:: formatday(theday, weekday, width)
163168

Doc/library/cmdline.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The following modules have a command-line interface.
1212
* :ref:`calendar <calendar-cli>`
1313
* :mod:`code`
1414
* :ref:`compileall <compileall-cli>`
15-
* :mod:`cProfile`: see :ref:`profile <profile-cli>`
15+
* ``cProfile``: see :ref:`profiling.tracing <profiling-tracing-cli>`
1616
* :ref:`dis <dis-cli>`
1717
* :ref:`doctest <doctest-cli>`
1818
* :mod:`!encodings.rot_13`
@@ -31,8 +31,9 @@ The following modules have a command-line interface.
3131
* :ref:`pickletools <pickletools-cli>`
3232
* :ref:`platform <platform-cli>`
3333
* :mod:`poplib`
34-
* :ref:`profile <profile-cli>`
35-
* :mod:`pstats`
34+
* :ref:`profiling.sampling <profiling-sampling>`
35+
* :ref:`profiling.tracing <profiling-tracing-cli>`
36+
* :ref:`pstats <pstats-cli>`
3637
* :ref:`py_compile <py_compile-cli>`
3738
* :mod:`pyclbr`
3839
* :mod:`pydoc`

0 commit comments

Comments
 (0)