Skip to content

Commit

Permalink
Merge branch 'main' into avoid-install-overlaps
Browse files Browse the repository at this point in the history
  • Loading branch information
ned-deily authored Jul 29, 2024
2 parents c772271 + 9187484 commit e39646c
Show file tree
Hide file tree
Showing 107 changed files with 4,092 additions and 2,280 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Doc/c-api/stable.rst @encukou
**/*idlelib* @terryjreedy
/Doc/library/idle.rst @terryjreedy

**/*annotationlib* @JelleZijlstra
**/*typing* @JelleZijlstra @AlexWaygood

**/*ftplib @giampaolo
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,27 +249,38 @@ jobs:
arch: ${{ matrix.arch }}

build_macos:
name: 'macOS'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
# Cirrus used for upstream, macos-14 for forks.
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'

build_macos_free_threading:
name: 'macOS (free-threading)'
name: >-
macOS
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
fail-fast: false
matrix:
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
# macOS 13 only runs tests against the GIL-enabled CPython.
# Cirrus used for upstream, macos-14 for forks.
os:
- ghcr.io/cirruslabs/macos-runner:sonoma
- macos-14
- macos-13
is-fork: # only used for the exclusion trick
- ${{ github.repository_owner != 'python' }}
free-threading:
- false
- true
exclude:
- os: ghcr.io/cirruslabs/macos-runner:sonoma
is-fork: true
- os: macos-14
is-fork: false
- os: macos-13
free-threading: true
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
free-threading: true
# Cirrus and macos-14 are M1.
# Cirrus used for upstream, macos-14 for forks.
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}

build_ubuntu:
name: >-
Expand Down Expand Up @@ -337,7 +348,7 @@ jobs:
with:
save: false
- name: Configure CPython
run: ./configure --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
- name: Build CPython
run: make -j4
- name: Display build info
Expand Down Expand Up @@ -596,7 +607,6 @@ jobs:
- check-docs
- check_generated_files
- build_macos
- build_macos_free_threading
- build_ubuntu
- build_ubuntu_ssltests
- build_wasi
Expand Down Expand Up @@ -632,7 +642,6 @@ jobs:
&& '
check_generated_files,
build_macos,
build_macos_free_threading,
build_ubuntu,
build_ubuntu_ssltests,
build_wasi,
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ on:
required: false
type: boolean
default: false
os-matrix:
required: false
os:
description: OS to run the job
required: true
type: string

jobs:
build_macos:
name: build and test (${{ matrix.os }})
name: build and test (${{ inputs.os }})
timeout-minutes: 60
env:
HOMEBREW_NO_ANALYTICS: 1
Expand All @@ -23,18 +24,7 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
PYTHONSTRICTEXTENSIONBUILD: 1
TERM: linux
strategy:
fail-fast: false
matrix:
os: ${{fromJson(inputs.os-matrix)}}
is-fork:
- ${{ github.repository_owner != 'python' }}
exclude:
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
is-fork: true
- os: "macos-14"
is-fork: false
runs-on: ${{ matrix.os }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Runner image version
Expand All @@ -43,7 +33,7 @@ jobs:
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Install Homebrew dependencies
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
- name: Configure CPython
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,20 @@ jobs:
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: >-
../cpython-ro-srcdir/configure
CFLAGS="-fdiagnostics-format=json"
--config-cache
--with-pydebug
--enable-slower-safety
--with-openssl=$OPENSSL_DIR
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
- name: Build CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: make -j4
run: make -j4 &> compiler_output.txt
- name: Display build info
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: make pythoninfo
- name: Check compiler warnings
run: python Tools/build/check_warnings.py --compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output.txt --warning-ignore-file-path ${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu
- name: Remount sources writable for tests
# some tests write to srcdir, lack of pyc files slows down testing
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
Expand Down
9 changes: 2 additions & 7 deletions Doc/bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,16 @@ Documentation bugs
==================

If you find a bug in this documentation or would like to propose an improvement,
please submit a bug report on the :ref:`tracker <using-the-tracker>`. If you
please submit a bug report on the :ref:`issue tracker <using-the-tracker>`. If you
have a suggestion on how to fix it, include that as well.

You can also open a discussion item on our
`Documentation Discourse forum <https://discuss.python.org/c/documentation/26>`_.

If you find a bug in the theme (HTML / CSS / JavaScript) of the
documentation, please submit a bug report on the `python-doc-theme bug
documentation, please submit a bug report on the `python-doc-theme issue
tracker <https://github.com/python/python-docs-theme>`_.

If you're short on time, you can also email documentation bug reports to
docs@python.org (behavioral bugs can be sent to python-list@python.org).
'docs@' is a mailing list run by volunteers; your request will be noticed,
though it may take a while to be processed.

.. seealso::

`Documentation bugs`_
Expand Down
1 change: 1 addition & 0 deletions Doc/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
installing/index.rst
howto/index.rst
faq/index.rst
deprecations/index.rst
glossary.rst

about.rst
Expand Down
10 changes: 10 additions & 0 deletions Doc/deprecations/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Deprecations
============

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

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

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

.. include:: pending-removal-in-future.rst
7 changes: 6 additions & 1 deletion Doc/deprecations/pending-removal-in-3.16.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Pending Removal in Python 3.16
------------------------------

* :class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
* :mod:`array`:
:class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
use the ``'w'`` type instead (``Py_UCS4``).

* :mod:`symtable`:
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest.
(Contributed by Bénédikt Tran in :gh:`119698`.)
4 changes: 4 additions & 0 deletions Doc/deprecations/pending-removal-in-future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ although there is currently no date scheduled for their removal.
:class:`complex`: these methods will be required to return an instance of
:class:`complex`.
* Delegation of ``int()`` to ``__trunc__()`` method.
* Passing a complex number as the *real* or *imag* argument in the
:func:`complex` constructor is now deprecated; it should only be passed
as a single positional argument.
(Contributed by Serhiy Storchaka in :gh:`109218`.)

* :mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants are
deprecated and replaced by :data:`calendar.JANUARY` and
Expand Down
4 changes: 3 additions & 1 deletion Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ Literals
args=[
Name(id='a', ctx=Load())]),
conversion=-1,
format_spec=Constant(value='.3'))]))
format_spec=JoinedStr(
values=[
Constant(value='.3')]))]))


