Skip to content

Commit 9986d88

Browse files
committed
Merge upstream/main into gh-138122-fix
Resolved merge conflicts in: - Include/cpython/pystate.h: Keep both base_frame and last_profiled_frame fields - Include/internal/pycore_debug_offsets.h: Add debug offsets for both fields - InternalDocs/frames.md: Include documentation for both features - Modules/_remote_debugging/_remote_debugging.h: Updated process_frame_chain signature - Modules/_remote_debugging/frames.c: Merged base_frame validation with caching logic - Modules/_remote_debugging/threads.c: Integrated caching support with base_frame The base_frame feature (for stack validation) now coexists with the last_profiled_frame feature (for profiling cache optimization).
2 parents e14dc8e + 572c780 commit 9986d88

File tree

279 files changed

+17476
-5010
lines changed

Some content is hidden

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

279 files changed

+17476
-5010
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ Doc/howto/clinic.rst @erlend-aasland @AA-Turner
126126
# C Analyser
127127
Tools/c-analyzer/ @ericsnowcurrently
128128

129+
# C API Documentation Checks
130+
Tools/check-c-api-docs/ @ZeroIntensity
131+
129132
# Fuzzing
130133
Modules/_xxtestfuzz/ @ammaraskar
131134

.github/CONTRIBUTING.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ Please be aware that our workflow does deviate slightly from the typical GitHub
2828
project. Details on how to properly submit a pull request are covered in
2929
`Lifecycle of a Pull Request <https://devguide.python.org/getting-started/pull-request-lifecycle.html>`_.
3030
We utilize various bots and status checks to help with this, so do follow the
31-
comments they leave and their "Details" links, respectively. The key points of
32-
our workflow that are not covered by a bot or status check are:
31+
comments they leave and their "Details" links, respectively.
3332

34-
- All discussions that are not directly related to the code in the pull request
35-
should happen on `GitHub Issues <https://github.com/python/cpython/issues>`_.
36-
- Upon your first non-trivial pull request (which includes documentation changes),
37-
feel free to add yourself to ``Misc/ACKS``.
33+
The final key part of our workflow is that all discussions that are not
34+
directly related to the code in the pull request should happen on
35+
`GitHub Issues <https://github.com/python/cpython/issues>`__, generally in the
36+
pull request's parent issue.
3837

3938

4039
Setting Expectations

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ contact_links:
55
- name: "Proposing new features"
66
about: "Submit major feature proposal (e.g. syntax changes) to an ideas forum first."
77
url: "https://discuss.python.org/c/ideas/6"
8+
- name: "Python Install Manager issues"
9+
about: "Report issues with the Python Install Manager (for Windows)"
10+
url: "https://github.com/python/pymanager/issues"

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ 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
147+
145148

146149
build-windows:
147150
name: >-

Android/android.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
ANDROID_DIR.name == "Android" and (PYTHON_DIR / "pyconfig.h.in").exists()
3030
)
3131

32+
ENV_SCRIPT = ANDROID_DIR / "android-env.sh"
3233
TESTBED_DIR = ANDROID_DIR / "testbed"
3334
CROSS_BUILD_DIR = PYTHON_DIR / "cross-build"
3435

@@ -129,12 +130,11 @@ def android_env(host):
129130
sysconfig_filename = next(sysconfig_files).name
130131
host = re.fullmatch(r"_sysconfigdata__android_(.+).py", sysconfig_filename)[1]
131132

132-
env_script = ANDROID_DIR / "android-env.sh"
133133
env_output = subprocess.run(
134134
f"set -eu; "
135135
f"HOST={host}; "
136136
f"PREFIX={prefix}; "
137-
f". {env_script}; "
137+
f". {ENV_SCRIPT}; "
138138
f"export",
139139
check=True, shell=True, capture_output=True, encoding='utf-8',
140140
).stdout
@@ -151,7 +151,7 @@ def android_env(host):
151151
env[key] = value
152152

