Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into monitoring-capi
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Mar 7, 2024
2 parents ebc36b5 + 72dbea2 commit 1ad872c
Show file tree
Hide file tree
Showing 246 changed files with 6,585 additions and 2,968 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV WASI_SDK_VERSION=20
ENV WASI_SDK_PATH=/opt/wasi-sdk

ENV WASMTIME_HOME=/opt/wasmtime
ENV WASMTIME_VERSION=14.0.4
ENV WASMTIME_VERSION=18.0.2
ENV WASMTIME_CPU_ARCH=x86_64

RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Include/opcode_ids.h generated
Include/token.h generated
Lib/_opcode_metadata.py generated
Lib/keyword.py generated
Lib/test/certdata/*.pem generated
Lib/test/certdata/*.0 generated
Lib/test/levenshtein_examples.json generated
Lib/test/test_stable_abi_ctypes.py generated
Lib/token.py generated
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
target:
- i686-pc-windows-msvc/msvc
- x86_64-pc-windows-msvc/msvc
- aarch64-pc-windows-msvc/msvc
- x86_64-apple-darwin/clang
- aarch64-apple-darwin/clang
- x86_64-unknown-linux-gnu/gcc
Expand All @@ -49,6 +50,10 @@ jobs:
architecture: x64
runner: windows-latest
compiler: msvc
- target: aarch64-pc-windows-msvc/msvc
architecture: ARM64
runner: windows-latest
compiler: msvc
- target: x86_64-apple-darwin/clang
architecture: x86_64
runner: macos-13
Expand Down Expand Up @@ -85,14 +90,21 @@ jobs:
with:
python-version: '3.11'

- name: Windows
if: runner.os == 'Windows'
- name: Native Windows
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
run: |
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
- name: macOS
# No PGO or tests (yet):
- name: Emulated Windows
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
run: |
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
- name: Native macOS
if: runner.os == 'macOS'
run: |
brew install llvm@${{ matrix.llvm }}
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ Lib/test/data/*
/_bootstrap_python
/Makefile
/Makefile.pre
iOSTestbed.*
iOS/Frameworks/
iOS/Resources/Info.plist
iOS/testbed/build
iOS/testbed/Python.xcframework/ios-*/bin
iOS/testbed/Python.xcframework/ios-*/include
iOS/testbed/Python.xcframework/ios-*/lib
iOS/testbed/Python.xcframework/ios-*/Python.framework
iOS/testbed/iOSTestbed.xcodeproj/project.xcworkspace
iOS/testbed/iOSTestbed.xcodeproj/xcuserdata
iOS/testbed/iOSTestbed.xcodeproj/xcshareddata
Mac/Makefile
Mac/PythonLauncher/Info.plist
Mac/PythonLauncher/Makefile
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Context Variables Objects
-------------------------

.. _contextvarsobjects_pointertype_change:
.. versionadded:: 3.7

.. versionchanged:: 3.7.1

.. note::
Expand All @@ -24,8 +26,6 @@ Context Variables Objects
See :issue:`34762` for more details.


.. versionadded:: 3.7

This section details the public C API for the :mod:`contextvars` module.

.. c:type:: PyContext
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Importing Modules
The module name, as an ASCII encoded string.
.. c: member:: PyObject* (*initfunc)(void)
.. c:member:: PyObject* (*initfunc)(void)
Initialization function for a module built into the interpreter.
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1575,14 +1575,14 @@ pointer and a void pointer argument.
function is generally **not** suitable for calling Python code from
arbitrary C threads. Instead, use the :ref:`PyGILState API<gilstate>`.
.. versionadded:: 3.1
.. versionchanged:: 3.9
If this function is called in a subinterpreter, the function *func* is
now scheduled to be called from the subinterpreter, rather than being
called from the main interpreter. Each subinterpreter now has its own
list of scheduled calls.
.. versionadded:: 3.1
.. _profiling:
Profiling and Tracing
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/refcounting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ of Python objects.
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
.. versionchanged:: 3.11
The parameter type is no longer :c:expr:`const PyObject*`.
.. versionchanged:: 3.10
:c:func:`Py_REFCNT()` is changed to the inline static function.
.. versionchanged:: 3.11
The parameter type is no longer :c:expr:`const PyObject*`.
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
Expand Down
6 changes: 3 additions & 3 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -702,20 +702,20 @@ Defining Getters and Setters
.. c:member:: void* closure
Optional function pointer, providing additional data for getter and setter.
Optional user data pointer, providing additional data for getter and setter.
.. c:type:: PyObject *(*getter)(PyObject *, void *)
The ``get`` function takes one :c:expr:`PyObject*` parameter (the
instance) and a function pointer (the associated ``closure``):
instance) and a user data pointer (the associated ``closure``):
It should return a new reference on success or ``NULL`` with a set exception
on failure.
.. c:type:: int (*setter)(PyObject *, PyObject *, void *)
``set`` functions take two :c:expr:`PyObject*` parameters (the instance and
the value to be set) and a function pointer (the associated ``closure``):
the value to be set) and a user data pointer (the associated ``closure``):
In case the attribute should be deleted the second parameter is ``NULL``.
Should return ``0`` on success or ``-1`` with a set exception on failure.
8 changes: 5 additions & 3 deletions Doc/faq/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ Python versions are numbered "A.B.C" or "A.B":
changes.
* *C* is the micro version number -- it is incremented for each bugfix release.

