Skip to content

Commit fb04488

Browse files
authored
Merge branch 'main' into gh-115999-load-super-attr
2 parents ab3af14 + 78cb377 commit fb04488

File tree

190 files changed

+4735
-1770
lines changed

Some content is hidden

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

190 files changed

+4735
-1770
lines changed

.github/actionlint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
self-hosted-runner:
2+
labels: ["ubuntu-24.04-aarch64", "windows-aarch64"]
3+
4+
config-variables: null
5+
6+
paths:
7+
.github/workflows/**/*.yml:
8+
ignore:
9+
- 1st argument of function call is not assignable
10+
- SC2(015|038|086|091|097|098|129|155)

.github/workflows/build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,28 @@ jobs:
150150
needs: check_source
151151
if: fromJSON(needs.check_source.outputs.run_tests)
152152
strategy:
153+
fail-fast: false
153154
matrix:
155+
os:
156+
- windows-latest
154157
arch:
155-
- Win32
156-
- x64
157-
- arm64
158+
- x64
158159
free-threading:
159-
- false
160-
- true
160+
- false
161+
- true
162+
include:
163+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
164+
arch: arm64
165+
free-threading: false
166+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
167+
arch: arm64
168+
free-threading: true
169+
- os: windows-latest
170+
arch: Win32
171+
free-threading: false
161172
uses: ./.github/workflows/reusable-windows.yml
162173
with:
174+
os: ${{ matrix.os }}
163175
arch: ${{ matrix.arch }}
164176
free-threading: ${{ matrix.free-threading }}
165177

.github/workflows/reusable-ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [ubuntu-24.04]
23+
os: [ubuntu-24.04, ubuntu-24.04-aarch64]
2424
env:
2525
FORCE_COLOR: 1
2626
OPENSSL_VER: 3.0.15
@@ -82,11 +82,11 @@ jobs:
8282
- name: Build CPython out-of-tree
8383
if: ${{ inputs.free-threading }}
8484
working-directory: ${{ env.CPYTHON_BUILDDIR }}
85-
run: make -j4
85+
run: make -j
8686
- name: Build CPython out-of-tree (for compiler warning check)
8787
if: ${{ !inputs.free-threading}}
8888
working-directory: ${{ env.CPYTHON_BUILDDIR }}
89-
run: set -o pipefail; make -j4 --output-sync 2>&1 | tee compiler_output_ubuntu.txt
89+
run: set -o pipefail; make -j --output-sync 2>&1 | tee compiler_output_ubuntu.txt
9090
- name: Display build info
9191
working-directory: ${{ env.CPYTHON_BUILDDIR }}
9292
run: make pythoninfo

.github/workflows/reusable-windows.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Reusable Windows
33
on:
44
workflow_call:
55
inputs:
6+
os:
7+
description: OS to run on
8+
required: true
9+
type: string
610
arch:
711
description: CPU architecture
812
required: true
@@ -19,10 +23,8 @@ env:
1923
2024
jobs:
2125
build:
22-
name: >-
23-
build${{ inputs.arch != 'arm64' && ' and test' || '' }}
24-
(${{ inputs.arch }})
25-
runs-on: windows-latest
26+
name: 'build and test (${{ inputs.arch }})'
27+
runs-on: ${{ inputs.os }}
2628
timeout-minutes: 60
2729
steps:
2830
- uses: actions/checkout@v4
@@ -31,17 +33,17 @@ jobs:
3133
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3234
- name: Build CPython
3335
run: >-
34-
.\PCbuild\build.bat
36+
.\\PCbuild\\build.bat
3537
-e -d -v
3638
-p ${{ inputs.arch }}
3739
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
38-
- name: Display build info
40+
- name: Display build info # FIXME(diegorusso): remove the `if`
3941
if: inputs.arch != 'arm64'
40-
run: .\python.bat -m test.pythoninfo
41-
- name: Tests
42+
run: .\\python.bat -m test.pythoninfo
43+
- name: Tests # FIXME(diegorusso): remove the `if`
4244
if: inputs.arch != 'arm64'
4345
run: >-
44-
.\PCbuild\rt.bat
46+
.\\PCbuild\\rt.bat
4547
-p ${{ inputs.arch }}
4648
-d -q --fast-ci
4749
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,9 @@ repos:
5757
- id: check-github-workflows
5858

5959
- repo: https://github.com/rhysd/actionlint
60-
rev: v1.7.3
60+
rev: v1.7.4
6161
hooks:
6262
- id: actionlint
63-
args: [
64-
-ignore=1st argument of function call is not assignable,
65-
-ignore=SC2(015|038|086|091|097|098|129|155),
66-
]
6763

6864
- repo: https://github.com/sphinx-contrib/sphinx-lint
6965
rev: v1.0.0

