Skip to content

Commit ec4e0eb

Browse files
authored
Merge branch 'main' into bump-bundled-pip-to-24.1
2 parents 93438e5 + 4717aaa commit ec4e0eb

968 files changed

Lines changed: 33718 additions & 16325 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.

.github/CODEOWNERS

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
# Build system
1515
configure* @erlend-aasland @corona10
16+
Makefile.pre.in @erlend-aasland
17+
Modules/Setup* @erlend-aasland
1618

1719
# asyncio
1820
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
@@ -29,19 +31,23 @@ Objects/type* @markshannon
2931
Objects/codeobject.c @markshannon
3032
Objects/frameobject.c @markshannon
3133
Objects/call.c @markshannon
32-
Python/ceval*.c @markshannon @gvanrossum
33-
Python/ceval*.h @markshannon @gvanrossum
34+
Python/ceval*.c @markshannon
35+
Python/ceval*.h @markshannon
3436
Python/compile.c @markshannon @iritkatriel
3537
Python/assemble.c @markshannon @iritkatriel
3638
Python/flowgraph.c @markshannon @iritkatriel
39+
Python/instruction_sequence.c @iritkatriel
3740
Python/ast_opt.c @isidentical
38-
Python/bytecodes.c @markshannon @gvanrossum
39-
Python/optimizer*.c @markshannon @gvanrossum
41+
Python/bytecodes.c @markshannon
42+
Python/optimizer*.c @markshannon
4043
Python/optimizer_analysis.c @Fidget-Spinner
4144
Python/optimizer_bytecodes.c @Fidget-Spinner
45+
Python/symtable.c @JelleZijlstra @carljm
46+
Lib/_pyrepl/* @pablogsal @lysnikolaou @ambv
4247
Lib/test/test_patma.py @brandtbucher
4348
Lib/test/test_type_*.py @JelleZijlstra
44-
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
49+
Lib/test/test_capi/test_misc.py @markshannon
50+
Lib/test/test_pyrepl/* @pablogsal @lysnikolaou @ambv
4551
Tools/c-analyzer/ @ericsnowcurrently
4652

4753
# dbm
@@ -72,11 +78,8 @@ Programs/python.c @ericsnowcurrently
7278
Tools/build/generate_global_objects.py @ericsnowcurrently
7379

7480
# Exceptions
75-
Lib/traceback.py @iritkatriel
7681
Lib/test/test_except*.py @iritkatriel
77-
Lib/test/test_traceback.py @iritkatriel
7882
Objects/exceptions.c @iritkatriel
79-
Python/traceback.c @iritkatriel
8083

8184
# Hashing
8285
**/*hashlib* @gpshead @tiran
@@ -150,13 +153,13 @@ Include/internal/pycore_time.h @pganssle @abalkin
150153
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
151154

152155
# Code generator
153-
/Tools/cases_generator/ @gvanrossum
156+
/Tools/cases_generator/ @markshannon
154157

155158
# AST
156-
Python/ast.c @isidentical
157-
Parser/asdl.py @isidentical
158-
Parser/asdl_c.py @isidentical
159-
Lib/ast.py @isidentical
159+
Python/ast.c @isidentical @JelleZijlstra
160+
Parser/asdl.py @isidentical @JelleZijlstra
161+
Parser/asdl_c.py @isidentical @JelleZijlstra
162+
Lib/ast.py @isidentical @JelleZijlstra
160163

161164
# Mock
162165
/Lib/unittest/mock.py @cjw296
@@ -173,6 +176,10 @@ Lib/ast.py @isidentical
173176
/Lib/test/test_subprocess.py @gpshead
174177
/Modules/*subprocess* @gpshead
175178

179+
# debugger
180+
**/*pdb* @gaogaotiantian
181+
**/*bdb* @gaogaotiantian
182+
176183
# Limited C API & stable ABI
177184
Tools/build/stable_abi.py @encukou
178185
Misc/stable_abi.toml @encukou
@@ -194,7 +201,6 @@ Doc/c-api/stable.rst @encukou
194201
**/*itertools* @rhettinger
195202
**/*collections* @rhettinger
196203
**/*random* @rhettinger
197-
**/*queue* @rhettinger
198204
**/*bisect* @rhettinger
199205
**/*heapq* @rhettinger
200206
**/*functools* @rhettinger
@@ -205,6 +211,7 @@ Doc/c-api/stable.rst @encukou
205211
**/*ensurepip* @pfmoore @pradyunsg
206212

207213
**/*idlelib* @terryjreedy
214+
/Doc/library/idle.rst @terryjreedy
208215

