Skip to content

Commit eff115a

Browse files
committed
Merge branch 'main' into intern-dataclass-field-names
2 parents c653873 + 5d59b87 commit eff115a

File tree

715 files changed

+22632
-11556
lines changed

Some content is hidden

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

715 files changed

+22632
-11556
lines changed

.github/CODEOWNERS

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,23 @@ Objects/type* @markshannon
2929
Objects/codeobject.c @markshannon
3030
Objects/frameobject.c @markshannon
3131
Objects/call.c @markshannon
32-
Python/ceval*.c @markshannon @gvanrossum
33-
Python/ceval*.h @markshannon @gvanrossum
32+
Python/ceval*.c @markshannon
33+
Python/ceval*.h @markshannon
3434
Python/compile.c @markshannon @iritkatriel
3535
Python/assemble.c @markshannon @iritkatriel
3636
Python/flowgraph.c @markshannon @iritkatriel
37+
Python/instruction_sequence.c @iritkatriel
3738
Python/ast_opt.c @isidentical
38-
Python/bytecodes.c @markshannon @gvanrossum
39-
Python/optimizer*.c @markshannon @gvanrossum
39+
Python/bytecodes.c @markshannon
40+
Python/optimizer*.c @markshannon
4041
Python/optimizer_analysis.c @Fidget-Spinner
4142
Python/optimizer_bytecodes.c @Fidget-Spinner
43+
Python/symtable.c @JelleZijlstra @carljm
44+
Lib/_pyrepl/* @pablogsal @lysnikolaou @ambv
4245
Lib/test/test_patma.py @brandtbucher
4346
Lib/test/test_type_*.py @JelleZijlstra
44-
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
47+
Lib/test/test_capi/test_misc.py @markshannon
48+
Lib/test/test_pyrepl/* @pablogsal @lysnikolaou @ambv
4549
Tools/c-analyzer/ @ericsnowcurrently
4650

4751
# dbm
@@ -72,11 +76,8 @@ Programs/python.c @ericsnowcurrently
7276
Tools/build/generate_global_objects.py @ericsnowcurrently
7377

7478
# Exceptions
75-
Lib/traceback.py @iritkatriel
7679
Lib/test/test_except*.py @iritkatriel
77-
Lib/test/test_traceback.py @iritkatriel
7880
Objects/exceptions.c @iritkatriel
79-
Python/traceback.c @iritkatriel
8081

8182
# Hashing
8283
**/*hashlib* @gpshead @tiran
@@ -150,13 +151,13 @@ Include/internal/pycore_time.h @pganssle @abalkin
150151
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
151152

152153
# Code generator
153-
/Tools/cases_generator/ @gvanrossum
154+
/Tools/cases_generator/ @markshannon
154155

155156
# AST
156-
Python/ast.c @isidentical
157-
Parser/asdl.py @isidentical
158-
Parser/asdl_c.py @isidentical
159-
Lib/ast.py @isidentical
157+
Python/ast.c @isidentical @JelleZijlstra
158+
Parser/asdl.py @isidentical @JelleZijlstra
159+
Parser/asdl_c.py @isidentical @JelleZijlstra
160+
Lib/ast.py @isidentical @JelleZijlstra
160161

161162
# Mock
162163
/Lib/unittest/mock.py @cjw296
@@ -173,6 +174,10 @@ Lib/ast.py @isidentical
173174
/Lib/test/test_subprocess.py @gpshead
174175
/Modules/*subprocess* @gpshead
175176

177+
# debugger
178+
**/*pdb* @gaogaotiantian
179+
**/*bdb* @gaogaotiantian
180+
176181
# Limited C API & stable ABI
177182
Tools/build/stable_abi.py @encukou
178183
Misc/stable_abi.toml @encukou

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ help:
3232
@echo " clean to remove build files"
3333
@echo " venv to create a venv with necessary tools"
3434
@echo " html to make standalone HTML files"
35+
@echo " gettext to generate POT files"
3536
@echo " htmlview to open the index page built by the html target in your browser"
3637
@echo " htmllive to rebuild and reload HTML files in your browser"
3738
@echo " htmlhelp to make HTML files and a HTML help project"
@@ -140,14 +141,23 @@ pydoc-topics: build
140141
@echo "Building finished; now run this:" \
141142
"cp build/pydoc-topics/topics.py ../Lib/pydoc_data/topics.py"
142143

144+
.PHONY: gettext
145+
gettext: BUILDER = gettext
146+
gettext: SPHINXOPTS += '-d build/doctrees-gettext'
147+
gettext: build
148+
143149
.PHONY: htmlview
144150
htmlview: html
145151
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
146152

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+
147157
.PHONY: htmllive
148158
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
149159
htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
150-
htmllive: html
160+
htmllive: ensure-sphinx-autobuild html
151161

152162
.PHONY: clean
153163
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/dict.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ Dictionary Objects
191191
to both *default_value* and *\*result* (if it's not ``NULL``).
192192
These may refer to the same object: in that case you hold two separate
193193
references to it.
194+
194195
.. versionadded:: 3.13
195196
196197

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)

0 commit comments

Comments
 (0)