| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 386479b commit e8d8f9d
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,9 +14,9 @@ | |||
| 14 | 14 | **Source code:** :source:`Lib/importlib/metadata/__init__.py` | |
| 15 | 15 | ||
| 16 | 16 | ``importlib_metadata`` is a library that provides access to | |
| 17 | - the metadata of an installed :term:`packaging:Distribution Package`, | ||
| 17 | + the metadata of an installed `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_, | ||
| 18 | 18 | such as its entry points | |
| 19 | - or its top-level names (:term:`packaging:Import Package`\s, modules, if any). | ||
| 19 | + or its top-level names (`Import Package <https://packaging.python.org/en/latest/glossary/#term-Import-Package>`_\s, modules, if any). | ||
| 20 | 20 | Built in part on Python's import system, this library | |
| 21 | 21 | intends to replace similar functionality in the `entry point | |
| 22 | 22 | API`_ and `metadata API`_ of ``pkg_resources``. Along with | |
@@ -29,7 +29,7 @@ installed into Python's ``site-packages`` directory via tools such as | |||
| 29 | 29 | `pip <https://pypi.org/project/pip/>`_. | |
| 30 | 30 | Specifically, it works with distributions with discoverable | |
| 31 | 31 | ``dist-info`` or ``egg-info`` directories, | |
| 32 | - and metadata defined by the :ref:`packaging:core-metadata`. | ||
| 32 | + and metadata defined by the `Core metadata specifications <https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata>`_. | ||
| 33 | 33 | ||
| 34 | 34 | .. important:: | |
| 35 | 35 | ||
@@ -67,7 +67,7 @@ Overview | |||
| 67 | 67 | ======== | |
| 68 | 68 | ||
| 69 | 69 | Let's say you wanted to get the version string for a | |
| 70 | - :term:`packaging:Distribution Package` you've installed | ||
| 70 | + `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_ you've installed | ||
| 71 | 71 | using ``pip``. We start by creating a virtual environment and installing | |
| 72 | 72 | something into it: | |
| 73 | 73 | ||
@@ -188,7 +188,7 @@ interface to retrieve entry points by group. | |||
| 188 | 188 | Distribution metadata | |
| 189 | 189 | --------------------- | |
| 190 | 190 | ||
| 191 | - Every :term:`packaging:Distribution Package` includes some metadata, | ||
| 191 | + Every `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_ includes some metadata, | ||
| 192 | 192 | which you can extract using the | |
| 193 | 193 | ``metadata()`` function:: | |
| 194 | 194 | ||
@@ -228,7 +228,7 @@ Distribution versions | |||
| 228 | 228 | --------------------- | |
| 229 | 229 | ||
| 230 | 230 | The ``version()`` function is the quickest way to get a | |
| 231 | - :term:`packaging:Distribution Package`'s version | ||
| 231 | + `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_'s version | ||
| 232 | 232 | number, as a string:: | |
| 233 | 233 | ||
| 234 | 234 | >>> version('wheel') # doctest: +SKIP | |
@@ -241,7 +241,7 @@ Distribution files | |||
| 241 | 241 | ------------------ | |
| 242 | 242 | ||
| 243 | 243 | You can also get the full set of files contained within a distribution. The | |
| 244 | - ``files()`` function takes a :term:`packaging:Distribution Package` name | ||
| 244 | + ``files()`` function takes a `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_ name | ||
| 245 | 245 | and returns all of the | |
| 246 | 246 | files installed by this distribution. Each file object returned is a | |
| 247 | 247 | ``PackagePath``, a :class:`pathlib.PurePath` derived object with additional ``dist``, | |
@@ -287,7 +287,7 @@ distribution is not known to have the metadata present. | |||
| 287 | 287 | Distribution requirements | |
| 288 | 288 | ------------------------- | |
| 289 | 289 | ||
| 290 | - To get the full set of requirements for a :term:`packaging:Distribution Package`, | ||
| 290 | + To get the full set of requirements for a `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_, | ||
| 291 | 291 | use the ``requires()`` | |
| 292 | 292 | function:: | |
| 293 | 293 | ||
@@ -301,10 +301,10 @@ function:: | |||
| 301 | 301 | Mapping import to distribution packages | |
| 302 | 302 | --------------------------------------- | |
| 303 | 303 | ||
| 304 | - A convenience method to resolve the :term:`packaging:Distribution Package` | ||
| 304 | + A convenience method to resolve the `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_ | ||
| 305 | 305 | name (or names, in the case of a namespace package) | |
| 306 | 306 | that provide each importable top-level | |
| 307 | - Python module or :term:`packaging:Import Package`:: | ||
| 307 | + Python module or `Import Package <https://packaging.python.org/en/latest/glossary/#term-Import-Package>`_:: | ||
| 308 | 308 | ||
| 309 | 309 | >>> packages_distributions() | |
| 310 | 310 | {'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': ['jaraco.classes', 'jaraco.functools'], ...} | |
@@ -319,7 +319,7 @@ Distributions | |||
| 319 | 319 | While the above API is the most common and convenient usage, you can get all | |
| 320 | 320 | of that information from the ``Distribution`` class. A ``Distribution`` is an | |
| 321 | 321 | abstract object that represents the metadata for | |
| 322 | - a Python :term:`packaging:Distribution Package`. You can | ||
| 322 | + a Python `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_. You can | ||
| 323 | 323 | get the ``Distribution`` instance:: | |
| 324 | 324 | ||
| 325 | 325 | >>> from importlib.metadata import distribution # doctest: +SKIP | |
@@ -340,14 +340,14 @@ instance:: | |||
| 340 | 340 | 'MIT' | |
| 341 | 341 | ||
| 342 | 342 | The full set of available metadata is not described here. | |
| 343 | - See the :ref:`packaging:core-metadata` for additional details. | ||
| 343 | + See the `Core metadata specifications <https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata>`_ for additional details. | ||
| 344 | 344 | ||
| 345 | 345 | ||
| 346 | 346 | Distribution Discovery | |
| 347 | 347 | ====================== | |
| 348 | 348 | ||
| 349 | 349 | By default, this package provides built-in support for discovery of metadata | |
| 350 | - for file system and zip file :term:`packaging:Distribution Package`\s. | ||
| 350 | + for file system and zip file `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_\s. | ||
| 351 | 351 | This metadata finder search defaults to ``sys.path``, but varies slightly in how it interprets those values from how other import machinery does. In particular: | |
| 352 | 352 | ||
| 353 | 353 | - ``importlib.metadata`` does not honor :class:`bytes` objects on ``sys.path``. | |
@@ -357,7 +357,7 @@ This metadata finder search defaults to ``sys.path``, but varies slightly in how | |||
| 357 | 357 | Extending the search algorithm | |
| 358 | 358 | ============================== | |
| 359 | 359 | ||
| 360 | - Because :term:`packaging:Distribution Package` metadata | ||
| 360 | + Because `Distribution Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_ metadata | ||
| 361 | 361 | is not available through :data:`sys.path` searches, or | |
| 362 | 362 | package loaders directly, | |
| 363 | 363 | the metadata for a distribution is found through import | |
| Back | FazBrowse Home | New Git URL |
0 commit comments