Doc/c-api/complex.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,36 @@ pointers. This is consistent throughout the API.
4444
representation.
4545
4646
47+
.. c:function:: Py_complex _Py_cr_sum(Py_complex left, double right)
48+
49+
Return the sum of a complex number and a real number, using the C :c:type:`Py_complex`
50+
representation.
51+
52+
.. versionadded:: 3.14
53+
54+
4755
.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
4856
4957
Return the difference between two complex numbers, using the C
5058
:c:type:`Py_complex` representation.
5159
5260
61+
.. c:function:: Py_complex _Py_cr_diff(Py_complex left, double right)
62+
63+
Return the difference between a complex number and a real number, using the C
64+
:c:type:`Py_complex` representation.
65+
66+
.. versionadded:: 3.14
67+
68+
69+
.. c:function:: Py_complex _Py_rc_diff(double left, Py_complex right)
70+
71+
Return the difference between a real number and a complex number, using the C
72+
:c:type:`Py_complex` representation.
73+
74+
.. versionadded:: 3.14
75+
76+
5377
.. c:function:: Py_complex _Py_c_neg(Py_complex num)
5478
5579
Return the negation of the complex number *num*, using the C
@@ -62,6 +86,14 @@ pointers. This is consistent throughout the API.
6286
representation.
6387
6488
89+
.. c:function:: Py_complex _Py_cr_prod(Py_complex left, double right)
90+
91+
Return the product of a complex number and a real number, using the C
92+
:c:type:`Py_complex` representation.
93+
94+
.. versionadded:: 3.14
95+
96+
6597
.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
6698
6799
Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
@@ -71,6 +103,28 @@ pointers. This is consistent throughout the API.
71103
:c:data:`errno` to :c:macro:`!EDOM`.
72104
73105
106+
.. c:function:: Py_complex _Py_cr_quot(Py_complex dividend, double divisor)
107+
108+
Return the quotient of a complex number and a real number, using the C
109+
:c:type:`Py_complex` representation.
110+
111+
If *divisor* is zero, this method returns zero and sets
112+
:c:data:`errno` to :c:macro:`!EDOM`.
113+
114+
.. versionadded:: 3.14
115+
116+
117+
.. c:function:: Py_complex _Py_rc_quot(double dividend, Py_complex divisor)
118+
119+
Return the quotient of a real number and a complex number, using the C
120+
:c:type:`Py_complex` representation.
121+
122+
If *divisor* is zero, this method returns zero and sets
123+
:c:data:`errno` to :c:macro:`!EDOM`.
124+
125+
.. versionadded:: 3.14
126+
127+
74128
.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
75129
76130
Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`

Doc/c-api/init.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,11 @@ function. You can create and destroy them using the following functions:
17381738
.check_multi_interp_extensions = 1,
17391739
.gil = PyInterpreterConfig_OWN_GIL,
17401740
};
1741-
PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);
1741+
PyThreadState *tstate = NULL;
1742+
PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);
1743+
if (PyStatus_Exception(status)) {
1744+
Py_ExitStatusException(status);
1745+
}
17421746
17431747
Note that the config is used only briefly and does not get modified.
17441748
During initialization the config's values are converted into various
@@ -2466,7 +2470,7 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
24662470
24672471
{
24682472
PyCriticalSection2 _py_cs2;
2469-
PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))
2473+
PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))
24702474
24712475
In the default build, this macro expands to ``{``.
24722476
@@ -2478,7 +2482,7 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
24782482
24792483
In the free-threaded build, this macro expands to::
24802484
2481-
PyCriticalSection_End2(&_py_cs2);
2485+
PyCriticalSection2_End(&_py_cs2);
24822486
}
24832487
24842488
In the default build, this macro expands to ``}``.

Doc/c-api/init_config.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
Python Initialization Configuration
77
***********************************
88

9+
.. _pyconfig_api:
10+
911
PyConfig C API
1012
==============
1113

@@ -1588,9 +1590,24 @@ If a ``._pth`` file is present:
15881590
* Set :c:member:`~PyConfig.site_import` to ``0``.
15891591
* Set :c:member:`~PyConfig.safe_path` to ``1``.
15901592
1593+
If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is present in
1594+
the same directory as :c:member:`~PyConfig.executable`, or its parent,
1595+
:c:member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` are set that
1596+
location. When this happens, :c:member:`~PyConfig.base_prefix` and
1597+
:c:member:`~PyConfig.base_exec_prefix` still keep their value, pointing to the
1598+
base installation. See :ref:`sys-path-init-virtual-environments` for more
1599+
information.
1600+
15911601
The ``__PYVENV_LAUNCHER__`` environment variable is used to set
15921602
:c:member:`PyConfig.base_executable`.
15931603
1604+
.. versionchanged:: 3.14
1605+
1606+
:c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now
1607+
set to the ``pyvenv.cfg`` directory. This was previously done by :mod:`site`,
1608+
therefore affected by :option:`-S`.
1609+
1610+
.. _pyinitconfig_api:
15941611
15951612
PyInitConfig C API
15961613
==================

0 commit comments

Comments
 (0)