See :pep:`6` for more information about bugfix releases.

Not all releases are bugfix releases. In the run-up to a new feature release, a
series of development releases are made, denoted as alpha, beta, or release
candidate. Alphas are early releases in which interfaces aren't yet finalized;
Expand All @@ -157,7 +155,11 @@ unreleased versions, built directly from the CPython development repository. In
practice, after a final minor release is made, the version is incremented to the
next minor version, which becomes the "a0" version, e.g. "2.4a0".

See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, and
See the `Developer's Guide
<https://devguide.python.org/developer-workflow/development-cycle/>`__
for more information about the development cycle, and
:pep:`387` to learn more about Python's backward compatibility policy. See also
the documentation for :data:`sys.version`, :data:`sys.hexversion`, and
:data:`sys.version_info`.


Expand Down
8 changes: 4 additions & 4 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@ Opening network connections
The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*,
*allow_broadcast*, and *sock* parameters were added.

.. versionchanged:: 3.8
Added support for Windows.

.. versionchanged:: 3.8.1
The *reuse_address* parameter is no longer supported, as using
:ref:`socket.SO_REUSEADDR <socket-unix-constants>`
Expand All @@ -622,11 +625,8 @@ Opening network connections
prevents processes with differing UIDs from assigning sockets to the same
socket address.

.. versionchanged:: 3.8
Added support for Windows.

.. versionchanged:: 3.11
The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1,
The *reuse_address* parameter, disabled since Python 3.8.1,
3.7.6 and 3.6.10, has been entirely removed.