.. class:: List(elts, ctx)
Expand Down
9 changes: 0 additions & 9 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1109,15 +1109,6 @@ iterations of the loop.
empty dictionary pre-sized to hold *count* items.


.. opcode:: BUILD_CONST_KEY_MAP (count)

The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the
top element on the stack which contains a tuple of keys, then starting from
``STACK[-2]``, pops *count* values to form values in the built dictionary.

.. versionadded:: 3.6


.. opcode:: BUILD_STRING (count)

Concatenates *count* strings from the stack and pushes the resulting string
Expand Down
10 changes: 10 additions & 0 deletions Doc/library/mimetypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,13 @@ than one MIME-type database; it provides an interface similar to the one of the
types, else to the list of non-standard types.

.. versionadded:: 3.2


.. method:: MimeTypes.add_type(type, ext, strict=True)

Add a mapping from the MIME type *type* to the extension *ext*. When the
extension is already known, the new type will replace the old one. When the type
is already known the extension will be added to the list of known extensions.

When *strict* is ``True`` (the default), the mapping will be added to the
official MIME types, otherwise to the non-standard ones.
87 changes: 51 additions & 36 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1864,39 +1864,54 @@ Corresponding tools
Below is a table mapping various :mod:`os` functions to their corresponding
:class:`PurePath`/:class:`Path` equivalent.

==================================== ==============================
:mod:`os` and :mod:`os.path` :mod:`pathlib`
==================================== ==============================
:func:`os.path.abspath` :meth:`Path.absolute`
:func:`os.path.realpath` :meth:`Path.resolve`
:func:`os.chmod` :meth:`Path.chmod`
:func:`os.mkdir` :meth:`Path.mkdir`
:func:`os.makedirs` :meth:`Path.mkdir`
:func:`os.rename` :meth:`Path.rename`
:func:`os.replace` :meth:`Path.replace`
:func:`os.rmdir` :meth:`Path.rmdir`
:func:`os.remove`, :func:`os.unlink` :meth:`Path.unlink`
:func:`os.getcwd` :func:`Path.cwd`
:func:`os.path.exists` :meth:`Path.exists`
:func:`os.path.expanduser` :meth:`Path.expanduser` and
:meth:`Path.home`
:func:`os.listdir` :meth:`Path.iterdir`
:func:`os.walk` :meth:`Path.walk`
:func:`os.path.isdir` :meth:`Path.is_dir`
:func:`os.path.isfile` :meth:`Path.is_file`
:func:`os.path.islink` :meth:`Path.is_symlink`
:func:`os.link` :meth:`Path.hardlink_to`
:func:`os.symlink` :meth:`Path.symlink_to`
:func:`os.readlink` :meth:`Path.readlink`
:func:`os.path.relpath` :meth:`PurePath.relative_to`
:func:`os.stat` :meth:`Path.stat`,
:meth:`Path.owner`,
:meth:`Path.group`
:func:`os.path.isabs` :meth:`PurePath.is_absolute`
:func:`os.path.join` :func:`PurePath.joinpath`
:func:`os.path.basename` :attr:`PurePath.name`
:func:`os.path.dirname` :attr:`PurePath.parent`
:func:`os.path.samefile` :meth:`Path.samefile`
:func:`os.path.splitext` :attr:`PurePath.stem` and
:attr:`PurePath.suffix`
==================================== ==============================
===================================== ==============================================
:mod:`os` and :mod:`os.path` :mod:`pathlib`
===================================== ==============================================
:func:`os.path.dirname` :attr:`PurePath.parent`
:func:`os.path.basename` :attr:`PurePath.name`
:func:`os.path.splitext` :attr:`PurePath.stem`, :attr:`PurePath.suffix`
:func:`os.path.join` :meth:`PurePath.joinpath`
:func:`os.path.isabs` :meth:`PurePath.is_absolute`
:func:`os.path.relpath` :meth:`PurePath.relative_to` [1]_
:func:`os.path.expanduser` :meth:`Path.expanduser` [2]_
:func:`os.path.realpath` :meth:`Path.resolve`
:func:`os.path.abspath` :meth:`Path.absolute` [3]_
:func:`os.path.exists` :meth:`Path.exists`
:func:`os.path.isfile` :meth:`Path.is_file`
:func:`os.path.isdir` :meth:`Path.is_dir`
:func:`os.path.islink` :meth:`Path.is_symlink`
:func:`os.path.isjunction` :meth:`Path.is_junction`
:func:`os.path.ismount` :meth:`Path.is_mount`
:func:`os.path.samefile` :meth:`Path.samefile`
:func:`os.getcwd` :meth:`Path.cwd`
:func:`os.stat` :meth:`Path.stat`
:func:`os.lstat` :meth:`Path.lstat`
:func:`os.listdir` :meth:`Path.iterdir`
:func:`os.walk` :meth:`Path.walk` [4]_
:func:`os.mkdir`, :func:`os.makedirs` :meth:`Path.mkdir`
:func:`os.link` :meth:`Path.hardlink_to`
:func:`os.symlink` :meth:`Path.symlink_to`
:func:`os.readlink` :meth:`Path.readlink`
:func:`os.rename` :meth:`Path.rename`
:func:`os.replace` :meth:`Path.replace`
:func:`os.remove`, :func:`os.unlink` :meth:`Path.unlink`
:func:`os.rmdir` :meth:`Path.rmdir`
:func:`os.chmod` :meth:`Path.chmod`
:func:`os.lchmod` :meth:`Path.lchmod`
===================================== ==============================================

.. rubric:: Footnotes

.. [1] :func:`os.path.relpath` calls :func:`~os.path.abspath` to make paths
absolute and remove "``..``" parts, whereas :meth:`PurePath.relative_to`
is a lexical operation that raises :exc:`ValueError` when its inputs'
anchors differ (e.g. if one path is absolute and the other relative.)
.. [2] :func:`os.path.expanduser` returns the path unchanged if the home
directory can't be resolved, whereas :meth:`Path.expanduser` raises
:exc:`RuntimeError`.
.. [3] :func:`os.path.abspath` removes "``..``" components without resolving
symlinks, which may change the meaning of the path, whereas
:meth:`Path.absolute` leaves any "``..``" components in the path.
.. [4] :func:`os.walk` always follows symlinks when categorizing paths into
*dirnames* and *filenames*, whereas :meth:`Path.walk` categorizes all
symlinks into *filenames* when *follow_symlinks* is false (the default.)
12 changes: 8 additions & 4 deletions Doc/library/shutil.rst
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,9 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.

The keyword-only *filter* argument is passed to the underlying unpacking
function. For zip files, *filter* is not accepted.
For tar files, it is recommended to set it to ``'data'``,
unless using features specific to tar and UNIX-like filesystems.
For tar files, it is recommended to use ``'data'`` (default since Python
3.14), unless using features specific to tar and UNIX-like filesystems.
(See :ref:`tarfile-extraction-filter` for details.)
The ``'data'`` filter will become the default for tar files
in Python 3.14.

.. audit-event:: shutil.unpack_archive filename,extract_dir,format shutil.unpack_archive

Expand All @@ -721,6 +719,12 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
the *extract_dir* argument, e.g. members that have absolute filenames
starting with "/" or filenames with two dots "..".

Since Python 3.14, the defaults for both built-in formats (zip and tar
files) will prevent the most dangerous of such security issues,
but will not prevent *all* unintended behavior.
Read the :ref:`tarfile-further-verification`
section for tar-specific details.

.. versionchanged:: 3.7
Accepts a :term:`path-like object` for *filename* and *extract_dir*.

Expand Down
4 changes: 4 additions & 0 deletions Doc/library/sys.monitoring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ To allow tools to monitor for real exceptions without slowing down generators
and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided.
:monitoring-event:`STOP_ITERATION` can be locally disabled, unlike :monitoring-event:`RAISE`.

Note that the :monitoring-event:`STOP_ITERATION` event and the :monitoring-event:`RAISE`
event for a :exc:`StopIteration` exception are equivalent, and are treated as interchangeable
when generating events. Implementations will favor :monitoring-event:`STOP_ITERATION` for
performance reasons, but may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`.

Turning events on and off
-------------------------
Expand Down
Loading

0 comments on commit e39646c

Please sign in to comment.