Skip to content

Commit b2f353c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into 3.15-refactor-ssl-tests
2 parents 08be1f2 + 3199cfc commit b2f353c

File tree

327 files changed

+25099
-6053
lines changed

Some content is hidden

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

327 files changed

+25099
-6053
lines changed

.github/CODEOWNERS

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ Misc/externals.spdx.json @sethmlarson
143143
Misc/sbom.spdx.json @sethmlarson
144144
Tools/build/generate_sbom.py @sethmlarson
145145

146+
# ABI check
147+
Misc/libabigail.abignore @encukou
148+
146149

147150
# ----------------------------------------------------------------------------
148151
# Platform Support
@@ -173,9 +176,9 @@ Tools/wasm/config.site-wasm32-emscripten @freakboy3742 @emmatyping
173176
Tools/wasm/emscripten @freakboy3742 @emmatyping
174177

175178
# WebAssembly (WASI)
176-
Tools/wasm/wasi-env @brettcannon @emmatyping
177-
Tools/wasm/wasi.py @brettcannon @emmatyping
178-
Tools/wasm/wasi @brettcannon @emmatyping
179+
Tools/wasm/wasi-env @brettcannon @emmatyping @savannahostrowski
180+
Tools/wasm/wasi.py @brettcannon @emmatyping @savannahostrowski
181+
Tools/wasm/wasi @brettcannon @emmatyping @savannahostrowski
179182

180183
# Windows
181184
PC/ @python/windows-team
@@ -290,9 +293,9 @@ InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-T
290293

291294
# Micro-op / μop / Tier 2 Optimiser
292295
Python/optimizer.c @markshannon @Fidget-Spinner
293-
Python/optimizer_analysis.c @markshannon @tomasr8 @Fidget-Spinner
294-
Python/optimizer_bytecodes.c @markshannon @tomasr8 @Fidget-Spinner
295-
Python/optimizer_symbols.c @markshannon @tomasr8 @Fidget-Spinner
296+
Python/optimizer_analysis.c @markshannon @tomasr8 @Fidget-Spinner @savannahostrowski
297+
Python/optimizer_bytecodes.c @markshannon @tomasr8 @Fidget-Spinner @savannahostrowski
298+
Python/optimizer_symbols.c @markshannon @tomasr8 @Fidget-Spinner @savannahostrowski
296299

297300
# Parser, Lexer, and Grammar
298301
Grammar/python.gram @pablogsal @lysnikolaou

.github/workflows/build.yml

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@ jobs:
142142
- name: Check for unsupported C global variables
143143
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
144144
run: make check-c-globals
145-
- name: Check for undocumented C APIs
146-
run: make check-c-api-docs
147145

146+
check-c-api-docs:
147+
name: C API Docs
148+
needs: build-context
149+
if: >-
150+
needs.build-context.outputs.run-tests == 'true'
151+
|| needs.build-context.outputs.run-docs == 'true'
152+
uses: ./.github/workflows/reusable-check-c-api-docs.yml
148153

149154
build-windows:
150155
name: >-
@@ -586,45 +591,45 @@ jobs:
586591
run: |
587592
"$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed
588593
589-
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
590594
cifuzz:
591-
name: CIFuzz
592-
runs-on: ubuntu-latest
593-
timeout-minutes: 60
595+
# ${{ '' } is a hack to nest jobs under the same sidebar category.
596+
name: CIFuzz${{ '' }} # zizmor: ignore[obfuscation]
594597
needs: build-context
595-
if: needs.build-context.outputs.run-ci-fuzz == 'true'
598+
if: >-
599+
needs.build-context.outputs.run-ci-fuzz == 'true'
600+
|| needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
596601
permissions:
597602
security-events: write
598603
strategy:
599604
fail-fast: false
600605
matrix:
601-
sanitizer: [address, undefined, memory]
602-
steps:
603-
- name: Build fuzzers (${{ matrix.sanitizer }})
604-
id: build
605-
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
606-
with:
607-
oss-fuzz-project-name: cpython3
608-
sanitizer: ${{ matrix.sanitizer }}
609-
- name: Run fuzzers (${{ matrix.sanitizer }})
610-
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
611-
with:
612-
fuzz-seconds: 600
613-
oss-fuzz-project-name: cpython3
614-
output-sarif: true
615-
sanitizer: ${{ matrix.sanitizer }}
616-
- name: Upload crash
617-
if: failure() && steps.build.outcome == 'success'
618-
uses: actions/upload-artifact@v6
619-
with:
620-
name: ${{ matrix.sanitizer }}-artifacts
621-
path: ./out/artifacts
622-
- name: Upload SARIF
623-
if: always() && steps.build.outcome == 'success'
624-
uses: github/codeql-action/upload-sarif@v3
625-
with:
626-
sarif_file: cifuzz-sarif/results.sarif
627-
checkout_path: cifuzz-sarif
606+
sanitizer:
607+
- address
608+
- undefined
609+
- memory
610+
oss-fuzz-project-name:
611+
- cpython3
612+
- python3-libraries
613+
exclude:
614+
# Note that the 'no-exclude' sentinel below is to prevent
615+
# an empty string value from excluding all jobs and causing
616+
# GHA to create a 'default' matrix entry with all empty values.
617+
- oss-fuzz-project-name: >-
618+
${{
619+
needs.build-context.outputs.run-ci-fuzz == 'true'
620+
&& 'no-exclude'
621+
|| 'cpython3'
622+
}}
623+
- oss-fuzz-project-name: >-
624+
${{
625+
needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
626+
&& 'no-exclude'
627+
|| 'python3-libraries'
628+
}}
629+
uses: ./.github/workflows/reusable-cifuzz.yml
630+
with:
631+
oss-fuzz-project-name: ${{ matrix.oss-fuzz-project-name }}
632+
sanitizer: ${{ matrix.sanitizer }}
628633

