Skip to content

Commit 3c10498

Browse files
committed
Merge branch 'main' into ft-thread-safe-deque
2 parents 339dcd9 + c32bae5 commit 3c10498

File tree

322 files changed

+4997
-2392
lines changed

Some content is hidden

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

322 files changed

+4997
-2392
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ configure* @erlend-aasland @corona10
2121
**/*context* @1st1
2222
**/*genobject* @markshannon
2323
**/*hamt* @1st1
24+
**/*jit* @brandtbucher
2425
Objects/set* @rhettinger
2526
Objects/dict* @methane @markshannon
2627
Objects/typevarobject.c @JelleZijlstra
@@ -37,7 +38,6 @@ Python/ast_opt.c @isidentical
3738
Python/bytecodes.c @markshannon @gvanrossum
3839
Python/optimizer*.c @markshannon @gvanrossum
3940
Lib/test/test_patma.py @brandtbucher
40-
Lib/test/test_peepholer.py @brandtbucher
4141
Lib/test/test_type_*.py @JelleZijlstra
4242
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
4343
Tools/c-analyzer/ @ericsnowcurrently
@@ -230,8 +230,8 @@ Doc/c-api/stable.rst @encukou
230230
**/*zipfile/_path/* @jaraco
231231

232232
# Argument Clinic
233-
/Tools/clinic/** @erlend-aasland @AlexWaygood
234-
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood
233+
/Tools/clinic/** @erlend-aasland
234+
/Lib/test/test_clinic.py @erlend-aasland
235235
Doc/howto/clinic.rst @erlend-aasland
236236

237237
# Subinterpreters

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
with:
133133
python-version: '3.x'
134134
- name: Restore config.cache
135-
uses: actions/cache@v3
135+
uses: actions/cache@v4
136136
with:
137137
path: config.cache
138138
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
@@ -259,7 +259,7 @@ jobs:
259259
steps:
260260
- uses: actions/checkout@v4
261261
- name: Restore config.cache
262-
uses: actions/cache@v3
262+
uses: actions/cache@v4
263263
with:
264264
path: config.cache
265265
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
@@ -274,7 +274,7 @@ jobs:
274274
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
275275
- name: 'Restore OpenSSL build'
276276
id: cache-openssl
277-
uses: actions/cache@v3
277+
uses: actions/cache@v4
278278
with:
279279
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
280280
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -319,7 +319,7 @@ jobs:
319319
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
320320
- name: 'Restore OpenSSL build'
321321
id: cache-openssl
322-
uses: actions/cache@v3
322+
uses: actions/cache@v4
323323
with:
324324
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
325325
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -342,7 +342,7 @@ jobs:
342342
- name: Bind mount sources read-only
343343
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
344344
- name: Restore config.cache
345-
uses: actions/cache@v3
345+
uses: actions/cache@v4
346346
with:
347347
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
348348
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
@@ -375,7 +375,7 @@ jobs:
375375
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -r ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt
376376
- name: 'Restore Hypothesis database'
377377
id: cache-hypothesis-database
378-
uses: actions/cache@v3
378+
uses: actions/cache@v4
379379
with:
380380
path: ./hypothesis
381381
key: hypothesis-database-${{ github.head_ref || github.run_id }}
@@ -421,7 +421,7 @@ jobs:
421421
steps:
422422
- uses: actions/checkout@v4
423423
- name: Restore config.cache
424-
uses: actions/cache@v3
424+
uses: actions/cache@v4
425425
with:
426426
path: config.cache
427427
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
@@ -440,7 +440,7 @@ jobs:
440440
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
441441
- name: 'Restore OpenSSL build'
442442
id: cache-openssl
443-
uses: actions/cache@v3
443+
uses: actions/cache@v4
444444
with:
445445
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
446446
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

.github/workflows/jit.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
name: JIT
22
on:
33
pull_request:
4-
paths: '**jit**'
4+
paths:
5+
- '**jit**'
6+
- 'Python/bytecodes.c'
57
push:
6-
paths: '**jit**'
8+
paths:
9+
- '**jit**'
10+
- 'Python/bytecodes.c'
711
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
817
jobs:
918
jit:
1019
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
1120
runs-on: ${{ matrix.runner }}
21+
timeout-minutes: 60
1222
strategy:
1323
fail-fast: false
1424
matrix:
1525
target:
1626
- i686-pc-windows-msvc/msvc
1727
- x86_64-pc-windows-msvc/msvc
1828
- x86_64-apple-darwin/clang
29+
- aarch64-apple-darwin/clang
1930
- x86_64-unknown-linux-gnu/gcc
2031
- x86_64-unknown-linux-gnu/clang
2132
- aarch64-unknown-linux-gnu/gcc
@@ -36,9 +47,12 @@ jobs:
3647
compiler: msvc
3748
- target: x86_64-apple-darwin/clang
3849
architecture: x86_64
39-
runner: macos-latest
50+
runner: macos-13
51+
compiler: clang
52+
- target: aarch64-apple-darwin/clang
53+
architecture: aarch64
54+
runner: macos-14
4055
compiler: clang
41-
exclude: test_embed
4256
- target: x86_64-unknown-linux-gnu/gcc
4357
architecture: x86_64
4458
runner: ubuntu-latest
@@ -80,7 +94,7 @@ jobs:
8094
brew install llvm@${{ matrix.llvm }}
8195
export SDKROOT="$(xcrun --show-sdk-path)"
8296
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
83-
make all --jobs 3
97+
make all --jobs 4
8498
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
8599
86100
- name: Native Linux
@@ -91,6 +105,7 @@ jobs:
91105
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
92106
make all --jobs 4
93107
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
108+
94109
- name: Emulated Linux
95110
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
96111
run: |

.github/workflows/require-pr-label.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
label:
1313
name: DO-NOT-MERGE / unresolved review
14+
if: github.repository_owner == 'python'
1415
runs-on: ubuntu-latest
1516
timeout-minutes: 10
1617

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
timeout-minutes: 60
9090
steps:
9191
- uses: actions/checkout@v4
92-
- uses: actions/cache@v3
92+
- uses: actions/cache@v4
9393
with:
9494
path: ~/.cache/pip
9595
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}

.github/workflows/reusable-macos.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,27 @@ on:
1212
jobs:
1313
build_macos:
1414
name: 'build and test'
15-
runs-on: macos-latest
1615
timeout-minutes: 60
1716
env:
1817
HOMEBREW_NO_ANALYTICS: 1
1918
HOMEBREW_NO_AUTO_UPDATE: 1
2019
HOMEBREW_NO_INSTALL_CLEANUP: 1
2120
PYTHONSTRICTEXTENSIONBUILD: 1
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [
25+
"macos-14", # M1
26+
"macos-13", # Intel
27+
]
28+
runs-on: ${{ matrix.os }}
2229
steps:
2330
- uses: actions/checkout@v4
2431
- name: Restore config.cache
25-
uses: actions/cache@v3
32+
uses: actions/cache@v4
2633
with:
2734
path: config.cache
28-
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
35+
key: ${{ github.job }}-${{ matrix.os }}-${{ inputs.config_hash }}
2936
- name: Install Homebrew dependencies
3037
run: brew install pkg-config [email protected] xz gdbm tcl-tk
3138
- name: Configure CPython

.github/workflows/reusable-ubuntu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
3030
- name: 'Restore OpenSSL build'
3131
id: cache-openssl
32-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3333
with:
3434
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
3535
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -53,7 +53,7 @@ jobs:
5353
- name: Bind mount sources read-only
5454
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
5555
- name: Restore config.cache
56-
uses: actions/cache@v3
56+
uses: actions/cache@v4
5757
with:
5858
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
5959
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ Python/frozen_modules/MANIFEST
159159
/python
160160
!/Python/
161161

162-
# main branch only: ABI files are not checked/maintained
162+
# main branch only: ABI files are not checked/maintained.
163163
Doc/data/python*.abi

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.1.7
3+
rev: v0.2.0
44
hooks:
55
- id: ruff
66
name: Run Ruff on Lib/test/

Doc/c-api/import.rst

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,8 @@ Importing Modules
1313
single: __all__ (package variable)
1414
single: modules (in module sys)
1515
16-
This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below,
17-
leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set
18-
to 0. When the *name*
19-
argument contains a dot (when it specifies a submodule of a package), the
20-
*fromlist* argument is set to the list ``['*']`` so that the return value is the
21-
named module rather than the top-level package containing it as would otherwise
22-
be the case. (Unfortunately, this has an additional side effect when *name* in
23-
fact specifies a subpackage instead of a submodule: the submodules specified in
24-
the package's ``__all__`` variable are loaded.) Return a new reference to the
25-
imported module, or ``NULL`` with an exception set on failure. A failing
26-
import of a module doesn't leave the module in :data:`sys.modules`.
27-
28-
This function always uses absolute imports.
29-
16+
This is a wrapper around :c:func:`PyImport_Import()` which takes a
17+
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
3018
3119
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
3220

Doc/c-api/list.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,21 @@ List Objects
5656
Similar to :c:func:`PyList_Size`, but without error checking.
5757
5858
59-
.. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
59+
.. c:function:: PyObject* PyList_GetItemRef(PyObject *list, Py_ssize_t index)
6060
6161
Return the object at position *index* in the list pointed to by *list*. The
6262
position must be non-negative; indexing from the end of the list is not
63-
supported. If *index* is out of bounds (<0 or >=len(list)),
63+
supported. If *index* is out of bounds (:code:`<0 or >=len(list)`),
6464
return ``NULL`` and set an :exc:`IndexError` exception.
6565
66+
.. versionadded:: 3.13
67+
68+
69+
.. c:function:: PyObject* PyList_GetItem(PyObject *list, Py_ssize_t index)
70+
71+
Like :c:func:`PyList_GetItemRef`, but returns a
72+
:term:`borrowed reference` instead of a :term:`strong reference`.
73+
6674
6775
.. c:function:: PyObject* PyList_GET_ITEM(PyObject *list, Py_ssize_t i)
6876

Doc/conf.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# The contents of this file are pickled, so don't put values in the namespace
77
# that aren't pickleable (module imports are okay, they're removed automatically).
88

9-
import sys, os, time
9+
import os
10+
import sys
11+
import time
1012
sys.path.append(os.path.abspath('tools/extensions'))
1113
sys.path.append(os.path.abspath('includes'))
1214

@@ -55,7 +57,7 @@
5557

5658
# General substitutions.
5759
project = 'Python'
58-
copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y')
60+
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
5961

6062
# We look for the Include/patchlevel.h file in the current Python source tree
6163
# and replace the values accordingly.
@@ -302,6 +304,9 @@
302304
'root_include_title': False # We use the version switcher instead.
303305
}
304306

307+
if os.getenv("READTHEDOCS"):
308+
html_theme_options["hosted_on"] = '<a href="https://about.readthedocs.com/">Read the Docs</a>'
309+
305310
# Override stylesheet fingerprinting for Windows CHM htmlhelp to fix GH-91207
306311
# https://github.com/python/cpython/issues/91207
307312
if any('htmlhelp' in arg for arg in sys.argv):
@@ -310,7 +315,7 @@
310315
print("It may be removed in the future\n")
311316

312317
# Short title used e.g. for <title> HTML tags.
313-
html_short_title = '%s Documentation' % release
318+
html_short_title = f'{release} Documentation'
314319

315320
# Deployment preview information
316321
# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
@@ -359,26 +364,22 @@
359364

360365
latex_engine = 'xelatex'
361366

362-
# Get LaTeX to handle Unicode correctly
363367
latex_elements = {
364-
}
365-
366-
# Additional stuff for the LaTeX preamble.
367-
latex_elements['preamble'] = r'''
368+
# For the LaTeX preamble.
369+
'preamble': r'''
368370
\authoraddress{
369371
\sphinxstrong{Python Software Foundation}\\
370372
Email: \sphinxemail{[email protected]}
371373
}
372374
\let\Verbatim=\OriginalVerbatim
373375
\let\endVerbatim=\endOriginalVerbatim
374376
\setcounter{tocdepth}{2}
375-
'''
376-
377-
# The paper size ('letter' or 'a4').
378-
latex_elements['papersize'] = 'a4'
379-
380-
# The font size ('10pt', '11pt' or '12pt').
381-
latex_elements['pointsize'] = '10pt'
377+
''',
378+
# The paper size ('letter' or 'a4').
379+
'papersize': 'a4',
380+
# The font size ('10pt', '11pt' or '12pt').
381+
'pointsize': '10pt',
382+
}
382383

383384
# Grouping the document tree into LaTeX files. List of tuples
384385
# (source start file, target name, title, author, document class [howto/manual]).
@@ -441,9 +442,9 @@
441442

442443
# Regexes to find C items in the source files.
443444
coverage_c_regexes = {
444-
'cfunction': (r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)'),
445-
'data': (r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)'),
446-
'macro': (r'^#define ([^_][\w_]+)\(.*\)[\s|\\]'),
445+
'cfunction': r'^PyAPI_FUNC\(.*\)\s+([^_][\w_]+)',
446+
'data': r'^PyAPI_DATA\(.*\)\s+([^_][\w_]+)',
447+
'macro': r'^#define ([^_][\w_]+)\(.*\)[\s|\\]',
447448
}
448449

449450
# The coverage checker will ignore all C items whose names match these regexes

Doc/data/refcounts.dat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,10 @@ PyList_GetItem:PyObject*::0:
11331133
PyList_GetItem:PyObject*:list:0:
11341134
PyList_GetItem:Py_ssize_t:index::
11351135

1136+
PyList_GetItemRef:PyObject*::+1:
1137+
PyList_GetItemRef:PyObject*:list:0:
1138+
PyList_GetItemRef:Py_ssize_t:index::
1139+
11361140
PyList_GetSlice:PyObject*::+1:
11371141
PyList_GetSlice:PyObject*:list:0:
11381142
PyList_GetSlice:Py_ssize_t:low::

0 commit comments

Comments
 (0)