
    ;ȋhLc                    6   d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlmZmZmZmZ d dlmZmZmZmZmZ d dlmZ d dlmZmZ d dlmZmZ d dlmZ d d	l m!Z! d d
l"m#Z#m$Z$ d dl%m&Z&m'Z'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z.m/Z/ d dl0m1Z1 ddl2m3Z3 ee4ej5        f         Z6 ej7        e8          Z9 G d de          Z:d&dZ; G d de          Z< G d de          Z= G d d          Z> G d  d!e          Z? G d" d#e?          Z@ G d$ d%e?          ZAdS )'    )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    e Zd Zedd            Zedd            Zedd            ZdS )BaseEntryPointreturnstrc                    t                      NNotImplementedErrorselfs    X/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/pip/_internal/metadata/base.pynamezBaseEntryPoint.name-       !###    c                    t                      r%   r&   r(   s    r*   valuezBaseEntryPoint.value1   r,   r-   c                    t                      r%   r&   r(   s    r*   groupzBaseEntryPoint.group5   r,   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| d         dk    r6|r|d         dk    r|dz  }n
|dd         }| dd         } | r| d         dk    6t          t          j        g || 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)r8   r:   s     r*   _convert_installed_files_pathrA   :   s    *  E!H$$ 	tBx4''GODD9Dabb	  E!H$$ w|*T*E***+++r-   c                  .    e Zd ZU ded<   ded<   ded<   dS )RequiresEntryr#   requirementextramarkerN)r3   r4   r5   __annotations__r7   r-   r*   rC   rC   X   s.         JJJKKKKKr-   rC   c                  *   e Zd ZedNd            ZedOd	            ZedPd            ZdQdZdQdZe	dRd            Z
e	dRd            Ze	dRd            Ze	dRd            Ze	dSd            Ze	dSd            Ze	dSd            Ze	dSd            Ze	dTd            Ze	dUd            Ze	dQd            Ze	dQd            Ze	dVd!            Ze	dQd"            Ze	dSd#            Ze	dSd$            Ze	dSd%            Ze	dSd&            Ze	dSd'            ZdWd*ZdXd,ZdYd-ZdZd/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                      )zLoad the distribution from a metadata directory.

        :param directory: Path to a metadata directory, e.g. ``.dist-info``.
        r&   )clsrJ   s     r*   from_directoryzBaseDistribution.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&   )rL   rO   rQ   rR   s       r*   from_metadata_file_contentsz,BaseDistribution.from_metadata_file_contentsg   s      "###r-   wheelWheelr+   c                    t                      )a  Load 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&   )rL   rU   r+   s      r*   