.. coroutinemethod:: loop.create_unix_connection(protocol_factory, \
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ StreamWriter
be resumed. When there is nothing to wait for, the :meth:`drain`
returns immediately.

.. coroutinemethod:: start_tls(sslcontext, \*, server_hostname=None, \
.. coroutinemethod:: start_tls(sslcontext, *, server_hostname=None, \
ssl_handshake_timeout=None, ssl_shutdown_timeout=None)

Upgrade an existing stream-based connection to TLS.
Expand Down
7 changes: 7 additions & 0 deletions Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ and reliable way to wait for all tasks in the group to finish.

Create a task in this task group.
The signature matches that of :func:`asyncio.create_task`.
If the task group is inactive (e.g. not yet entered,
already finished, or in the process of shutting down),
we will close the given ``coro``.

.. versionchanged:: 3.13

Close the given coroutine if the task group is not active.

Example::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/audit_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Audit events table

This table contains all events raised by :func:`sys.audit` or
:c:func:`PySys_Audit` calls throughout the CPython runtime and the
standard library. These calls were added in 3.8.0 or later (see :pep:`578`).
standard library. These calls were added in 3.8 or later (see :pep:`578`).

See :func:`sys.addaudithook` and :c:func:`PySys_AddAuditHook` for
information on handling these events.
Expand Down
1 change: 0 additions & 1 deletion Doc/library/bz2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ The :mod:`bz2` module contains:
Support was added for *filename* being a :term:`file object` instead of an
actual filename.

.. versionchanged:: 3.3
The ``'a'`` (append) mode was added, along with support for reading
multi-stream files.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``.
All of those tests treat missing elements as having zero counts so that
``Counter(a=1) == Counter(a=1, b=0)`` returns true.

.. versionadded:: 3.10
.. versionchanged:: 3.10
Rich comparison operations were added.

.. versionchanged:: 3.10
Expand Down
11 changes: 11 additions & 0 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,10 @@ ConfigParser Objects
The default *dict_type* is :class:`dict`, since it now preserves
insertion order.

.. versionchanged:: 3.13
Raise a :exc:`MultilineContinuationError` when *allow_no_value* is
``True``, and a key without a value is continued with an indented line.

.. method:: defaults()

Return a dictionary containing the instance-wide defaults.
Expand Down Expand Up @@ -1349,6 +1353,13 @@ Exceptions
The ``filename`` attribute and :meth:`!__init__` constructor argument were
removed. They have been available using the name ``source`` since 3.2.

.. exception:: MultilineContinuationError

Exception raised when a key without a corresponding value is continued with
an indented line.

.. versionadded:: 3.13

.. rubric:: Footnotes

.. [1] Config parsers allow for heavy customization. If you are interested in
Expand Down
10 changes: 8 additions & 2 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,9 @@ Supported operations:

Naive and aware :class:`!datetime` objects are never equal.

If both comparands are aware, and have the same :attr:`!tzinfo` attribute,
the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and
the base datetimes are compared.
If both comparands are aware and have different :attr:`~.datetime.tzinfo`
attributes, the comparison acts as comparands were first converted to UTC
datetimes except that the implementation never overflows.
Expand All @@ -1222,6 +1225,9 @@ Supported operations:
Order comparison between naive and aware :class:`.datetime` objects
raises :exc:`TypeError`.

If both comparands are aware, and have the same :attr:`!tzinfo` attribute,
the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and
the base datetimes are compared.
If both comparands are aware and have different :attr:`~.datetime.tzinfo`
attributes, the comparison acts as comparands were first converted to UTC
datetimes except that the implementation never overflows.
Expand Down Expand Up @@ -1778,8 +1784,8 @@ Naive and aware :class:`!time` objects are never equal.
Order comparison between naive and aware :class:`!time` objects raises
:exc:`TypeError`.

If both comparands are aware, and have
the same :attr:`~.time.tzinfo` attribute, the common :attr:`!tzinfo` attribute is
If both comparands are aware, and have the same :attr:`~.time.tzinfo`
attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are
ignored and the base times are compared. If both comparands are aware and
have different :attr:`!tzinfo` attributes, the comparands are first adjusted by
subtracting their UTC offsets (obtained from ``self.utcoffset()``).
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/decimal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ are also included in the pure Python version for compatibility.
the C version uses a thread-local rather than a coroutine-local context and the value
is ``False``. This is slightly faster in some nested context scenarios.

.. versionadded:: 3.9 backported to 3.7 and 3.8.
.. versionadded:: 3.8.3


Rounding modes
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Data Types
final *enum*, as well as creating the enum members, properly handling
duplicates, providing iteration over the enum class, etc.

.. method:: EnumType.__call__(cls, value, names=None, \*, module=None, qualname=None, type=None, start=1, boundary=None)
.. method:: EnumType.__call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

This method is called in two different ways:

Expand Down Expand Up @@ -350,7 +350,7 @@ Data Types
>>> PowersOfThree.SECOND.value
9

.. method:: Enum.__init__(self, \*args, \**kwds)
.. method:: Enum.__init__(self, *args, **kwds)

By default, does nothing. If multiple values are given in the member
assignment, those values become separate arguments to ``__init__``; e.g.
Expand All @@ -361,7 +361,7 @@ Data Types

``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, 'Mon')``

.. method:: Enum.__init_subclass__(cls, \**kwds)
.. method:: Enum.__init_subclass__(cls, **kwds)

A *classmethod* that is used to further configure subsequent subclasses.
By default, does nothing.
Expand All @@ -388,7 +388,7 @@ Data Types
>>> Build('deBUG')
<Build.DEBUG: 'debug'>

.. method:: Enum.__new__(cls, \*args, \**kwds)
.. method:: Enum.__new__(cls, *args, **kwds)

By default, doesn't exist. If specified, either in the enum class
definition or in a mixin class (such as ``int``), all values given
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/faulthandler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ Dumping the tracebacks after a timeout

This function is implemented using a watchdog thread.

.. versionchanged:: 3.7
This function is now always available.

.. versionchanged:: 3.5
Added support for passing file descriptor to this function.

.. versionchanged:: 3.7
This function is now always available.

.. function:: cancel_dump_traceback_later()

Cancel the last call to :func:`dump_traceback_later`.
Expand Down
9 changes: 7 additions & 2 deletions Doc/library/filecmp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,20 @@ The :mod:`filecmp` module defines the following functions:
The :class:`dircmp` class
-------------------------

.. class:: dircmp(a, b, ignore=None, hide=None)
.. class:: dircmp(a, b, ignore=None, hide=None, shallow=True)

Construct a new directory comparison object, to compare the directories *a*
and *b*. *ignore* is a list of names to ignore, and defaults to
:const:`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and
defaults to ``[os.curdir, os.pardir]``.

The :class:`dircmp` class compares files by doing *shallow* comparisons
as described for :func:`filecmp.cmp`.
as described for :func:`filecmp.cmp` by default using the *shallow*
parameter.

.. versionchanged:: 3.13

Added the *shallow* parameter.

The :class:`dircmp` class provides the following methods:

Expand Down
Loading

0 comments on commit 1ad872c

Please sign in to comment.