Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into jit-stencil-initial…
Browse files Browse the repository at this point in the history
…izers
  • Loading branch information
mdboom committed Oct 18, 2024
2 parents 51618b6 + cda0ec8 commit 383f97a
Show file tree
Hide file tree
Showing 891 changed files with 14,158 additions and 4,840 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,5 @@ Lib/test/test_configparser.py @jaraco

# Doc sections
Doc/reference/ @willingc

**/*weakref* @kumaraditya303
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ body:
label: "CPython versions tested on:"
multiple: true
options:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "CPython main branch"
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/crash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ body:
label: "CPython versions tested on:"
multiple: true
options:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "CPython main branch"
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"
cache: pip
cache-dependency-path: Tools/requirements-dev.txt
- run: pip install -r Tools/requirements-dev.txt
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/reusable-change-detection.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---

name: Change detection
name: Reusable change detection

on: # yamllint disable-line rule:truthy
workflow_call:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs
name: Reusable Docs

on:
workflow_call:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
doctest:
name: 'Doctest'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable macOS

on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-tsan.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable Thread Sanitizer

on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable Ubuntu

on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-wasi.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable WASI

on:
workflow_call:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-windows-msi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: TestsMSI
name: Reusable Windows MSI

on:
workflow_call:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable Windows

on:
workflow_call:
inputs:
Expand Down
16 changes: 8 additions & 8 deletions Doc/c-api/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@ Context object management functions:
.. c:type:: PyContextEvent
Enumeration of possible context object watcher events:
- ``Py_CONTEXT_EVENT_ENTER``
- ``Py_CONTEXT_EVENT_EXIT``
- ``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a
different context. The object passed to the watch callback is the
now-current :class:`contextvars.Context` object, or None if no context is
current.
.. versionadded:: 3.14
.. c:type:: int (*PyContext_WatchCallback)(PyContextEvent event, PyContext* ctx)
.. c:type:: int (*PyContext_WatchCallback)(PyContextEvent event, PyObject *obj)
Type of a context object watcher callback function.
If *event* is ``Py_CONTEXT_EVENT_ENTER``, then the callback is invoked
after *ctx* has been set as the current context for the current thread.
Otherwise, the callback is invoked before the deactivation of *ctx* as the current context
and the restoration of the previous contex object for the current thread.
Context object watcher callback function. The object passed to the callback
is event-specific; see :c:type:`PyContextEvent` for details.
If the callback returns with an exception set, it must return ``-1``; this
exception will be printed as an unraisable exception using
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ code, or when embedding the Python interpreter:
created by Python. Refer to
:ref:`cautions-regarding-runtime-finalization` for more details.
.. versionchanged:: next
.. versionchanged:: 3.14
Hangs the current thread, rather than terminating it, if called while the
interpreter is finalizing.
Expand Down Expand Up @@ -1257,7 +1257,7 @@ with sub-interpreters:
created by Python. Refer to
:ref:`cautions-regarding-runtime-finalization` for more details.
.. versionchanged:: next
.. versionchanged:: 3.14
Hangs the current thread, rather than terminating it, if called while the
interpreter is finalizing.
Expand Down Expand Up @@ -1547,7 +1547,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
:c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`,
and terminate the current thread if called while the interpreter is finalizing.
.. versionchanged:: next
.. versionchanged:: 3.14
Hangs the current thread, rather than terminating it, if called while the
interpreter is finalizing.
Expand Down
18 changes: 12 additions & 6 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,8 @@ Create Config
Free memory of the initialization configuration *config*.
If *config* is ``NULL``, no operation is performed.
Error Handling
--------------
Expand Down Expand Up @@ -1823,14 +1825,18 @@ return ``-1`` on error:
PyInitConfig_Free(config);
return 0;
// Display the error message
const char *err_msg;
error:
(void)PyInitConfig_GetError(config, &err_msg);
printf("PYTHON INIT ERROR: %s\n", err_msg);
PyInitConfig_Free(config);
{
// Display the error message
// This uncommon braces style is used, because you cannot make
// goto targets point to variable declarations.
const char *err_msg;
(void)PyInitConfig_GetError(config, &err_msg);
printf("PYTHON INIT ERROR: %s\n", err_msg);
PyInitConfig_Free(config);
return -1;
return -1;
}
}
Expand Down
7 changes: 6 additions & 1 deletion Doc/c-api/long.rst
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
On failure, return -1 with an exception set. This function always succeeds
if *obj* is a :c:type:`PyLongObject` or its subtype.
.. versionadded:: next
.. versionadded:: 3.14
.. c:function:: PyObject* PyLong_GetInfo(void)
Expand Down Expand Up @@ -608,10 +608,15 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
Exactly what values are considered compact is an implementation detail
and is subject to change.
.. versionadded:: 3.12
.. c:function:: Py_ssize_t PyUnstable_Long_CompactValue(const PyLongObject* op)
If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`,
return its value.
Otherwise, the return value is undefined.
.. versionadded:: 3.12
4 changes: 3 additions & 1 deletion Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ PyUnicodeWriter
The :c:type:`PyUnicodeWriter` API can be used to create a Python :class:`str`
object.
.. versionadded:: next
.. versionadded:: 3.14
.. c:type:: PyUnicodeWriter
Expand All @@ -1600,6 +1600,8 @@ object.
Discard the internal Unicode buffer and destroy the writer instance.
If *writer* is ``NULL``, no operation is performed.
.. c:function:: int PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch)
Write the single Unicode character *ch* into *writer*.
Expand Down
32 changes: 25 additions & 7 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import sys
import time

import sphinx

sys.path.append(os.path.abspath('tools/extensions'))
sys.path.append(os.path.abspath('includes'))

Expand All @@ -21,6 +23,7 @@

extensions = [
'audit_events',
'availability',
'c_annotations',
'glossary_search',
'lexers',
Expand Down Expand Up @@ -61,7 +64,10 @@

# General substitutions.
project = 'Python'
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
if sphinx.version_info[:2] >= (8, 1):
copyright = "2001-%Y, Python Software Foundation"
else:
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"

# We look for the Include/patchlevel.h file in the current Python source tree
# and replace the values accordingly.
Expand Down Expand Up @@ -360,10 +366,14 @@
}

# This 'Last updated on:' timestamp is inserted at the bottom of every page.
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
html_last_updated_fmt = time.strftime(
'%b %d, %Y (%H:%M UTC)', time.gmtime(html_time)
)
html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)'
if sphinx.version_info[:2] >= (8, 1):
html_last_updated_use_utc = True
else:
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
html_last_updated_fmt = time.strftime(
html_last_updated_fmt, time.gmtime(html_time)
)

# Path to find HTML templates.
templates_path = ['tools/templates']
Expand Down Expand Up @@ -595,13 +605,21 @@
# mapping unique short aliases to a base URL and a prefix.
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
extlinks = {
"cve": ("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s", "CVE-%s"),
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
"pypi": ("https://pypi.org/project/%s/", "%s"),
"source": (SOURCE_URI, "%s"),
}
extlinks_detect_hardcoded_links = True

if sphinx.version_info[:2] < (8, 1):
# Sphinx 8.1 has in-built CVE and CWE roles.
extlinks |= {
"cve": (
"https://www.cve.org/CVERecord?id=CVE-%s",
"CVE-%s",
),
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
}

# Options for c_annotations
# -------------------------

Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/c-api-pending-removal-in-3.14.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.14
Pending removal in Python 3.14
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/c-api-pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.15
Pending removal in Python 3.15
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* The bundled copy of ``libmpdecimal``.
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/c-api-pending-removal-in-future.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Future Versions
Pending removal in future versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following APIs are deprecated and will be removed,
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deprecations

.. include:: pending-removal-in-future.rst

C API Deprecations
C API deprecations
------------------

.. include:: c-api-pending-removal-in-3.15.rst
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-3.13.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.13
Pending removal in Python 3.13
------------------------------

Modules (see :pep:`594`):
Expand Down
2 changes: 1 addition & 1 deletion Doc/deprecations/pending-removal-in-3.14.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.14
Pending removal in Python 3.14
------------------------------

* The import system:
Expand Down
4 changes: 2 additions & 2 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pending Removal in Python 3.15
Pending removal in Python 3.15
------------------------------

* The import system:
Expand Down Expand Up @@ -63,7 +63,7 @@ Pending Removal in Python 3.15

* The undocumented keyword argument syntax for creating
:class:`~typing.NamedTuple` classes
(e.g. ``Point = NamedTuple("Point", x=int, y=int)``)
(for example, ``Point = NamedTuple("Point", x=int, y=int)``)
has been deprecated since Python 3.13.
Use the class-based syntax or the functional syntax instead.

Expand Down
Loading

0 comments on commit 383f97a

Please sign in to comment.