209216
**/*typing* @JelleZijlstra @AlexWaygood
210217

@@ -240,7 +247,7 @@ Doc/howto/clinic.rst @erlend-aasland
240247
**/*interpreteridobject.* @ericsnowcurrently
241248
**/*crossinterp* @ericsnowcurrently
242249
Lib/test/support/interpreters/ @ericsnowcurrently
243-
Modules/_xx*interp*module.c @ericsnowcurrently
250+
Modules/_interp*module.c @ericsnowcurrently
244251
Lib/test/test_interpreters/ @ericsnowcurrently
245252

246253
# Android

.github/workflows/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
# into the PR branch anyway.
5555
#
5656
# https://github.com/python/core-workflow/issues/373
57-
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
57+
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
5858
fi
5959
6060
# Check if we should run hypothesis tests
@@ -199,8 +199,9 @@ jobs:
199199
uses: ./.github/workflows/reusable-macos.yml
200200
with:
201201
config_hash: ${{ needs.check_source.outputs.config_hash }}
202-
# macos-14 is M1, macos-13 is Intel
203-
os-matrix: '["macos-14", "macos-13"]'
202+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
203+
# Cirrus used for upstream, macos-14 for forks.
204+
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
204205

205206
build_macos_free_threading:
206207
name: 'macOS (free-threading)'
@@ -210,8 +211,9 @@ jobs:
210211
with:
211212
config_hash: ${{ needs.check_source.outputs.config_hash }}
212213
free-threading: true
213-
# macos-14-large is Intel with 12 cores (most parallelism)
214-
os-matrix: '["macos-14"]'
214+
# Cirrus and macos-14 are M1.
215+
# Cirrus used for upstream, macos-14 for forks.
216+
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
215217

216218
build_ubuntu:
217219
name: 'Ubuntu'
@@ -388,7 +390,7 @@ jobs:
388390
id: cache-hypothesis-database
389391
uses: actions/cache@v4
390392
with:
391-
path: ./hypothesis
393+
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
392394
key: hypothesis-database-${{ github.head_ref || github.run_id }}
393395
restore-keys: |
394396
- hypothesis-database-
@@ -416,7 +418,7 @@ jobs:
416418
if: always()
417419
with:
418420
name: hypothesis-example-db
419-
path: .hypothesis/examples/
421+
path: ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/examples/
420422

421423

422424
build_asan:

.github/workflows/jit.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ on:
55
- '**jit**'
66
- 'Python/bytecodes.c'
77
- 'Python/optimizer*.c'
8+
- '!Python/perf_jit_trampoline.c'
9+
- '!**/*.md'
10+
- '!**/*.ini'
811
push:
912
paths:
1013
- '**jit**'
1114
- 'Python/bytecodes.c'
1215
- 'Python/optimizer*.c'
16+
- '!Python/perf_jit_trampoline.c'
17+
- '!**/*.md'
18+
- '!**/*.ini'
1319
workflow_dispatch:
1420

1521
permissions:
@@ -20,8 +26,22 @@ concurrency:
2026
cancel-in-progress: true
2127

2228
jobs:
29+
interpreter:
30+
name: Interpreter (Debug)
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 90
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Build tier two interpreter
36+
run: |
37+
./configure --enable-experimental-jit=interpreter --with-pydebug
38+
make all --jobs 4
39+
- name: Test tier two interpreter
40+
run: |
41+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
2342
jit:
2443
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
44+
needs: interpreter
2545
runs-on: ${{ matrix.runner }}
2646
timeout-minutes: 90
2747
strategy:
@@ -144,3 +164,22 @@ jobs:
144164
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations ' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
145165
make all --jobs 4
146166
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
167+
168+
jit-with-disabled-gil:
169+
name: Free-Threaded (Debug)
170+
needs: interpreter
171+
runs-on: ubuntu-latest
172+
steps:
173+
- uses: actions/checkout@v4
174+
- uses: actions/setup-python@v5
175+
with:
176+
python-version: '3.11'
177+
- name: Build with JIT enabled and GIL disabled
178+
run: |
179+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 18
180+
export PATH="$(llvm-config-18 --bindir):$PATH"
181+
./configure --enable-experimental-jit --with-pydebug --disable-gil
182+
make all --jobs 4
183+
- name: Run tests
184+
run: |
185+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.github/workflows/mypy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ concurrency:
3434
jobs:
3535
mypy:
3636
strategy:
37+
fail-fast: false
3738
matrix:
3839
target: [
3940
"Lib/_pyrepl",

.github/workflows/reusable-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
python Doc/tools/check-warnings.py \
6363
--annotate-diff '${{ env.branch_base }}' '${{ env.branch_pr }}' \
6464
--fail-if-regression \
65-
--fail-if-improved
65+
--fail-if-improved \
66+
--fail-if-new-news-nit
6667
6768
# This build doesn't use problem matchers or check annotations
6869
build_doc_oldest_supported_sphinx:

.github/workflows/reusable-macos.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
build_macos:
17-
name: 'build and test'
17+
name: build and test (${{ matrix.os }})
1818
timeout-minutes: 60
1919
env:
2020
HOMEBREW_NO_ANALYTICS: 1
@@ -27,6 +27,13 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: ${{fromJson(inputs.os-matrix)}}
30+
is-fork:
31+
- ${{ github.repository_owner != 'python' }}
32+
exclude:
33+
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
34+
is-fork: true
35+
- os: "macos-14"
36+
is-fork: false
3037
runs-on: ${{ matrix.os }}
3138
steps:
3239
- uses: actions/checkout@v4

Doc/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,14 @@ gettext: build
150150
htmlview: html
151151
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
152152

153+
.PHONY: ensure-sphinx-autobuild
154+
ensure-sphinx-autobuild: venv
155+
$(VENVDIR)/bin/sphinx-autobuild --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install sphinx-autobuild
156+
153157
.PHONY: htmllive
154158
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
155159
htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
156-
htmllive: html
160+
htmllive: ensure-sphinx-autobuild html
157161

158162
.PHONY: clean
159163
clean: clean-venv

Doc/c-api/buffer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
147147
or a :c:macro:`PyBUF_WRITABLE` request, the consumer must disregard
148148
:c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``.
149149

150-
.. c:member:: const char *format
150+
.. c:member:: char *format
151151
152-
A *NUL* terminated string in :mod:`struct` module style syntax describing
152+
A *NULL* terminated string in :mod:`struct` module style syntax describing
153153
the contents of a single item. If this is ``NULL``, ``"B"`` (unsigned bytes)
154154
is assumed.
155155

Doc/c-api/frame.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,18 @@ See also :ref:`Reflection <reflection>`.
121121
.. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame)
122122
123123
Get the *frame*'s :attr:`~frame.f_locals` attribute.
124-
If the frame refers to a function or comprehension, this returns
125-
a write-through proxy object that allows modifying the locals.
126-
In all other cases (classes, modules) it returns the :class:`dict`
127-
representing the frame locals directly.
124+
If the frame refers to an :term:`optimized scope`, this returns a
125+
write-through proxy object that allows modifying the locals.
126+
In all other cases (classes, modules, :func:`exec`, :func:`eval`) it returns
127+
the mapping representing the frame locals directly (as described for
128+
:func:`locals`).
128129
129130
Return a :term:`strong reference`.
130131
131132
.. versionadded:: 3.11
132133
133134
.. versionchanged:: 3.13
134-
Return a proxy object for functions and comprehensions.
135+
As part of :pep:`667`, return a proxy object for optimized scopes.
135136
136137
137138
.. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame)

Doc/c-api/hash.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
2929

3030
.. versionadded:: 3.13
3131

32+
.. c:macro:: PyHASH_MULTIPLIER
33+
34+
Prime multiplier used in string and various other hashes.
35+
36+
.. versionadded:: 3.13
37+
3238
.. c:macro:: PyHASH_INF
3339
3440
The hash value returned for a positive infinity.

0 commit comments

Comments
 (0)