From c25798292ffb10a0b2bdc61cf584962f26d6e8d7 Mon Sep 17 00:00:00 2001 From: Sam Morris Date: Fri, 24 Feb 2023 15:10:13 +0000 Subject: [PATCH 1/5] gh-102215: Fix headling level in importlib.resources --- Doc/library/importlib.resources.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/importlib.resources.rst b/Doc/library/importlib.resources.rst index 4c6aa59bf9f58f..c9009b573e58e9 100644 --- a/Doc/library/importlib.resources.rst +++ b/Doc/library/importlib.resources.rst @@ -97,7 +97,7 @@ for example, a package and its resources can be imported from a zip file using Deprecated functions --------------------- +^^^^^^^^^^^^^^^^^^^^ An older, deprecated set of functions is still available, but is scheduled for removal in a future version of Python. From 1636c323f6f9e7b532b255144120030bd44d5dc7 Mon Sep 17 00:00:00 2001 From: Sam Morris Date: Fri, 24 Feb 2023 15:34:40 +0000 Subject: [PATCH 2/5] importlib.resources: bring section heading format in-line with that of other modules Synopsis is also updated to match. --- Doc/library/importlib.metadata.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 988d1a317f5960..5f89bded9a6b7d 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -1,11 +1,11 @@ .. _using: -================================= - Using :mod:`!importlib.metadata` -================================= +======================================================== +:mod:`!importlib.metadata` -- Accessing package metadata +======================================================== .. module:: importlib.metadata - :synopsis: The implementation of the importlib metadata. + :synopsis: Accessing package metadata .. versionadded:: 3.8 .. versionchanged:: 3.10 From b5cbe0fd441b943c92b4e73a48fafd3ed744f4fe Mon Sep 17 00:00:00 2001 From: Sam Morris Date: Fri, 24 Feb 2023 15:36:07 +0000 Subject: [PATCH 3/5] importlib.metadata: refer to the module by its importable name Previously the module was referenced by the name of the package that backports it to older python versions. --- Doc/library/importlib.metadata.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index 5f89bded9a6b7d..dee52bf1ef6dd9 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -13,7 +13,7 @@ **Source code:** :source:`Lib/importlib/metadata/__init__.py` -``importlib_metadata`` is a library that provides access to +``importlib.metadata`` is a library that provides access to the metadata of an installed `Distribution Package `_, such as its entry points or its top-level names (`Import Package `_\s, modules, if any). @@ -24,7 +24,7 @@ API`_ and `metadata API`_ of ``pkg_resources``. Along with this package can eliminate the need to use the older and less efficient ``pkg_resources`` package. -``importlib_metadata`` operates on third-party *distribution packages* +``importlib.metadata`` operates on third-party *distribution packages* installed into Python's ``site-packages`` directory via tools such as `pip `_. Specifically, it works with distributions with discoverable @@ -173,10 +173,10 @@ for more information on entry points, their definition, and usage. *Compatibility Note* -The "selectable" entry points were introduced in ``importlib_metadata`` +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, +by group. With ``importlib.metadata`` 5.0 and Python 3.12, ``entry_points`` always returns an ``EntryPoints`` object. See `backports.entry_points_selectable `_ for compatibility options. @@ -364,7 +364,7 @@ system :ref:`finders `. To find a distribution package's m ``importlib.metadata`` queries the list of :term:`meta path finders ` on :data:`sys.meta_path`. -By default ``importlib_metadata`` installs a finder for distribution packages +By default ``importlib.metadata`` installs a finder for distribution packages found on the file system. This finder doesn't actually find any *distributions*, but it can find their metadata. From 2bebc2d061ec2154fc4124d88b5d7847e09c87f4 Mon Sep 17 00:00:00 2001 From: Sam Morris Date: Fri, 24 Feb 2023 15:38:27 +0000 Subject: [PATCH 4/5] importlib.resources: use synopsis in module heading The synopsis provides a much better and quite succinct explanation of the purpose of the module. --- Doc/library/importlib.resources.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/importlib.resources.rst b/Doc/library/importlib.resources.rst index c9009b573e58e9..755693840fecd8 100644 --- a/Doc/library/importlib.resources.rst +++ b/Doc/library/importlib.resources.rst @@ -1,5 +1,5 @@ -:mod:`importlib.resources` -- Resources ---------------------------------------- +:mod:`importlib.resources` -- Package resource reading, opening and access +-------------------------------------------------------------------------- .. module:: importlib.resources :synopsis: Package resource reading, opening, and access From 8595efc537b447b12cd1f85c0905397f61e8dd15 Mon Sep 17 00:00:00 2001 From: Sam Morris Date: Fri, 5 May 2023 08:59:37 +0100 Subject: [PATCH 5/5] Refer to the external package as importlib_metadata --- Doc/library/importlib.metadata.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index dee52bf1ef6dd9..7b17f7bd4f8b67 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -173,10 +173,10 @@ for more information on entry points, their definition, and usage. *Compatibility Note* -The "selectable" entry points were introduced in ``importlib.metadata`` +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, +by group. With ``importlib_metadata`` 5.0 and Python 3.12, ``entry_points`` always returns an ``EntryPoints`` object. See `backports.entry_points_selectable `_ for compatibility options.