Skip to content

Commit

Permalink
Merge branch 'main' into add-format-level-2
Browse files Browse the repository at this point in the history
  • Loading branch information
nohlson committed Sep 30, 2024
2 parents 13e9c80 + e44eebf commit b62d155
Show file tree
Hide file tree
Showing 328 changed files with 6,736 additions and 2,873 deletions.
24 changes: 0 additions & 24 deletions .devcontainer/Dockerfile

This file was deleted.

4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"image": "ghcr.io/python/devcontainer:2024.09.25.11038928730",
"onCreateCommand": [
// Install common tooling.
"dnf",
Expand Down
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ Doc/c-api/stable.rst @encukou
**/*bisect* @rhettinger
**/*heapq* @rhettinger
**/*functools* @rhettinger
**/*decimal* @rhettinger

**/*dataclasses* @ericvsmith

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/crash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ body:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "CPython main branch"
validations:
required: true
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,14 @@ jobs:

build_ubuntu_ssltests:
name: 'Ubuntu SSL tests with OpenSSL'
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
Expand Down Expand Up @@ -231,7 +232,7 @@ jobs:
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
Expand Down Expand Up @@ -410,7 +411,7 @@ jobs:
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,15 @@ jobs:
- name: Native Windows
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
run: |
choco upgrade llvm -y
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
# No PGO or tests (yet):
- name: Emulated Windows
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
run: |
choco upgrade llvm -y
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
- name: Native macOS
Expand Down Expand Up @@ -159,7 +157,7 @@ jobs:
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
CPP="$CC --preprocess" \
HOSTRUNNER=qemu-${{ matrix.architecture }} \
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} --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
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--with-lto' }} --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
make all --jobs 4
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ jobs:
build_ubuntu_reusable:
name: 'build and test'
timeout-minutes: 60
runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
env:
FORCE_COLOR: 1
OPENSSL_VER: 3.0.15
Expand All @@ -36,7 +40,7 @@ jobs:
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
Expand Down
6 changes: 3 additions & 3 deletions Doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ serve:
# for development releases: always build
.PHONY: autobuild-dev
autobuild-dev:
$(MAKE) dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
$(MAKE) dist-no-html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'

# for quick rebuilds (HTML only)
# for HTML-only rebuilds
.PHONY: autobuild-dev-html
autobuild-dev-html:
$(MAKE) html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
$(MAKE) dist-html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'

# for stable releases: only build if not in pre-release stage (alpha, beta)
# release candidate downloads are okay, since the stable tree can be in that stage
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ Exception Classes
This creates a class object derived from :exc:`Exception` (accessible in C as
:c:data:`PyExc_Exception`).
The :attr:`!__module__` attribute of the new class is set to the first part (up
The :attr:`~type.__module__` attribute of the new class is set to the first part (up
to the last dot) of the *name* argument, and the class name is set to the last
part (after the last dot). The *base* argument can be used to specify alternate
base classes; it can either be only one class or a tuple of classes. The *dict*
Expand Down
21 changes: 13 additions & 8 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1248,19 +1248,24 @@ PyConfig
.. c:member:: int perf_profiling
Enable compatibility mode with the perf profiler?
Enable the Linux ``perf`` profiler support?
If non-zero, initialize the perf trampoline. See :ref:`perf_profiling`
for more information.
If equals to ``1``, enable support for the Linux ``perf`` profiler.
Set by :option:`-X perf <-X>` command-line option and by the
:envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support
with stack pointers and :option:`-X perf_jit <-X>` command-line option
and by the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf
support with DWARF JIT information.
If equals to ``2``, enable support for the Linux ``perf`` profiler with
DWARF JIT support.
Set to ``1`` by :option:`-X perf <-X>` command-line option and the
:envvar:`PYTHONPERFSUPPORT` environment variable.
Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and
the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable.
Default: ``-1``.
.. seealso::
See :ref:`perf_profiling` for more information.
.. versionadded:: 3.12
.. c:member:: int use_environment
Expand Down
13 changes: 11 additions & 2 deletions Doc/c-api/long.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
.. versionadded:: 3.13
.. XXX alias PyLong_AS_LONG (for now)
.. c:function:: long PyLong_AsLong(PyObject *obj)
.. index::
Expand All @@ -181,6 +180,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
.. versionchanged:: 3.10
This function will no longer use :meth:`~object.__int__`.
.. c:namespace:: NULL
.. c:function:: long PyLong_AS_LONG(PyObject *obj)
A :term:`soft deprecated` alias.
Exactly equivalent to the preferred ``PyLong_AsLong``. In particular,
it can fail with :exc:`OverflowError` or another exception.
.. deprecated:: 3.14
The function is soft deprecated.
.. c:function:: int PyLong_AsInt(PyObject *obj)
Expand Down Expand Up @@ -570,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:: 3.14
.. versionadded:: next
.. c:function:: PyObject* PyLong_GetInfo(void)
Expand Down
12 changes: 6 additions & 6 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,14 @@ Object Protocol
The result will be ``1`` when at least one of the checks returns ``1``,
otherwise it will be ``0``.
If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to
If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to
determine the subclass status as described in :pep:`3119`. Otherwise,
*derived* is a subclass of *cls* if it is a direct or indirect subclass,
i.e. contained in ``cls.__mro__``.
i.e. contained in :attr:`cls.__mro__ <type.__mro__>`.
Normally only class objects, i.e. instances of :class:`type` or a derived
class, are considered classes. However, objects can override this by having
a :attr:`~class.__bases__` attribute (which must be a tuple of base classes).
a :attr:`~type.__bases__` attribute (which must be a tuple of base classes).
.. c:function:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
Expand All @@ -386,15 +386,15 @@ Object Protocol
The result will be ``1`` when at least one of the checks returns ``1``,
otherwise it will be ``0``.
If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to
If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to
determine the subclass status as described in :pep:`3119`. Otherwise, *inst*
is an instance of *cls* if its class is a subclass of *cls*.
An instance *inst* can override what is considered its class by having a
:attr:`~instance.__class__` attribute.
:attr:`~object.__class__` attribute.
An object *cls* can override if it is considered a class, and what its base
classes are, by having a :attr:`~class.__bases__` attribute (which must be a tuple
classes are, by having a :attr:`~type.__bases__` attribute (which must be a tuple
of base classes).
Expand Down
18 changes: 10 additions & 8 deletions Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ Type Objects
.. c:function:: PyObject* PyType_GetDict(PyTypeObject* type)
Return the type object's internal namespace, which is otherwise only
exposed via a read-only proxy (``cls.__dict__``). This is a
exposed via a read-only proxy (:attr:`cls.__dict__ <type.__dict__>`).
This is a
replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly.
The returned dictionary must be treated as read-only.
Expand Down Expand Up @@ -140,7 +141,7 @@ Type Objects
Return true if *a* is a subtype of *b*.
This function only checks for actual subtypes, which means that
:meth:`~class.__subclasscheck__` is not called on *b*. Call
:meth:`~type.__subclasscheck__` is not called on *b*. Call
:c:func:`PyObject_IsSubclass` to do the same check that :func:`issubclass`
would do.
Expand Down Expand Up @@ -174,29 +175,30 @@ Type Objects
.. c:function:: PyObject* PyType_GetName(PyTypeObject *type)
Return the type's name. Equivalent to getting the type's ``__name__`` attribute.
Return the type's name. Equivalent to getting the type's
:attr:`~type.__name__` attribute.
.. versionadded:: 3.11
.. c:function:: PyObject* PyType_GetQualName(PyTypeObject *type)
Return the type's qualified name. Equivalent to getting the
type's ``__qualname__`` attribute.
type's :attr:`~type.__qualname__` attribute.
.. versionadded:: 3.11
.. c:function:: PyObject* PyType_GetFullyQualifiedName(PyTypeObject *type)
Return the type's fully qualified name. Equivalent to
``f"{type.__module__}.{type.__qualname__}"``, or ``type.__qualname__`` if
``type.__module__`` is not a string or is equal to ``"builtins"``.
``f"{type.__module__}.{type.__qualname__}"``, or :attr:`type.__qualname__`
if :attr:`type.__module__` is not a string or is equal to ``"builtins"``.
.. versionadded:: 3.13
.. c:function:: PyObject* PyType_GetModuleName(PyTypeObject *type)
Return the type's module name. Equivalent to getting the ``type.__module__``
attribute.
Return the type's module name. Equivalent to getting the
:attr:`type.__module__` attribute.
.. versionadded:: 3.13
Expand Down
14 changes: 7 additions & 7 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -567,12 +567,12 @@ and :c:data:`PyType_Type` effectively act as defaults.)

For :ref:`statically allocated type objects <static-types>`,
the *tp_name* field should contain a dot.
Everything before the last dot is made accessible as the :attr:`__module__`
Everything before the last dot is made accessible as the :attr:`~type.__module__`
attribute, and everything after the last dot is made accessible as the
:attr:`~definition.__name__` attribute.
:attr:`~type.__name__` attribute.

If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is made accessible as the
:attr:`~definition.__name__` attribute, and the :attr:`__module__` attribute is undefined
:attr:`~type.__name__` attribute, and the :attr:`~type.__module__` attribute is undefined
(unless explicitly set in the dictionary, as explained above). This means your
type will be impossible to pickle. Additionally, it will not be listed in
module documentations created with pydoc.
Expand Down Expand Up @@ -1131,7 +1131,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)

.. c:macro:: Py_TPFLAGS_MANAGED_DICT
This bit indicates that instances of the class have a ``__dict__``
This bit indicates that instances of the class have a `~object.__dict__`
attribute, and that the space for the dictionary is managed by the VM.

If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set.
Expand Down Expand Up @@ -1335,8 +1335,8 @@ and :c:data:`PyType_Type` effectively act as defaults.)
.. c:member:: const char* PyTypeObject.tp_doc
An optional pointer to a NUL-terminated C string giving the docstring for this
type object. This is exposed as the :attr:`__doc__` attribute on the type and
instances of the type.
type object. This is exposed as the :attr:`~type.__doc__` attribute on the
type and instances of the type.

**Inheritance:**

Expand Down Expand Up @@ -2036,7 +2036,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
A collection of subclasses. Internal use only. May be an invalid pointer.

To get a list of subclasses, call the Python method
:py:meth:`~class.__subclasses__`.
:py:meth:`~type.__subclasses__`.

.. versionchanged:: 3.12

Expand Down
Loading

0 comments on commit b62d155

Please sign in to comment.