from_wheelzBaseDistribution.from_wheely        "###r-   c                6    | j          d| j         d| j         dS )N z ())raw_nameraw_versionlocationr(   s    r*   __repr__zBaseDistribution.__repr__   s(    -FF$"2FFdmFFFFr-   c                $    | j          d| j         S )Nr[   )r]   r^   r(   s    r*   __str__zBaseDistribution.__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_   zBaseDistribution.location   rY   r-   c                    | j         }|r)|                                rt          |j                  S nt	          | j                  }|r| j        S dS )zThe 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   urlr   r]   r_   )r)   rf   egg_link_paths      r*   editable_project_locationz*BaseDistribution.editable_project_location   sd     _
 
	%++-- 3":>2223
 8FFM % }$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_locationzBaseDistribution.info_location   s     "###r-   boolc                d    | j         }|sdS t          j        |                                          S )a  Whether 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)rn   r?   r@   is_filer)   rn   s     r*   installed_by_distutilsz'BaseDistribution.installed_by_distutils   s5     * 	5|M**22444r-   c                R    | j         }|sdS t          j        |          j        dk    S )zWhether 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         }|sdS |                    d          sdS t          j        |                                          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_dirrr   s     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         }|sdS |                    d          sdS t          j        |                                          S )aa  Whether 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-infory   rr   s     r*   installed_with_dist_infoz)BaseDistribution.installed_with_dist_info   sP     * 	5%%l33 	5|M**11333r-   r   c                    t                      r%   r&   r(   s    r*   canonical_namezBaseDistribution.canonical_name  r,   r-   r   c                    t                      r%   r&   r(   s    r*   versionzBaseDistribution.version  r,   r-   c                    t                      r%   r&   r(   s    r*   r^   zBaseDistribution.raw_version  r,   r-   c                8    | j                             dd          S )zConvert 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_filename  s     }$$S#...r-   DirectUrl | Nonec                (   	 |                      t                    }n# t          $ r Y dS w xY w	 t          j        |          S # t
          t          j        t          f$ r2}t          
                    dt          | j        |           Y d}~dS d}~ww xY w)zObtain a DirectUrl from this distribution.

        Returns None if the distribution has no `direct_url.json` metadata,
        or if `direct_url.json` is invalid.
        NzError parsing %s for %s: %s)	read_textr   FileNotFoundErrorr   	from_jsonUnicodeDecodeErrorjsonJSONDecodeErrorr   loggerwarningr   )r)   contentes      r*   rf   zBaseDistribution.direct_url  s    	nn%=>>GG  	 	 	44		&w/// $
 	 	 	
 NN-(#	   44444	s#    
++A B'BBc                    	 |                      d          }n# t          t          t          f$ r Y dS w xY w|                                D ]}|                                }|r|c S dS )N	INSTALLER )r   OSError
ValueErrorr   
splitlinesstrip)r)   installer_textlinecleaned_lines       r*   	installerzBaseDistribution.installer9  s    	!^^K88NN%67 	 	 	22	"--// 	$ 	$D::<<L $####$rs    33c                ,    |                      d          S )N	REQUESTED)rq   r(   s    r*   	requestedzBaseDistribution.requestedE  s    ||K(((r-   c                *    t          | j                  S r%   )ro   rj   r(   s    r*   editablezBaseDistribution.editableI  s    D2333r-   c                <    | j         dS t          | j                   S )z|If distribution is installed in the current virtual environment.

        Always True if we're not in a virtualenv.
        NF)rl   r   r(   s    r*   localzBaseDistribution.localM  s#     "*5/000r-   c                z    | j         t          dS | j                             t          t                              S NF)rl   r   
startswithr   r(   s    r*   in_usersitezBaseDistribution.in_usersiteW  s4    "*i.?5&11.2K2KLLLr-   c                z    | j         t          dS | j                             t          t                              S r   )rl   r   r   r   r(   s    r*   in_site_packagesz!BaseDistribution.in_site_packages]  s4    "*m.C5&11.2O2OPPPr-   pathInfoPathc                    t                      )z7Check whether an entry in the info directory is a file.r&   r)   r   s     r*   rq   zBaseDistribution.is_filec  r,   r-   Iterator[str]c                    t                      )zFind 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_namesg  rN   r-   c                    t                      )zRead 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   zBaseDistribution.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_implzBaseDistribution._metadata_impl{  r   r-   c                X    |                                  }|                     |           |S )a  Metadata 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   zBaseDistribution.metadata~  s.     &&((##H---r-   dict[str, Any]c                *    t          | j                  S )a  PEP 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.
        )r   r   r(   s    r*   metadata_dictzBaseDistribution.metadata_dict  s     4=)))r-   c                6    | j                             d          S )zDValue of "Metadata-Version:" in distribution metadata, if available.zMetadata-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]   zBaseDistribution.raw_name  s    
 }  )<===r-   r   c                &   | j                             d          }|t                      S 	 t          t          |                    }nH# t          $ r;}d}t
                              || j        |           t                      cY d}~S d}~ww xY w|S )zValue of "Requires-Python:" in distribution metadata.

        If the key does not exist or contains an invalid value, an empty
        SpecifierSet should be returned.
        zRequires-PythonNz-Package %r has an invalid Requires-Python: %s)r   r   r   r#   r   r   r   r]   )r)   r/   specr   messages        r*   requires_pythonz BaseDistribution.requires_python  s     !!"344=>>!	"E

++DD 	" 	" 	"EGNN7DM1555>>!!!!!!	" s   A	 	
B0B	B	Br7   extrasCollection[str]Iterable[Requirement]c                    t                      )zDependencies 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  rN   r-   Iterable[str]c                8    | j                             dg           S )zRaw 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                      )aj  Extras 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          $ r Y d S w xY wd t          j        |                                          D             S )NRECORDc              3  d   K   | ]+}t          t          j        |d                              V  ,dS )r   Nr>   ).0rows     r*   	<genexpr>zFBaseDistribution._iter_declared_entries_from_record.<locals>.<genexpr>  s8      SScGL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    	>>(++DD  	 	 	44	 TSSZ@Q@Q5R5RSSSSs    
&&c                `   	 |                      d          }n# t          $ r Y d S w xY wd |                    d          D             }| j        }| j        }|||S 	 t          j        |                              |          n# t          $ r |cY S w xY wj	        s|S fd|D             S )Nzinstalled-files.txtc              3     K   | ]}||V  	d S r%   r7   )r   ps     r*   r   zFBaseDistribution._iter_declared_entries_from_legacy.<locals>.<genexpr>  s'      AAqqAAAAAAAr-   F)keependsc              3  p   K   | ]0}t          t          j        |          j        j                  V  1d S r%   )rA   r?   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_   rn   r?   r@   relative_tor   r   )r)   r   pathsrootr:   r   s        @r*   "_iter_declared_entries_from_legacyz3BaseDistribution._iter_declared_entries_from_legacy  s    	>>"788DD  	 	 	44	AADOOUO;;AAA}!<4<L	|D))55d;;HH 	 	 	LLL	~ 	L
 
 
 

 
 
 	
s    
'''B BBc                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          $ r Y dS w xY wdx}}|                                D ]}|                                }|r|                    d          r.|                    d          rB|                    d          r-|                    d                              d          \  }}}t          |||	          V  dS )
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[]:)rD   rE   rF   )r   r   r   r   r   rz   	partitionrC   )r)   r   rE   rF   r   r   s         r*   _iter_requires_txt_entriesz+BaseDistribution._iter_requires_txt_entries  s     	nn^44GG  	 	 	FF	&&(( 	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 	Ns    
((c              #     K   dh}|                                  D ]4}t          |j                  }||v r|                    |           |V  5dS )z'Get extras from the egg-info directory.r   N)r   r   rE   add)r)   known_extrasr8   rE   s       r*   _iter_egg_info_extrasz&BaseDistribution._iter_egg_info_extras  sn      t4466 	 	E%ek22E$$U###KKKK	 	r-   c              #     K   |                                  D ]b}t          |j                  }|r|j        rd|j         d| d}n|rd| d}n|j        r|j        }nd}|r|j         d| V  Y|j        V  cdS )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   r   rE   rF   rD   )r)   r8   rE   rF   s       r*   _iter_egg_info_dependenciesz,BaseDistribution._iter_egg_info_dependencies  s       4466 	( 	(E%ek22E  CU\CC5CCC .e...  (*77v777777'''''	( 	(r-   r   Nonec                    |                     d          s|                                 D ]}||d<   |                     d          s|                                 D ]	}||d<   dS dS )z6Add egg-info requires.txt information to the metadata.r   zProvides-ExtraN)r   r   r   )r)   r   deprE   s       r*   r   z'BaseDistribution._add_egg_info_requires9  s    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)rJ   r#   r"   rI   )rO   rP   rQ   r#   rR   r#   r"   rI   )rU   rV   r+   r#   r"   rI   r2   )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  )3r3   r4   r5   classmethodrM   rT   rX   r`   rb   r6   r_   rj   rl   rn   rs   rw   r|   r~   r   r   r^   r   rf   r   r   r   r   r   r   rq   r   r   r   r   	functoolscached_propertyr   r   r   r]   r   r   r   r   r   r   r   r   r   r   r   r7   r-   r*   rI   rI   ^   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   ( ( ( (83 3 3 3 3 3r-   rI   c                  n    e Zd ZdZedd            Zedd            Zdd
ZddZddZ	de
dddfddZdS )BaseEnvironmentz6An environment containing distributions to introspect.r"   c                    t                      r%   r&   )rL   s    r*   defaultzBaseEnvironment.defaultF  r,   r-   r   list[str] | Nonec                    t                      r%   r&   )rL   r   s     r*   
from_pathszBaseEnvironment.from_pathsJ  r,   r-   r+   r#   BaseDistribution | Nonec                    t                      )zGiven 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_distributionN  rN   r-   Iterator[BaseDistribution]c                    t                      )a  Iterate 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_distributionsV  r   r-   c              #     K   |                                  D ]U}t          j        d|j        t          j                  }|s't
                              d|j        |j                   Q|V  VdS )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  
 JJJJ#	 	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             }fd|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.
        c              3  (   K   | ]}|j         	|V  d S r%   )r   r   ds     r*   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s)      ++17+!++++++r-   c              3  (   K   | ]}|j         	|V  d S r%   r   r$  s     r*   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s)      22qz2!222222r-   c              3  (   K   | ]}|j         	|V  d S r%   r'  r$  s     r*   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s)      ..1:.!......r-   c              3  (   K   | ]}|j         	|V  d S r%   )r   r$  s     r*   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s)      111=1!111111r-   c              3  .   K   | ]}|j         v|V  d S r%   )r   )r   r%  r  s     r*   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s0      >>a!1!=!=!=!=!=!=>>r-   )r  )r)   r  r  r  r   r!  its     `    r*   iter_installed_distributionsz,BaseEnvironment.iter_installed_distributionst  s    0 ((** 	,++R+++B  	322R222B 	/..R...B 	211R111B>>>>2>>>>r-   N)r"   r  )r   r  r"   r  )r+   r#   r"   r  )r"   r  )r  ro   r  r  r  ro   r   ro   r!  ro   r"   r  )r3   r4   r5   __doc__r  r
  r  r  r  r  r   r,  r7   r-   r*   r  r  C  s        @@$ $ $ [$ $ $ $ [$$ $ $ $$ $ $ $   .  *"&$!? !? !? !? !? !? !?r-   r  c                  "    e Zd ZU ded<   ddZdS )rV   r#   r_   r"   zipfile.ZipFilec                    t                      r%   r&   r(   s    r*   
as_zipfilezWheel.as_zipfile  r   r-   Nr"   r/  )r3   r4   r5   rG   r1  r7   r-   r*   rV   rV     s3         MMM$ $ $ $ $ $r-   rV   c                      e Zd Zd	dZd
dZdS )FilesystemWheelr_   r#   r"   r  c                    || _         d S r%   )r_   rv   s     r*   __init__zFilesystemWheel.__init__  s     r-   r/  c                8    t          j        | j        d          S NT)
allowZip64)zipfileZipFiler_   r(   s    r*   r1  zFilesystemWheel.as_zipfile  s    t}>>>>r-   N)r_   r#   r"   r  r2  r3   r4   r5   r6  r1  r7   r-   r*   r4  r4    s<        ! ! ! !? ? ? ? ? ?r-   r4  c                      e Zd ZddZdd	Zd
S )MemoryWheelr_   r#   stream	IO[bytes]r"   r  c                "    || _         || _        d S r%   )r_   r?  )r)   r_   r?  s      r*   r6  zMemoryWheel.__init__  s     r-   r/  c                8    t          j        | j        d          S r8  )r:  r;  r?  r(   s    r*   r1  zMemoryWheel.as_zipfile  s    t{t<<<<r-   N)r_   r#   r?  r@  r"   r  r2  r<  r7   r-   r*   r>  r>    s<           = = = = = =r-   r>  )r8   r9   r:   r9   r"   r#   )B
__future__r   r   email.messageemailr  r   loggingr?   r  r:  collections.abcr   r   r   r   typingr   r	   r
   r   r   "pip._vendor.packaging.requirementsr    pip._vendor.packaging.specifiersr   r   pip._vendor.packaging.utilsr   r   pip._vendor.packaging.versionr   pip._internal.exceptionsr   pip._internal.locationsr   r   pip._internal.models.direct_urlr   r   r   pip._internal.utils.compatr   pip._internal.utils.egg_linkr   pip._internal.utils.miscr   r   pip._internal.utils.urlsr   _jsonr   r#   PurePathr   	getLoggerr3   r   r!   rA   rC   rI   r  rV   r4  r>  r7   r-   r*   <module>rW     s[   " " " " " " 



            				  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   b3 b3 b3 b3 b3x b3 b3 b3JR? R? R? R? R? R? R? R?j$ $ $ $ $H $ $ $? ? ? ? ?e ? ? ?= = = = =% = = = = =r-   