diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-06-05 20:34:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 20:34:16 (GMT) |
commit | 161541ab45278df6603dd870113b10f13e4d9e16 (patch) | |
tree | 53d4dd1133a5912092faf71918550202864f2475 /Doc/library/importlib.metadata.rst | |
parent | 5fe1df1886e2e53b04bf76ef916857271d3c8f20 (diff) | |
download | cpython-161541ab45278df6603dd870113b10f13e4d9e16.zip cpython-161541ab45278df6603dd870113b10f13e4d9e16.tar.gz cpython-161541ab45278df6603dd870113b10f13e4d9e16.tar.bz2 |
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)
* 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>
Diffstat (limited to 'Doc/library/importlib.metadata.rst')
-rw-r--r-- | Doc/library/importlib.metadata.rst | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 15e58b8..21da143 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -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 |