Skip to content

Commit

Permalink
gh-113174: Sync with importlib_metadata 7.0 (#113175)
Browse files Browse the repository at this point in the history
* Sync with importlib_metadata 7.0.0

* Add blurb

* Update docs to reflect changes.

* Link datamodel docs for object.__getitem__

Co-authored-by: Alex Waygood <[email protected]>

* Add what's new for removed __getattr__

* Link datamodel docs for object.__getitem__

Co-authored-by: Alex Waygood <[email protected]>

* Add exclamation point, as that seems to be used for other classes.

---------

Co-authored-by: Alex Waygood <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jan 12, 2024
1 parent 3259953 commit a6922b9
Show file tree
Hide file tree
Showing 10 changed files with 265 additions and 144 deletions.
30 changes: 20 additions & 10 deletions Doc/library/importlib.metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,18 @@ group. Read `the setuptools docs
<https://setuptools.pypa.io/en/latest/userguide/entry_point.html>`_
for more information on entry points, their definition, and usage.

*Compatibility Note*

The "selectable" entry points were introduced in ``importlib_metadata``
3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted
no parameters and always returned a dictionary of entry points, keyed
by group. With ``importlib_metadata`` 5.0 and Python 3.12,
``entry_points`` always returns an ``EntryPoints`` object. See
`backports.entry_points_selectable <https://pypi.org/project/backports.entry-points-selectable>`_
for compatibility options.

.. versionchanged:: 3.12
The "selectable" entry points were introduced in ``importlib_metadata``
3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted
no parameters and always returned a dictionary of entry points, keyed
by group. With ``importlib_metadata`` 5.0 and Python 3.12,
``entry_points`` always returns an ``EntryPoints`` object. See
`backports.entry_points_selectable <https://pypi.org/project/backports.entry-points-selectable>`_
for compatibility options.

.. versionchanged:: 3.13
``EntryPoint`` objects no longer present a tuple-like interface
(:meth:`~object.__getitem__`).

.. _metadata:

Expand Down Expand Up @@ -342,9 +344,17 @@ instance::
>>> dist.metadata['License'] # doctest: +SKIP
'MIT'

For editable packages, an origin property may present :pep:`610`
metadata::

>>> dist.origin.url
'file:///path/to/wheel-0.32.3.editable-py3-none-any.whl'

The full set of available metadata is not described here.
See the `Core metadata specifications <https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata>`_ for additional details.

.. versionadded:: 3.13
The ``.origin`` property was added.

Distribution Discovery
======================
Expand Down
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,10 @@ importlib
for migration advice.
(Contributed by Jason R. Coombs in :gh:`106532`.)

* Remove deprecated :meth:`~object.__getitem__` access for
:class:`!importlib.metadata.EntryPoint` objects.
(Contributed by Jason R. Coombs in :gh:`113175`.)

locale
------

Expand Down
Loading

0 comments on commit a6922b9

Please sign in to comment.