629634
all-required-green: # This job does nothing and is only used for the branch protection
630635
name: All required checks pass
@@ -635,6 +640,7 @@ jobs:
635640
- check-docs
636641
- check-autoconf-regen
637642
- check-generated-files
643+
- check-c-api-docs
638644
- build-windows
639645
- build-windows-msi
640646
- build-macos
@@ -669,8 +675,19 @@ jobs:
669675
'
670676
|| ''
671677
}}
678+
${{
679+
!fromJSON(needs.build-context.outputs.run-tests)
680+
&& !fromJSON(needs.build-context.outputs.run-docs)
681+
&& 'check-c-api-docs,'
682+
|| ''
683+
}}
672684
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
673-
${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }}
685+
${{
686+
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
687+
&& !fromJSON(needs.build-context.outputs.run-ci-fuzz-stdlib)
688+
&& 'cifuzz,' ||
689+
''
690+
}}
674691
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
675692
${{
676693
!fromJSON(needs.build-context.outputs.run-ubuntu)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Reusable C API Docs Check
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
FORCE_COLOR: 1
11+
12+
jobs:
13+
check-c-api-docs:
14+
name: 'Check if all C APIs are documented'
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.x'
24+
- name: Check for undocumented C APIs
25+
run: python Tools/check-c-api-docs/main.py
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
2+
name: Reusable CIFuzz
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
oss-fuzz-project-name:
8+
description: OSS-Fuzz project name
9+
required: true
10+
type: string
11+
sanitizer:
12+
description: OSS-Fuzz sanitizer
13+
required: true
14+
type: string
15+
16+
jobs:
17+
cifuzz:
18+
name: ${{ inputs.oss-fuzz-project-name }} (${{ inputs.sanitizer }})
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 60
21+
steps:
22+
- name: Build fuzzers (${{ inputs.sanitizer }})
23+
id: build
24+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
25+
with:
26+
oss-fuzz-project-name: ${{ inputs.oss-fuzz-project-name }}
27+
sanitizer: ${{ inputs.sanitizer }}
28+
- name: Run fuzzers (${{ inputs.sanitizer }})
29+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
30+
with:
31+
fuzz-seconds: 600
32+
oss-fuzz-project-name: ${{ inputs.oss-fuzz-project-name }}
33+
output-sarif: true
34+
sanitizer: ${{ inputs.sanitizer }}
35+
- name: Upload crash
36+
if: failure() && steps.build.outcome == 'success'
37+
uses: actions/upload-artifact@v6
38+
with:
39+
name: ${{ inputs.sanitizer }}-artifacts
40+
path: ./out/artifacts
41+
- name: Upload SARIF
42+
if: always() && steps.build.outcome == 'success'
43+
uses: github/codeql-action/upload-sarif@v4
44+
with:
45+
sarif_file: cifuzz-sarif/results.sarif
46+
checkout_path: cifuzz-sarif

.github/workflows/reusable-context.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ on: # yamllint disable-line rule:truthy
2121
description: Whether to run the Android tests
2222
value: ${{ jobs.compute-changes.outputs.run-android }} # bool
2323
run-ci-fuzz:
24-
description: Whether to run the CIFuzz job
24+
description: Whether to run the CIFuzz job for 'cpython' fuzzer
2525
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz }} # bool
26+
run-ci-fuzz-stdlib:
27+
description: Whether to run the CIFuzz job for 'python3-libraries' fuzzer
28+
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz-stdlib }} # bool
2629
run-docs:
2730
description: Whether to build the docs
2831
value: ${{ jobs.compute-changes.outputs.run-docs }} # bool
@@ -56,6 +59,7 @@ jobs:
5659
outputs:
5760
run-android: ${{ steps.changes.outputs.run-android }}
5861
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
62+
run-ci-fuzz-stdlib: ${{ steps.changes.outputs.run-ci-fuzz-stdlib }}
5963
run-docs: ${{ steps.changes.outputs.run-docs }}
6064
run-ios: ${{ steps.changes.outputs.run-ios }}
6165
run-macos: ${{ steps.changes.outputs.run-macos }}

Doc/c-api/call.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ please see individual documentation for details.
347347
348348
.. versionadded:: 3.9
349349
350+
.. c:function:: PyObject* _PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
351+
:no-typesetting:
350352
351353
.. c:function:: PyObject* PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
352354
@@ -358,7 +360,12 @@ please see individual documentation for details.
358360
Return the result of the call on success, or raise an exception and return
359361
*NULL* on failure.
360362
361-
.. versionadded:: 3.9
363+
.. versionadded:: 3.8 as ``_PyObject_Vectorcall``
364+
365+
.. versionchanged:: 3.9
366+
367+
Renamed to the current name, without the leading underscore.
368+
The old provisional name is :term:`soft deprecated`.
362369
363370
.. c:function:: PyObject* PyObject_VectorcallDict(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwdict)
364371

