forked from AFPy/python-docs-fr
Julien Palard
26c991fc20
J'ai juste exécuté `python merge.py 3.11`. Reviewed-on: AFPy/python-docs-fr#21 Co-authored-by: Julien Palard <julien@palard.fr> Co-committed-by: Julien Palard <julien@palard.fr>
425 lines
15 KiB
Plaintext
425 lines
15 KiB
Plaintext
# Copyright (C) 2001-2018, Python Software Foundation
|
|
# For licence information, see README file.
|
|
#
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Python 3\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
|
|
"PO-Revision-Date: 2019-09-04 11:42+0200\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
|
"Language: fr\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: library/importlib.metadata.rst:5
|
|
msgid "Using :mod:`!importlib.metadata`"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:11
|
|
msgid "``importlib.metadata`` is no longer provisional."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:14
|
|
msgid "**Source code:** :source:`Lib/importlib/metadata/__init__.py`"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:16
|
|
msgid ""
|
|
"``importlib_metadata`` is a library that provides access to the metadata of "
|
|
"an installed `Distribution Package <https://packaging.python.org/en/latest/"
|
|
"glossary/#term-Distribution-Package>`_, such as its entry points or its top-"
|
|
"level names (`Import Package <https://packaging.python.org/en/latest/"
|
|
"glossary/#term-Import-Package>`_\\s, modules, if any). Built in part on "
|
|
"Python's import system, this library intends to replace similar "
|
|
"functionality in the `entry point API`_ and `metadata API`_ of "
|
|
"``pkg_resources``. Along with :mod:`importlib.resources`, this package can "
|
|
"eliminate the need to use the older and less efficient ``pkg_resources`` "
|
|
"package."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:27
|
|
msgid ""
|
|
"``importlib_metadata`` operates on third-party *distribution packages* "
|
|
"installed into Python's ``site-packages`` directory via tools such as `pip "
|
|
"<https://pypi.org/project/pip/>`_. Specifically, it works with distributions "
|
|
"with discoverable ``dist-info`` or ``egg-info`` directories, and metadata "
|
|
"defined by the `Core metadata specifications <https://packaging.python.org/"
|
|
"en/latest/specifications/core-metadata/#core-metadata>`_."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:36
|
|
msgid ""
|
|
"These are *not* necessarily equivalent to or correspond 1:1 with the top-"
|
|
"level *import package* names that can be imported inside Python code. One "
|
|
"*distribution package* can contain multiple *import packages* (and single "
|
|
"modules), and one top-level *import package* may map to multiple "
|
|
"*distribution packages* if it is a namespace package. You can use :ref:"
|
|
"`package_distributions() <package-distributions>` to get a mapping between "
|
|
"them."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:47
|
|
msgid ""
|
|
"By default, distribution metadata can live on the file system or in zip "
|
|
"archives on :data:`sys.path`. Through an extension mechanism, the metadata "
|
|
"can live almost anywhere."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:62
|
|
msgid "https://importlib-metadata.readthedocs.io/"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:56
|
|
msgid ""
|
|
"The documentation for ``importlib_metadata``, which supplies a backport of "
|
|
"``importlib.metadata``. This includes an `API reference <https://importlib-"
|
|
"metadata.readthedocs.io/en/latest/api.html>`__ for this module's classes and "
|
|
"functions, as well as a `migration guide <https://importlib-metadata."
|
|
"readthedocs.io/en/latest/migration.html>`__ for existing users of "
|
|
"``pkg_resources``."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:67
|
|
msgid "Overview"
|
|
msgstr "Aperçu"
|
|
|
|
#: library/importlib.metadata.rst:69
|
|
msgid ""
|
|
"Let's say you wanted to get the version string for a `Distribution Package "
|
|
"<https://packaging.python.org/en/latest/glossary/#term-Distribution-"
|
|
"Package>`_ you've installed using ``pip``. We start by creating a virtual "
|
|
"environment and installing something into it:"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:80
|
|
msgid "You can get the version string for ``wheel`` by running the following:"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:89
|
|
msgid ""
|
|
"You can also get a collection of entry points selectable by properties of "
|
|
"the EntryPoint (typically 'group' or 'name'), such as ``console_scripts``, "
|
|
"``distutils.commands`` and others. Each group contains a collection of :ref:"
|
|
"`EntryPoint <entry-points>` objects."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:93
|
|
msgid "You can get the :ref:`metadata for a distribution <metadata>`::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:98
|
|
msgid ""
|
|
"You can also get a :ref:`distribution's version number <version>`, list its :"
|
|
"ref:`constituent files <files>`, and get a list of the distribution's :ref:"
|
|
"`requirements`."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:104
|
|
msgid "Functional API"
|
|
msgstr "API par fonction"
|
|
|
|
#: library/importlib.metadata.rst:106
|
|
msgid "This package provides the following functionality via its public API."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:112
|
|
msgid "Entry points"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:114
|
|
msgid ""
|
|
"The ``entry_points()`` function returns a collection of entry points. Entry "
|
|
"points are represented by ``EntryPoint`` instances; each ``EntryPoint`` has "
|
|
"a ``.name``, ``.group``, and ``.value`` attributes and a ``.load()`` method "
|
|
"to resolve the value. There are also ``.module``, ``.attr``, and ``."
|
|
"extras`` attributes for getting the components of the ``.value`` attribute."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:121
|
|
msgid "Query all entry points::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:125
|
|
msgid ""
|
|
"The ``entry_points()`` function returns an ``EntryPoints`` object, a "
|
|
"collection of all ``EntryPoint`` objects with ``names`` and ``groups`` "
|
|
"attributes for convenience::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:132
|
|
msgid ""
|
|
"``EntryPoints`` has a ``select`` method to select entry points matching "
|
|
"specific properties. Select entry points in the ``console_scripts`` group::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:138
|
|
msgid ""
|
|
"Equivalently, since ``entry_points`` passes keyword arguments through to "
|
|
"select::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:143
|
|
msgid ""
|
|
"Pick out a specific script named \"wheel\" (found in the wheel project)::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:149
|
|
msgid "Equivalently, query for that entry point during selection::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:154
|
|
msgid "Inspect the resolved entry point::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:168
|
|
msgid ""
|
|
"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.pypa.io/en/"
|
|
"latest/userguide/entry_point.html>`_ for more information on entry points, "
|
|
"their definition, and usage."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:174
|
|
msgid "*Compatibility Note*"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:176
|
|
msgid ""
|
|
"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. "
|
|
"For compatibility, if no parameters are passed to entry_points, a "
|
|
"``SelectableGroups`` object is returned, implementing that dict interface. "
|
|
"In the future, calling ``entry_points`` with no parameters will return an "
|
|
"``EntryPoints`` object. Users should rely on the selection interface to "
|
|
"retrieve entry points by group."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:189
|
|
msgid "Distribution metadata"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:191
|
|
msgid ""
|
|
"Every `Distribution Package <https://packaging.python.org/en/latest/glossary/"
|
|
"#term-Distribution-Package>`_ includes some metadata, which you can extract "
|
|
"using the ``metadata()`` function::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:197
|
|
msgid ""
|
|
"The keys of the returned data structure, a ``PackageMetadata``, name the "
|
|
"metadata keywords, and the values are returned unparsed from the "
|
|
"distribution metadata::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:204
|
|
msgid ""
|
|
"``PackageMetadata`` also presents a ``json`` attribute that returns all the "
|
|
"metadata in a JSON-compatible form per :PEP:`566`::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:212
|
|
msgid ""
|
|
"The actual type of the object returned by ``metadata()`` is an "
|
|
"implementation detail and should be accessed only through the interface "
|
|
"described by the `PackageMetadata protocol <https://importlib-metadata."
|
|
"readthedocs.io/en/latest/api.html#importlib_metadata.PackageMetadata>`_."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:217
|
|
msgid ""
|
|
"The ``Description`` is now included in the metadata when presented through "
|
|
"the payload. Line continuation characters have been removed."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:221
|
|
msgid "The ``json`` attribute was added."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:228
|
|
msgid "Distribution versions"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:230
|
|
msgid ""
|
|
"The ``version()`` function is the quickest way to get a `Distribution "
|
|
"Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-"
|
|
"Package>`_'s version number, as a string::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:241
|
|
msgid "Distribution files"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:243
|
|
msgid ""
|
|
"You can also get the full set of files contained within a distribution. The "
|
|
"``files()`` function takes a `Distribution Package <https://packaging.python."
|
|
"org/en/latest/glossary/#term-Distribution-Package>`_ name and returns all of "
|
|
"the files installed by this distribution. Each file object returned is a "
|
|
"``PackagePath``, a :class:`pathlib.PurePath` derived object with additional "
|
|
"``dist``, ``size``, and ``hash`` properties as indicated by the metadata. "
|
|
"For example::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:260
|
|
msgid "Once you have the file, you can also read its contents::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:271
|
|
msgid ""
|
|
"You can also use the ``locate`` method to get a the absolute path to the "
|
|
"file::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:277
|
|
msgid ""
|
|
"In the case where the metadata file listing files (RECORD or SOURCES.txt) is "
|
|
"missing, ``files()`` will return ``None``. The caller may wish to wrap calls "
|
|
"to ``files()`` in `always_iterable <https://more-itertools.readthedocs.io/en/"
|
|
"stable/api.html#more_itertools.always_iterable>`_ or otherwise guard against "
|
|
"this condition if the target distribution is not known to have the metadata "
|
|
"present."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:288
|
|
msgid "Distribution requirements"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:290
|
|
msgid ""
|
|
"To get the full set of requirements for a `Distribution Package <https://"
|
|
"packaging.python.org/en/latest/glossary/#term-Distribution-Package>`_, use "
|
|
"the ``requires()`` function::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:302
|
|
msgid "Mapping import to distribution packages"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:304
|
|
msgid ""
|
|
"A convenience method to resolve the `Distribution Package <https://packaging."
|
|
"python.org/en/latest/glossary/#term-Distribution-Package>`_ name (or names, "
|
|
"in the case of a namespace package) that provide each importable top-level "
|
|
"Python module or `Import Package <https://packaging.python.org/en/latest/"
|
|
"glossary/#term-Import-Package>`_::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:317
|
|
#, fuzzy
|
|
msgid "Distributions"
|
|
msgstr "Distribution"
|
|
|
|
#: library/importlib.metadata.rst:319
|
|
msgid ""
|
|
"While the above API is the most common and convenient usage, you can get all "
|
|
"of that information from the ``Distribution`` class. A ``Distribution`` is "
|
|
"an abstract object that represents the metadata for a Python `Distribution "
|
|
"Package <https://packaging.python.org/en/latest/glossary/#term-Distribution-"
|
|
"Package>`_. You can get the ``Distribution`` instance::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:328
|
|
msgid ""
|
|
"Thus, an alternative way to get the version number is through the "
|
|
"``Distribution`` instance::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:334
|
|
msgid ""
|
|
"There are all kinds of additional metadata available on the ``Distribution`` "
|
|
"instance::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:342
|
|
msgid ""
|
|
"The full set of available metadata is not described here. See the `Core "
|
|
"metadata specifications <https://packaging.python.org/en/latest/"
|
|
"specifications/core-metadata/#core-metadata>`_ for additional details."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:347
|
|
#, fuzzy
|
|
msgid "Distribution Discovery"
|
|
msgstr "Distribution"
|
|
|
|
#: library/importlib.metadata.rst:349
|
|
msgid ""
|
|
"By default, this package provides built-in support for discovery of metadata "
|
|
"for file system and zip file `Distribution Package <https://packaging.python."
|
|
"org/en/latest/glossary/#term-Distribution-Package>`_\\s. 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:"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:353
|
|
msgid ""
|
|
"``importlib.metadata`` does not honor :class:`bytes` objects on ``sys.path``."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:354
|
|
msgid ""
|
|
"``importlib.metadata`` will incidentally honor :py:class:`pathlib.Path` "
|
|
"objects on ``sys.path`` even though such values will be ignored for imports."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:358
|
|
msgid "Extending the search algorithm"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:360
|
|
msgid ""
|
|
"Because `Distribution Package <https://packaging.python.org/en/latest/"
|
|
"glossary/#term-Distribution-Package>`_ metadata is not available through :"
|
|
"data:`sys.path` searches, or package loaders directly, the metadata for a "
|
|
"distribution is found through import system `finders`_. To find a "
|
|
"distribution package's metadata, ``importlib.metadata`` queries the list of :"
|
|
"term:`meta path finders <meta path finder>` on :data:`sys.meta_path`."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:368
|
|
msgid ""
|
|
"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."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:373
|
|
msgid ""
|
|
"The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the "
|
|
"interface expected of finders by Python's import system. ``importlib."
|
|
"metadata`` extends this protocol by looking for an optional "
|
|
"``find_distributions`` callable on the finders from :data:`sys.meta_path` "
|
|
"and presents this extended interface as the ``DistributionFinder`` abstract "
|
|
"base class, which defines this abstract method::"
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:387
|
|
msgid ""
|
|
"The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` "
|
|
"properties indicating the path to search and name to match and may supply "
|
|
"other relevant context."
|
|
msgstr ""
|
|
|
|
#: library/importlib.metadata.rst:391
|
|
msgid ""
|
|
"What this means in practice is that to support finding distribution package "
|
|
"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."
|
|
msgstr ""
|
|
|
|
#, fuzzy
|
|
#~ msgid "Package distributions"
|
|
#~ msgstr "Distribution"
|
|
|
|
#~ msgid "Footnotes"
|
|
#~ msgstr "Notes"
|