mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659) (GH-20661)
* Refresh importlib.metadata from importlib_metadata 1.6.1.
* 📜🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 161541ab45
)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
parent
cdc3d9cb22
commit
a4fa9a9515
6 changed files with 84 additions and 18 deletions
|
@ -77,7 +77,9 @@ Entry points
|
|||
The ``entry_points()`` function returns a dictionary of all entry points,
|
||||
keyed by group. Entry points are represented by ``EntryPoint`` instances;
|
||||
each ``EntryPoint`` has a ``.name``, ``.group``, and ``.value`` attributes and
|
||||
a ``.load()`` method to resolve the value.
|
||||
a ``.load()`` method to resolve the value. There are also ``.module``,
|
||||
``.attr``, and ``.extras`` attributes for getting the components of the
|
||||
``.value`` attribute::
|
||||
|
||||
>>> eps = entry_points() # doctest: +SKIP
|
||||
>>> list(eps) # doctest: +SKIP
|
||||
|
@ -86,6 +88,12 @@ a ``.load()`` method to resolve the value.
|
|||
>>> wheel = [ep for ep in scripts if ep.name == 'wheel'][0] # doctest: +SKIP
|
||||
>>> wheel # doctest: +SKIP
|
||||
EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')
|
||||
>>> wheel.module # doctest: +SKIP
|
||||
'wheel.cli'
|
||||
>>> wheel.attr # doctest: +SKIP
|
||||
'main'
|
||||
>>> wheel.extras # doctest: +SKIP
|
||||
[]
|
||||
>>> main = wheel.load() # doctest: +SKIP
|
||||
>>> main # doctest: +SKIP
|
||||
<function main at 0x103528488>
|
||||
|
@ -94,7 +102,7 @@ The ``group`` and ``name`` are arbitrary values defined by the package author
|
|||
and usually a client will wish to resolve all entry points for a particular
|
||||
group. Read `the setuptools docs
|
||||
<https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins>`_
|
||||
for more information on entrypoints, their definition, and usage.
|
||||
for more information on entry points, their definition, and usage.
|
||||
|
||||
|
||||
.. _metadata:
|
||||
|
@ -235,7 +243,7 @@ method::
|
|||
"""
|
||||
|
||||
The ``DistributionFinder.Context`` object provides ``.path`` and ``.name``
|
||||
properties indicating the path to search and names to match and may
|
||||
properties indicating the path to search and name to match and may
|
||||
supply other relevant context.
|
||||
|
||||
What this means in practice is that to support finding distribution package
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue