HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_internal/metadata/__pycache__/base.cpython-311.pyc
�

�miLc��6�ddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZm
Z
mZmZddlmZmZmZmZmZddlmZddlmZmZddlmZmZddlmZdd	l m!Z!dd
l"m#Z#m$Z$ddl%m&Z&m'Z'm(Z(ddl)m*Z*dd
l+m,Z,ddl-m.Z.m/Z/ddl0m1Z1ddl2m3Z3ee4ej5fZ6ej7e8��Z9Gd�de��Z:d&d�Z;Gd�de��Z<Gd�de��Z=Gd�d��Z>Gd �d!e��Z?Gd"�d#e?��Z@Gd$�d%e?��ZAdS)'�)�annotationsN)�
Collection�	Container�Iterable�Iterator)�IO�Any�
NamedTuple�Protocol�Union)�Requirement)�InvalidSpecifier�SpecifierSet)�NormalizedName�canonicalize_name)�Version)�NoneMetadataError)�
site_packages�	user_site)�DIRECT_URL_METADATA_NAME�	DirectUrl�DirectUrlValidationError)�stdlib_pkgs)�egg_link_path_from_sys_path)�is_local�normalize_path)�url_to_path�)�msg_to_jsonc�V�eZdZedd���Zedd���Zedd���ZdS)�BaseEntryPoint�return�strc��t����N��NotImplementedError��selfs �=D:\Python311\Lib\site-packages\pip/_internal/metadata/base.py�namezBaseEntryPoint.name-���!�#�#�#�c��t���r%r&r(s r*�valuezBaseEntryPoint.value1r,r-c��t���r%r&r(s r*�groupzBaseEntryPoint.group5r,r-N�r"r#)�__name__�
__module__�__qualname__�propertyr+r/r1�r-r*r!r!,sr������
�$�$�$��X�$��$�$�$��X�$��$�$�$��X�$�$�$r-r!�entry�tuple[str, ...]�infor"r#c���|rB|ddkr6|r|ddkr|dz
}n
|dd�}|dd�}|r|ddk�6ttjg|�|�R���S)a�Convert a legacy installed-files.txt path into modern RECORD path.

    The legacy format stores paths relative to the info directory, while the
    modern format stores paths relative to the package root, e.g. the
    site-packages directory.

    :param entry: Path parts of the installed-files.txt entry.
    :param info: Path parts of the egg-info directory relative to package root.
    :returns: The converted entry.

    For best compatibility with symlinks, this does not use ``abspath()`` or
    ``Path.resolve()``, but tries to work with path parts:

    1. While ``entry`` starts with ``..``, remove the equal amounts of parts
       from ``info``; if ``info`` is empty, start appending ``..`` instead.
    2. Join the two directly.
    r�..���)r<Nr�r#�pathlib�Path)r8r:s  r*�_convert_installed_files_pathrA:s���*��E�!�H��$���	�t�B�x�4�'�	��G�O�D�D�����9�D��a�b�b�	����E�!�H��$���w�|�*�T�*�E�*�*�*�+�+�+r-c�.�eZdZUded<ded<ded<dS)�
RequiresEntryr#�requirement�extra�markerN)r3r4r5�__annotations__r7r-r*rCrCXs.������������J�J�J��K�K�K�K�Kr-rCc�*�eZdZedNd���ZedOd	���ZedPd
���ZdQd�ZdQd�Ze	dRd���Z
e	dRd���Ze	dRd���Ze	dRd���Z
e	dSd���Ze	dSd���Ze	dSd���Ze	dSd���Ze	dTd���Ze	dUd���Ze	dQd���Ze	dQd���Ze	dVd!���Ze	dQd"���Ze	dSd#���Ze	dSd$���Ze	dSd%���Ze	dSd&���Ze	dSd'���ZdWd*�ZdXd,�ZdYd-�ZdZd/�Z d[d1�Z!e"j#d[d2���Z$e	d\d4���Z%e	dRd5���Z&e	dQd6���Z'e	d]d8���Z(d^d_d=�Z)d`d?�Z*dadA�Z+dbdC�Z,dbdD�Z-dbdE�Z.dcdG�Z/d`dH�Z0d`dI�Z1dddL�Z2dMS)e�BaseDistribution�	directoryr#r"c��t���)z�Load the distribution from a metadata directory.

        :param directory: Path to a metadata directory, e.g. ``.dist-info``.
        r&)�clsrJs  r*�from_directoryzBaseDistribution.from_directory_���"�#�#�#r-�metadata_contents�bytes�filename�project_namec��t���)a�Load the distribution from the contents of a METADATA file.

        This is used to implement PEP 658 by generating a "shallow" dist object that can
        be used for resolution without downloading or building the actual dist yet.

        :param metadata_contents: The contents of a METADATA file.
        :param filename: File name for the dist with this metadata.
        :param project_name: Name of the project this dist represents.
        r&)rLrOrQrRs    r*�from_metadata_file_contentsz,BaseDistribution.from_metadata_file_contentsgs�� "�#�#�#r-�wheel�Wheelr+c��t���)aLoad the distribution from a given wheel.

        :param wheel: A concrete wheel definition.
        :param name: File name of the wheel.

        :raises InvalidWheel: Whenever loading of the wheel causes a
            :py:exc:`zipfile.BadZipFile` exception to be thrown.
        :raises UnsupportedWheel: If the wheel is a valid zip, but malformed
            internally.
        r&)rLrUr+s   r*�
from_wheelzBaseDistribution.from_wheely���"�#�#�#r-c�6�|j�d|j�d|j�d�S)N� z (�))�raw_name�raw_version�locationr(s r*�__repr__zBaseDistribution.__repr__�s(���-�F�F�$�"2�F�F�d�m�F�F�F�Fr-c�$�|j�d|j��S)Nr[)r]r^r(s r*�__str__zBaseDistribution.__str__�s���-�4�4�$�"2�4�4�4r-�
str | Nonec��t���)a�Where the distribution is loaded from.

        A string value is not necessarily a filesystem path, since distributions
        can be loaded from other sources, e.g. arbitrary zip archives. ``None``
        means the distribution is created in-memory.

        Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If
        this is a symbolic link, we want to preserve the relative path between
        it and files in the distribution.
        r&r(s r*r_zBaseDistribution.location�rYr-c��|j}|r)|���rt|j��Snt	|j��}|r|jSdS)z�The project location for editable distributions.

        This is the directory where pyproject.toml or setup.py is located.
        None if the distribution is not installed in editable mode.
        N)�
direct_url�is_local_editabler�urlrr]r_)r)rf�
egg_link_paths   r*�editable_project_locationz*BaseDistribution.editable_project_location�sd���_�
��
	%��+�+�-�-�
3�"�:�>�2�2�2�
3�
8��
�F�F�M��
%��}�$��tr-c��t���)a�The distribution's "installed" location.

        This should generally be a ``site-packages`` directory. This is
        usually ``dist.location``, except for legacy develop-installed packages,
        where ``dist.location`` is the source code location, and this is where
        the ``.egg-link`` file is.

        The returned location is normalized (in particular, with symlinks removed).
        r&r(s r*�installed_locationz#BaseDistribution.installed_location�s��"�#�#�#r-c��t���)a/Location of the .[egg|dist]-info directory or file.

        Similarly to ``location``, a string value is not necessarily a
        filesystem path. ``None`` means the distribution is created in-memory.

        For a modern .dist-info installation on disk, this should be something
        like ``{location}/{raw_name}-{version}.dist-info``.

        Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If
        this is a symbolic link, we want to preserve the relative path between
        it and other files in the distribution.
        r&r(s r*�
info_locationzBaseDistribution.info_location�s��"�#�#�#r-�boolc�d�|j}|sdStj|�����S)aWhether this distribution is installed with legacy distutils format.

        A distribution installed with "raw" distutils not patched by setuptools
        uses one single file at ``info_location`` to store metadata. We need to
        treat this specially on uninstallation.
        F)rnr?r@�is_file�r)rns  r*�installed_by_distutilsz'BaseDistribution.installed_by_distutils�s5���*�
��	��5��|�M�*�*�2�2�4�4�4r-c�R�|j}|sdStj|��jdkS)z�Whether this distribution is installed as an egg.

        This usually indicates the distribution was installed by (older versions
        of) easy_install.
        Fz.egg)r_r?r@�suffix�r)r_s  r*�installed_as_eggz!BaseDistribution.installed_as_egg�s2���=���	��5��|�H�%�%�,��6�6r-c��|j}|sdS|�d��sdStj|�����S)a�Whether this distribution is installed with the ``.egg-info`` format.

        This usually indicates the distribution was installed with setuptools
        with an old pip version or with ``single-version-externally-managed``.

        Note that this ensure the metadata store is a directory. distutils can
        also installs an ``.egg-info``, but as a file, not a directory. This
        property is *False* for that case. Also see ``installed_by_distutils``.
        Fz	.egg-info�rn�endswithr?r@�is_dirrrs  r*�"installed_with_setuptools_egg_infoz3BaseDistribution.installed_with_setuptools_egg_info�sP���*�
��	��5��%�%�k�2�2�	��5��|�M�*�*�1�1�3�3�3r-c��|j}|sdS|�d��sdStj|�����S)aaWhether this distribution is installed with the "modern format".

        This indicates a "modern" installation, e.g. storing metadata in the
        ``.dist-info`` directory. This applies to installations made by
        setuptools (but through pip, not directly), or anything using the
        standardized build backend interface (PEP 517).
        Fz
.dist-inforyrrs  r*�installed_with_dist_infoz)BaseDistribution.installed_with_dist_info�sP���*�
��	��5��%�%�l�3�3�	��5��|�M�*�*�1�1�3�3�3r-rc��t���r%r&r(s r*�canonical_namezBaseDistribution.canonical_namer,r-rc��t���r%r&r(s r*�versionzBaseDistribution.versionr,r-c��t���r%r&r(s r*r^zBaseDistribution.raw_versionr,r-c�8�|j�dd��S)z�Convert a project name to its setuptools-compatible filename.

        This is a copy of ``pkg_resources.to_filename()`` for compatibility.
        �-�_)r]�replacer(s r*�setuptools_filenamez$BaseDistribution.setuptools_filenames���}�$�$�S�#�.�.�.r-�DirectUrl | Nonec�(�	|�t��}n#t$rYdSwxYw	tj|��S#t
tjtf$r2}t�
dt|j|��Yd}~dSd}~wwxYw)z�Obtain a DirectUrl from this distribution.

        Returns None if the distribution has no `direct_url.json` metadata,
        or if `direct_url.json` is invalid.
        NzError parsing %s for %s: %s)�	read_textr�FileNotFoundErrorr�	from_json�UnicodeDecodeError�json�JSONDecodeErrorr�logger�warningr�)r)�content�es   r*rfzBaseDistribution.direct_urls���	��n�n�%=�>�>�G�G�� �	�	�	��4�4�	����
	��&�w�/�/�/���� �$�
�	�	�	�

�N�N�-�(��#��	
�
�
��4�4�4�4�4�����	���s#��
+�+�A�B�'B�Bc���	|�d��}n#tttf$rYdSwxYw|���D]}|���}|r|cS�dS)N�	INSTALLER�)r��OSError�
ValueErrorr�
splitlines�strip)r)�installer_text�line�cleaned_lines    r*�	installerzBaseDistribution.installer9s���	�!�^�^�K�8�8�N�N����%6�7�	�	�	��2�2�	����"�-�-�/�/�	$�	$�D��:�:�<�<�L��
$�#�#�#�#�
$��rs��3�3c�,�|�d��S)N�	REQUESTED)rqr(s r*�	requestedzBaseDistribution.requestedEs���|�|�K�(�(�(r-c�*�t|j��Sr%)rorjr(s r*�editablezBaseDistribution.editableIs���D�2�3�3�3r-c�<�|j�dSt|j��S)z|If distribution is installed in the current virtual environment.

        Always True if we're not in a virtualenv.
        NF)rlrr(s r*�localzBaseDistribution.localMs%���"�	��5���/�0�0�0r-c�z�|j�t�dS|j�tt����S�NF)rlr�
startswithrr(s r*�in_usersitezBaseDistribution.in_usersiteWs8���"�	�i�	��5��&�1�1�.��2K�2K�L�L�Lr-c�z�|j�t�dS|j�tt����Sr�)rlrr�rr(s r*�in_site_packagesz!BaseDistribution.in_site_packages]s8���"�	�m�	��5��&�1�1�.��2O�2O�P�P�Pr-�path�InfoPathc��t���)z7Check whether an entry in the info directory is a file.r&�r)r�s  r*rqzBaseDistribution.is_filecr,r-�
Iterator[str]c��t���)z�Find distutils 'scripts' entries metadata.

        If 'scripts' is supplied in ``setup.py``, distutils records those in the
        installed distribution's ``scripts`` directory, a file for each script.
        r&r(s r*�iter_distutils_script_namesz,BaseDistribution.iter_distutils_script_namesgrNr-c��t���)z�Read a file in the info directory.

        :raise FileNotFoundError: If ``path`` does not exist in the directory.
        :raise NoneMetadataError: If ``path`` exists in the info directory, but
            cannot be read.
        r&r�s  r*r�zBaseDistribution.read_texto���"�#�#�#r-�Iterable[BaseEntryPoint]c��t���r%r&r(s r*�iter_entry_pointsz"BaseDistribution.iter_entry_pointsx���!�#�#�#r-�email.message.Messagec��t���r%r&r(s r*�_metadata_implzBaseDistribution._metadata_impl{r�r-c�X�|���}|�|��|S)aMetadata of distribution parsed from e.g. METADATA or PKG-INFO.

        This should return an empty message if the metadata file is unavailable.

        :raises NoneMetadataError: If the metadata file is available, but does
            not contain valid metadata.
        )r��_add_egg_info_requires)r)�metadatas  r*r�zBaseDistribution.metadata~s.���&�&�(�(���#�#�H�-�-�-��r-�dict[str, Any]c�*�t|j��S)aPEP 566 compliant JSON-serializable representation of METADATA or PKG-INFO.

        This should return an empty dict if the metadata file is unavailable.

        :raises NoneMetadataError: If the metadata file is available, but does
            not contain valid metadata.
        )rr�r(s r*�
metadata_dictzBaseDistribution.metadata_dict�s���4�=�)�)�)r-c�6�|j�d��S)zDValue of "Metadata-Version:" in distribution metadata, if available.zMetadata-Version)r��getr(s r*�metadata_versionz!BaseDistribution.metadata_version�s���}� � �!3�4�4�4r-c�B�|j�d|j��S)z*Value of "Name:" in distribution metadata.�Name)r�r�r�r(s r*r]zBaseDistribution.raw_name�s��
�}� � ���)<�=�=�=r-rc�&�|j�d��}|�t��S	tt|����}nH#t$r;}d}t
�||j|��t��cYd}~Sd}~wwxYw|S)z�Value of "Requires-Python:" in distribution metadata.

        If the key does not exist or contains an invalid value, an empty
        SpecifierSet should be returned.
        zRequires-PythonNz-Package %r has an invalid Requires-Python: %s)r�r�rr#rr�r�r])r)r/�specr��messages     r*�requires_pythonz BaseDistribution.requires_python�s����
�!�!�"3�4�4���	"��>�>�!�	"���E�
�
�+�+�D�D���	"�	"�	"�E�G��N�N�7�D�M�1�5�5�5��>�>�!�!�!�!�!�!�����	"�����s�A	�	
B�0B	�B�	Br7�extras�Collection[str]�Iterable[Requirement]c��t���)z�Dependencies of this distribution.

        For modern .dist-info distributions, this is the collection of
        "Requires-Dist:" entries in distribution metadata.
        r&)r)r�s  r*�iter_dependenciesz"BaseDistribution.iter_dependencies�rNr-�
Iterable[str]c�8�|j�dg��S)zRaw Requires-Dist metadata.�
Requires-Dist)r��get_allr(s r*�iter_raw_dependenciesz&BaseDistribution.iter_raw_dependencies�s���}�$�$�_�b�9�9�9r-�Iterable[NormalizedName]c��t���)ajExtras provided by this distribution.

        For modern .dist-info distributions, this is the collection of
        "Provides-Extra:" entries in distribution metadata.

        The return value of this function is expected to be normalised names,
        per PEP 685, with the returned value being handled appropriately by
        `iter_dependencies`.
        r&r(s r*�iter_provided_extrasz%BaseDistribution.iter_provided_extras�s��"�#�#�#r-�Iterator[str] | Nonec��	|�d��}n#t$rYdSwxYwd�tj|�����D��S)N�RECORDc3�dK�|]+}ttj|d����V��,dS)rNr>)�.0�rows  r*�	<genexpr>zFBaseDistribution._iter_declared_entries_from_record.<locals>.<genexpr>�s8����S�S�c��G�L��Q��(�(�)�)�S�S�S�S�S�Sr-)r�r��csv�readerr�)r)�texts  r*�"_iter_declared_entries_from_recordz3BaseDistribution._iter_declared_entries_from_record�sg��	��>�>�(�+�+�D�D�� �	�	�	��4�4�	����T�S�S�Z����@Q�@Q�5R�5R�S�S�S�Ss��
&�&c�`��	|�d��}n#t$rYdSwxYwd�|�d���D��}|j}|j}|�|�|S	tj|���|���n#t$r|cYSwxYw�j	s|S�fd�|D��S)Nzinstalled-files.txtc3�K�|]}|�|V��	dSr%r7)r��ps  r*r�zFBaseDistribution._iter_declared_entries_from_legacy.<locals>.<genexpr>�s'����A�A�q�q�A��A�A�A�A�A�Ar-F)�keependsc3�p�K�|]0}ttj|��j�j��V��1dSr%)rAr?r@�parts)r�r��info_rels  �r*r�zFBaseDistribution._iter_declared_entries_from_legacy.<locals>.<genexpr>�sN�����
�
��
*�'�,�q�/�/�*?���P�P�
�
�
�
�
�
r-)
r�r�r�r_rnr?r@�relative_tor�r�)r)r��paths�rootr:r�s     @r*�"_iter_declared_entries_from_legacyz3BaseDistribution._iter_declared_entries_from_legacy�s���	��>�>�"7�8�8�D�D�� �	�	�	��4�4�	����A�A�D�O�O�U�O�;�;�A�A�A���}���!���	�4�	��L�	��|�D�)�)�5�5�d�;�;�H�H���	�	�	��L�L�L�	�����~�	��L�
�
�
�
��
�
�
�	
s��
'�'�'B�B�Bc�R�|���p|���S)a�Iterate through file entries declared in this distribution.

        For modern .dist-info distributions, this is the files listed in the
        ``RECORD`` metadata file. For legacy setuptools distributions, this
        comes from ``installed-files.txt``, with entries normalized to be
        compatible with the format used by ``RECORD``.

        :return: An iterator for listed entries, or None if the distribution
            contains neither ``RECORD`` nor ``installed-files.txt``.
        )r�r�r(s r*�iter_declared_entriesz&BaseDistribution.iter_declared_entries�s,��
�3�3�5�5�
9��6�6�8�8�	
r-�Iterator[RequiresEntry]c#�K�	|�d��}n#t$rYdSwxYwdx}}|���D]�}|���}|r|�d��r�.|�d��rB|�d��r-|�d���d��\}}}��t|||�	��V���dS)
a�Parse a ``requires.txt`` in an egg-info directory.

        This is an INI-ish format where an egg-info stores dependencies. A
        section name describes extra other environment markers, while each entry
        is an arbitrary string (not a key-value pair) representing a dependency
        as a requirement string (no markers).

        There is a construct in ``importlib.metadata`` called ``Sectioned`` that
        does mostly the same, but the format is currently considered private.
        zrequires.txtNr��#�[�]z[]�:)rDrErF)r�r�r�r�r�rz�	partitionrC)r)r�rErFr�r�s      r*�_iter_requires_txt_entriesz+BaseDistribution._iter_requires_txt_entries�s����	��n�n�^�4�4�G�G�� �	�	�	��F�F�	���������&�&�(�(�	N�	N�D��:�:�<�<�D��
�4�?�?�3�/�/�
�����s�#�#�
��
�
�c�(:�(:�
�#'�:�:�d�#3�#3�#=�#=�c�#B�#B� ��q�&���D��f�M�M�M�M�M�M�M�	N�	Ns��
(�(c#�K�dh}|���D]4}t|j��}||vr�|�|��|V��5dS)z'Get extras from the egg-info directory.r�N)r�rrE�add)r)�known_extrasr8rEs    r*�_iter_egg_info_extrasz&BaseDistribution._iter_egg_info_extrassp�����t���4�4�6�6�	�	�E�%�e�k�2�2�E���$�
�����U�#�#�#��K�K�K�K�	�	r-c#�K�|���D]b}t|j��}|r|jrd|j�d|�d�}n|rd|�d�}n|jr|j}nd}|r|j�d|��V��Y|jV��cdS)a�Get distribution dependencies from the egg-info directory.

        To ease parsing, this converts a legacy dependency entry into a PEP 508
        requirement string. Like ``_iter_requires_txt_entries()``, there is code
        in ``importlib.metadata`` that does mostly the same, but not do exactly
        what we need.

        Namely, ``importlib.metadata`` does not normalize the extra name before
        putting it into the requirement string, which causes marker comparison
        to fail because the dist-info format do normalize. This is consistent in
        all currently available PEP 517 backends, although not standardized.
        �(z) and extra == "�"z
extra == "r�z ; N)r�rrErFrD)r)r8rErFs    r*�_iter_egg_info_dependenciesz,BaseDistribution._iter_egg_info_dependenciess������4�4�6�6�
	(�
	(�E�%�e�k�2�2�E��
���
�C�U�\�C�C�5�C�C�C����
�.�e�.�.�.�����
��������
(��*�7�7�v�7�7�7�7�7�7��'�'�'�'�'�
	(�
	(r-r��Nonec���|�d��s|���D]}||d<�|�d��s|���D]	}||d<�dSdS)z6Add egg-info requires.txt information to the metadata.r�zProvides-ExtraN)r�rr�)r)r��deprEs    r*r�z'BaseDistribution._add_egg_info_requires9s�������0�0�	0��7�7�9�9�
0�
0��,/���)�)���� 0�1�1�	3��3�3�5�5�
3�
3��-2��)�*�*�	3�	3�
3�
3r-N)rJr#r"rI)rOrPrQr#rRr#r"rI)rUrVr+r#r"rIr2)r"rc)r"ro)r"r)r"r)r"r�)r�r�r"ro)r"r�)r�r�r"r#)r"r�)r"r�)r"r�)r"r)r7)r�r�r"r�)r"r�)r"r�)r"r�)r"r�)r�r�r"r)3r3r4r5�classmethodrMrTrXr`rbr6r_rjrlrnrsrwr|r~r�r�r^r�rfr�r�r�r�r�r�rqr�r�r�r��	functools�cached_propertyr�r�r�r]r�r�r�r�r�r�r�r�r�rr�r7r-r*rIrI^s��������$�$�$��[�$��$�$�$��[�$�"�$�$�$��[�$�G�G�G�G�5�5�5�5��$�$�$��X�$������X��*�
$�
$�
$��X�
$��
$�
$�
$��X�
$��
5�
5�
5��X�
5��7�7�7��X�7��4�4�4��X�4�"�
4�
4�
4��X�
4��$�$�$��X�$��$�$�$��X�$��$�$�$��X�$��/�/�/��X�/������X��2�	�	�	��X�	��)�)�)��X�)��4�4�4��X�4��1�1�1��X�1��M�M�M��X�M�
�Q�Q�Q��X�Q�
$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$���
�
�
���
��*�*�*��X�*��5�5�5��X�5��>�>�>��X�>������X��$$�$�$�$�$�:�:�:�:�
$�
$�
$�
$�T�T�T�T�
�
�
�
�*
�
�
�
� N�N�N�N�2����(�(�(�(�83�3�3�3�3�3r-rIc�n�eZdZdZedd���Zedd���Zdd
�Zdd�Zdd
�Z	de
dddfdd�ZdS)�BaseEnvironmentz6An environment containing distributions to introspect.r"c��t���r%r&)rLs r*�defaultzBaseEnvironment.defaultFr,r-r��list[str] | Nonec��t���r%r&)rLr�s  r*�
from_pathszBaseEnvironment.from_pathsJr,r-r+r#�BaseDistribution | Nonec��t���)z�Given a requirement name, return the installed distributions.

        The name may not be normalized. The implementation must canonicalize
        it for lookup.
        r&)r)r+s  r*�get_distributionz BaseEnvironment.get_distributionNrNr-�Iterator[BaseDistribution]c��t���)aIterate through installed distributions.

        This function should be implemented by subclass, but never called
        directly. Use the public ``iter_distribution()`` instead, which
        implements additional logic to make sure the distributions are valid.
        r&r(s r*�_iter_distributionsz#BaseEnvironment._iter_distributionsVr�r-c#��K�|���D]U}tjd|jtj���}|s't
�d|j|j���Q|V��VdS)zBIterate through all installed distributions without any filtering.z)^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$)�flagsz%Ignoring invalid distribution %s (%s)N)r�re�matchr��
IGNORECASEr�r�r_)r)�dist�project_name_valids   r*�iter_all_distributionsz&BaseEnvironment.iter_all_distributions_s������,�,�.�.�	�	�D�
"$��<��#��m�"�"�"��
&�
����;��'��M����
��J�J�J�J�#	�	r-TF�
local_onlyro�skip�Container[str]�include_editables�editables_only�	user_onlyc���|���}|rd�|D��}|sd�|D��}|rd�|D��}|rd�|D��}�fd�|D��S)a/Return a list of installed distributions.

        This is based on ``iter_all_distributions()`` with additional filtering
        options. Note that ``iter_installed_distributions()`` without arguments
        is *not* equal to ``iter_all_distributions()``, since some of the
        configurations exclude packages by default.

        :param local_only: If True (default), only return installations
        local to the current virtualenv, if in a virtualenv.
        :param skip: An iterable of canonicalized project names to ignore;
            defaults to ``stdlib_pkgs``.
        :param include_editables: If False, don't report editables.
        :param editables_only: If True, only report editables.
        :param user_only: If True, only report installations in the user
        site directory.
        c3�(K�|]
}|j�	|V��dSr%)r��r��ds  r*r�z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>�s)����+�+��1�7�+�!�+�+�+�+�+�+r-c3�(K�|]
}|j�	|V��dSr%�r�r$s  r*r�z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>�s)����2�2��q�z�2�!�2�2�2�2�2�2r-c3�(K�|]
}|j�	|V��dSr%r'r$s  r*r�z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>�s)����.�.��1�:�.�!�.�.�.�.�.�.r-c3�(K�|]
}|j�	|V��dSr%)r�r$s  r*r�z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>�s)����1�1��1�=�1�!�1�1�1�1�1�1r-c3�.�K�|]}|j�v�|V��dSr%)r�)r�r%rs  �r*r�z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>�s0�����>�>�a��!1��!=�>��>�>�>�>�>�>r-)r)r)rrrr r!�its  `    r*�iter_installed_distributionsz,BaseEnvironment.iter_installed_distributionsts����0�
(�
(�
*�
*���	,�+�+�R�+�+�+�B� �	3�2�2�R�2�2�2�B��	/�.�.�R�.�.�.�B��	2�1�1�R�1�1�1�B�>�>�>�>�2�>�>�>�>r-N)r"r)r�rr"r)r+r#r"r)r"r)rrorrrror ror!ror"r)r3r4r5�__doc__rr
r
rrrrr,r7r-r*rrCs�������@�@��$�$�$��[�$��$�$�$��[�$�$�$�$�$�$�$�$�$�����. �*�"&�$��
!?�!?�!?�!?�!?�!?�!?r-rc�"�eZdZUded<dd�ZdS)rVr#r_r"�zipfile.ZipFilec��t���r%r&r(s r*�
as_zipfilezWheel.as_zipfile�r�r-N�r"r/)r3r4r5rGr1r7r-r*rVrV�s3��������M�M�M�$�$�$�$�$�$r-rVc��eZdZd	d�Zd
d�ZdS)�FilesystemWheelr_r#r"rc��||_dSr%)r_rvs  r*�__init__zFilesystemWheel.__init__�s
�� ��
�
�
r-r/c�8�tj|jd���S�NT)�
allowZip64)�zipfile�ZipFiler_r(s r*r1zFilesystemWheel.as_zipfile�s����t�}��>�>�>�>r-N)r_r#r"rr2�r3r4r5r6r1r7r-r*r4r4�s<������!�!�!�!�?�?�?�?�?�?r-r4c��eZdZdd�Zdd	�Zd
S)
�MemoryWheelr_r#�stream�	IO[bytes]r"rc�"�||_||_dSr%)r_r?)r)r_r?s   r*r6zMemoryWheel.__init__�s�� ��
�����r-r/c�8�tj|jd���Sr8)r:r;r?r(s r*r1zMemoryWheel.as_zipfile�s����t�{�t�<�<�<�<r-N)r_r#r?r@r"rr2r<r7r-r*r>r>�s<����������=�=�=�=�=�=r-r>)r8r9r:r9r"r#)B�
__future__rr��
email.message�emailrr��loggingr?rr:�collections.abcrrrr�typingrr	r
rr�"pip._vendor.packaging.requirementsr
� pip._vendor.packaging.specifiersrr�pip._vendor.packaging.utilsrr�pip._vendor.packaging.versionr�pip._internal.exceptionsr�pip._internal.locationsrr�pip._internal.models.direct_urlrrr�pip._internal.utils.compatr�pip._internal.utils.egg_linkr�pip._internal.utils.miscrr�pip._internal.utils.urlsr�_jsonrr#�PurePathr��	getLoggerr3r�r!rArCrIrrVr4r>r7r-r*�<module>rWs[��"�"�"�"�"�"�
�
�
�
���������������������	�	�	�	�����E�E�E�E�E�E�E�E�E�E�E�E���������������;�:�:�:�:�:�K�K�K�K�K�K�K�K�I�I�I�I�I�I�I�I�1�1�1�1�1�1�6�6�6�6�6�6�<�<�<�<�<�<�<�<�����������
3�2�2�2�2�2�D�D�D�D�D�D�=�=�=�=�=�=�=�=�0�0�0�0�0�0���������g�&�&�'��	��	�8�	$�	$��$�$�$�$�$�X�$�$�$�,�,�,�,�<�����J����b3�b3�b3�b3�b3�x�b3�b3�b3�JR?�R?�R?�R?�R?�R?�R?�R?�j$�$�$�$�$�H�$�$�$�?�?�?�?�?�e�?�?�?�=�=�=�=�=�%�=�=�=�=�=r-