diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2019-12-11 01:05:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 01:05:10 (GMT) |
commit | b7a0109cd2bafaa21a4d50aad307e901c68f9156 (patch) | |
tree | 744785e406bf815353d7c29c69c8bfe59e24f2c0 /Doc | |
parent | d0802d07d2c864b95480a9b24c7cc050e19189d5 (diff) | |
download | cpython-b7a0109cd2bafaa21a4d50aad307e901c68f9156.zip cpython-b7a0109cd2bafaa21a4d50aad307e901c68f9156.tar.gz cpython-b7a0109cd2bafaa21a4d50aad307e901c68f9156.tar.bz2 |
bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 (GH-17568)
* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 including improved docs for custom finders and better serialization support in EntryPoints.
* 📜🤖 Added by blurb_it.
* Correct module reference
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/importlib.metadata.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 4a4a8f7..dc6b66c 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -216,9 +216,9 @@ system `finders`_. To find a distribution package's metadata, ``importlib.metadata`` queries the list of `meta path finders`_ on `sys.meta_path`_. -By default ``importlib.metadata`` installs a finder for distribution packages -found on the file system. This finder doesn't actually find any *packages*, -but it can find the packages' metadata. +The default ``PathFinder`` for Python includes a hook that calls into +``importlib.metadata.MetadataPathFinder`` for finding distributions +loaded from typical file-system-based paths. The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the interface expected of finders by Python's import system. @@ -239,9 +239,9 @@ properties indicating the path to search and names to match and may supply other relevant context. What this means in practice is that to support finding distribution package -metadata in locations other than the file system, you should derive from -``Distribution`` and implement the ``load_metadata()`` method. Then from -your finder, return instances of this derived ``Distribution`` in the +metadata in locations other than the file system, subclass +``Distribution`` and implement the abstract methods. Then from +a custom finder, return instances of this derived ``Distribution`` in the ``find_distributions()`` method. |