153153
if not env:
154-
raise ValueError(f"Found no variables in {env_script.name} output:\n"
154+
raise ValueError(f"Found no variables in {ENV_SCRIPT.name} output:\n"
155155
+ env_output)
156156
return env
157157

@@ -281,15 +281,30 @@ def clean_all(context):
281281

282282

283283
def setup_ci():
284-
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
285-
if "GITHUB_ACTIONS" in os.environ and platform.system() == "Linux":
286-
run(
287-
["sudo", "tee", "/etc/udev/rules.d/99-kvm4all.rules"],
288-
input='KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n',
289-
text=True,
290-
)
291-
run(["sudo", "udevadm", "control", "--reload-rules"])
292-
run(["sudo", "udevadm", "trigger", "--name-match=kvm"])
284+
if "GITHUB_ACTIONS" in os.environ:
285+
# Enable emulator hardware acceleration
286+
# (https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/).
287+
if platform.system() == "Linux":
288+
run(
289+
["sudo", "tee", "/etc/udev/rules.d/99-kvm4all.rules"],
290+
input='KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n',
291+
text=True,
292+
)
293+
run(["sudo", "udevadm", "control", "--reload-rules"])
294+
run(["sudo", "udevadm", "trigger", "--name-match=kvm"])
295+
296+
# Free up disk space by deleting unused versions of the NDK
297+
# (https://github.com/freakboy3742/pyspamsum/pull/108).
298+
for line in ENV_SCRIPT.read_text().splitlines():
299+
if match := re.fullmatch(r"ndk_version=(.+)", line):
300+
ndk_version = match[1]
301+
break
302+
else:
303+
raise ValueError(f"Failed to find NDK version in {ENV_SCRIPT.name}")
304+
305+
for item in (android_home / "ndk").iterdir():
306+
if item.name[0].isdigit() and item.name != ndk_version:
307+
delete_glob(item)
293308

294309

295310
def setup_sdk():

Android/testbed/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ android {
7979
val androidEnvFile = file("../../android-env.sh").absoluteFile
8080

8181
namespace = "org.python.testbed"
82-
compileSdk = 34
82+
compileSdk = 35
8383

8484
defaultConfig {
8585
applicationId = "org.python.testbed"
@@ -92,7 +92,7 @@ android {
9292
}
9393
throw GradleException("Failed to find API level in $androidEnvFile")
9494
}
95-
targetSdk = 34
95+
targetSdk = 35
9696

9797
versionCode = 1
9898
versionName = "1.0"

Doc/about.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ Contributors to the Python documentation
3232
----------------------------------------
3333

3434
Many people have contributed to the Python language, the Python standard
35-
library, and the Python documentation. See :source:`Misc/ACKS` in the Python
36-
source distribution for a partial list of contributors.
35+
library, and the Python documentation. See the `CPython
36+
GitHub repository <https://github.com/python/cpython/graphs/contributors>`__
37+
for a partial list of contributors.
3738

3839
It is only with the input and contributions of the Python community
3940
that Python has such wonderful documentation -- Thank You!

Doc/c-api/conversion.rst

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,33 @@ The following functions provide locale-independent string to number conversions.
162162
.. versionadded:: 3.1
163163
164164
165-
.. c:function:: int PyOS_stricmp(const char *s1, const char *s2)
165+
.. c:function:: int PyOS_mystricmp(const char *str1, const char *str2)
166+
int PyOS_mystrnicmp(const char *str1, const char *str2, Py_ssize_t size)
166167
167-
Case insensitive comparison of strings. The function works almost
168-
identically to :c:func:`!strcmp` except that it ignores the case.
168+
Case insensitive comparison of strings. These functions work almost
169+
identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively),
170+
except that they ignore the case of ASCII characters.
169171
172+
Return ``0`` if the strings are equal, a negative value if *str1* sorts
173+
lexicographically before *str2*, or a positive value if it sorts after.
170174
171-
.. c:function:: int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size)
175+
In the *str1* or *str2* arguments, a NUL byte marks the end of the string.
176+
For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size
177+
of the string, as if NUL was present at the index given by *size*.
172178
173-
Case insensitive comparison of strings. The function works almost
174-
identically to :c:func:`!strncmp` except that it ignores the case.
179+
These functions do not use the locale.
180+
181+
182+
.. c:function:: int PyOS_stricmp(const char *str1, const char *str2)
183+
int PyOS_strnicmp(const char *str1, const char *str2, Py_ssize_t size)
184+
185+
Case insensitive comparison of strings.
186+
187+
On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`,
188+
respectively.
189+
190+
On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and
191+
:c:func:`PyOS_mystrnicmp`, respectively.
175192
176193
177194
Character classification and conversion

Doc/c-api/descriptor.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,46 @@ found in the dictionary of type objects.
2121
.. c:function:: PyObject* PyDescr_NewMember(PyTypeObject *type, struct PyMemberDef *meth)
2222
2323
24+
.. c:var:: PyTypeObject PyMemberDescr_Type
25+
26+
The type object for member descriptor objects created from
27+
:c:type:`PyMemberDef` structures. These descriptors expose fields of a
28+
C struct as attributes on a type, and correspond
29+
to :class:`types.MemberDescriptorType` objects in Python.
30+
31+
32+
33+
.. c:var:: PyTypeObject PyGetSetDescr_Type
34+
35+
The type object for get/set descriptor objects created from
36+
:c:type:`PyGetSetDef` structures. These descriptors implement attributes
37+
whose value is computed by C getter and setter functions, and are used
38+
for many built-in type attributes.
39+
40+
2441
.. c:function:: PyObject* PyDescr_NewMethod(PyTypeObject *type, struct PyMethodDef *meth)
2542
2643
44+
.. c:var:: PyTypeObject PyMethodDescr_Type
45+
46+
The type object for method descriptor objects created from
47+
:c:type:`PyMethodDef` structures. These descriptors expose C functions as
48+
methods on a type, and correspond to :class:`types.MemberDescriptorType`
49+
objects in Python.
50+
51+
2752
.. c:function:: PyObject* PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *wrapper, void *wrapped)
2853
2954
55+
.. c:var:: PyTypeObject PyWrapperDescr_Type
56+
57+
The type object for wrapper descriptor objects created by
58+
:c:func:`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`. Wrapper
59+
descriptors are used internally to expose special methods implemented
60+
via wrapper structures, and appear in Python as
61+
:class:`types.WrapperDescriptorType` objects.
62+
63+
3064
.. c:function:: PyObject* PyDescr_NewClassMethod(PyTypeObject *type, PyMethodDef *method)
3165
3266
@@ -55,6 +89,14 @@ Built-in descriptors
5589
:class:`classmethod` in the Python layer.
5690
5791
92+
.. c:var:: PyTypeObject PyClassMethodDescr_Type
93+
94+
The type object for C-level class method descriptor objects.
95+
This is the type of the descriptors created for :func:`classmethod` defined in
96+
C extension types, and is the same object as :class:`classmethod`
97+
in Python.
98+
99+
58100
.. c:function:: PyObject *PyClassMethod_New(PyObject *callable)
59101
60102
Create a new :class:`classmethod` object wrapping *callable*.

Doc/c-api/dict.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ Dictionary Objects
4343
prevent modification of the dictionary for non-dynamic class types.
4444
4545
46+
.. c:var:: PyTypeObject PyDictProxy_Type
47+
48+
The type object for mapping proxy objects created by
49+
:c:func:`PyDictProxy_New` and for the read-only ``__dict__`` attribute
50+
of many built-in types. A :c:type:`PyDictProxy_Type` instance provides a
51+
dynamic, read-only view of an underlying dictionary: changes to the
52+
underlying dictionary are reflected in the proxy, but the proxy itself
53+
does not support mutation operations. This corresponds to
54+
:class:`types.MappingProxyType` in Python.
55+
56+
4657
.. c:function:: void PyDict_Clear(PyObject *p)
4758
4859
Empty an existing dictionary of all key-value pairs.

0 commit comments

Comments
 (0)