Doc/c-api/code.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ bound into a function.
6969
The old name is deprecated, but will remain available until the
7070
signature changes again.
7171
72+
.. c:function:: PyCodeObject* PyCode_NewWithPosOnlyArgs(...)
73+
:no-typesetting:
74+
7275
.. c:function:: PyCodeObject* PyUnstable_Code_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, PyObject *qualname, int firstlineno, PyObject *linetable, PyObject *exceptiontable)
7376
7477
Similar to :c:func:`PyUnstable_Code_New`, but with an extra "posonlyargcount" for positional-only arguments.
7578
The same caveats that apply to ``PyUnstable_Code_New`` also apply to this function.
7679
77-
.. index:: single: PyCode_NewWithPosOnlyArgs (C function)
78-
7980
.. versionadded:: 3.8 as ``PyCode_NewWithPosOnlyArgs``
8081
8182
.. versionchanged:: 3.11
@@ -298,6 +299,9 @@ These functions are part of the unstable C API tier:
298299
this functionality is a CPython implementation detail, and the API
299300
may change without deprecation warnings.
300301
302+
.. c:function:: Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free)
303+
:no-typesetting:
304+
301305
.. c:function:: Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc free)
302306
303307
Return a new opaque index value used to adding data to code objects.
@@ -310,8 +314,6 @@ may change without deprecation warnings.
310314
*free* will be called on non-``NULL`` data stored under the new index.
311315
Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`.
312316
313-
.. index:: single: _PyEval_RequestCodeExtraIndex (C function)
314-
315317
.. versionadded:: 3.6 as ``_PyEval_RequestCodeExtraIndex``
316318
317319
.. versionchanged:: 3.12
@@ -320,6 +322,9 @@ may change without deprecation warnings.
320322
The old private name is deprecated, but will be available until the API
321323
changes.
322324
325+
.. c:function:: int _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
326+
:no-typesetting:
327+
323328
.. c:function:: int PyUnstable_Code_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
324329
325330
Set *extra* to the extra data stored under the given index.
@@ -328,8 +333,6 @@ may change without deprecation warnings.
328333
If no data was set under the index, set *extra* to ``NULL`` and return
329334
0 without setting an exception.
330335
331-
.. index:: single: _PyCode_GetExtra (C function)
332-
333336
.. versionadded:: 3.6 as ``_PyCode_GetExtra``
334337
335338
.. versionchanged:: 3.12
@@ -338,13 +341,14 @@ may change without deprecation warnings.
338341
The old private name is deprecated, but will be available until the API
339342
changes.
340343
344+
.. c:function:: int _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
345+
:no-typesetting:
346+
341347
.. c:function:: int PyUnstable_Code_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
342348
343349
Set the extra data stored under the given index to *extra*.
344350
Return 0 on success. Set an exception and return -1 on failure.
345351
346-
.. index:: single: _PyCode_SetExtra (C function)
347-
348352
.. versionadded:: 3.6 as ``_PyCode_SetExtra``
349353
350354
.. versionchanged:: 3.12

Doc/c-api/file.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,22 @@ the :mod:`io` APIs instead.
131131
132132
Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on
133133
failure; the appropriate exception will be set.
134+
135+
136+
Deprecated API
137+
^^^^^^^^^^^^^^
138+
139+
140+
These are :term:`soft deprecated` APIs that were included in Python's C API
141+
by mistake. They are documented solely for completeness; use other
142+
``PyFile*`` APIs instead.
143+
144+
.. c:function:: PyObject *PyFile_NewStdPrinter(int fd)
145+
146+
Use :c:func:`PyFile_FromFd` with defaults (``fd, NULL, "w", -1, NULL, NULL, NULL, 0``) instead.
147+
148+
.. c:var:: PyTypeObject PyStdPrinter_Type
149+
150+
Type of file-like objects used internally at Python startup when :py:mod:`io` is
151+
not yet available.
152+
Use Python :py:func:`open` or :c:func:`PyFile_FromFd` to create file objects instead.

Doc/c-api/gen.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
4545
A reference to *frame* is stolen by this function. The *frame* argument
4646
must not be ``NULL``.
4747
48+
4849
.. c:function:: PyCodeObject* PyGen_GetCode(PyGenObject *gen)
4950
5051
Return a new :term:`strong reference` to the code object wrapped by *gen*.
@@ -82,3 +83,14 @@ Asynchronous Generator Objects
8283
This function always succeeds.
8384
8485
.. versionadded:: 3.6
86+
87+
88+
Deprecated API
89+
^^^^^^^^^^^^^^
90+
91+
.. c:macro:: PyAsyncGenASend_CheckExact(op)
92+
93+
This is a :term:`soft deprecated` API that was included in Python's C API
94+
by mistake.
95+
96+
It is solely here for completeness; do not use this API.

0 commit comments

Comments
 (0)