
    5>qj*d                       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 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+m,Z, d dl-m.Z. ddl/m0Z0 h dZ1e2ejf                  z  Z4 ejj                  e6      Z7 G d de      Z8	 	 	 	 	 	 d!dZ9 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=      Z?y)"    )annotationsN)
Collection	ContainerIterableIterator)IOAny
NamedTupleProtocol)Requirement)InvalidSpecifierSpecifierSet)NormalizedNamecanonicalize_name)Version)NoneMetadataError)site_packages	user_site)DIRECT_URL_METADATA_NAME	DirectUrlDirectUrlValidationError)egg_link_path_from_sys_path)is_localnormalize_path)url_to_path   )msg_to_json>   pythonwsgirefargparsec                  B    e Zd Zedd       Zedd       Zedd       Zy)BaseEntryPointc                    t               NNotImplementedErrorselfs    Z/opt/rentech/trading_bot/.venv/lib/python3.12/site-packages/pip/_internal/metadata/base.pynamezBaseEntryPoint.name3       !##    c                    t               r$   r%   r'   s    r)   valuezBaseEntryPoint.value7   r+   r,   c                    t               r$   r%   r'   s    r)   groupzBaseEntryPoint.group;   r+   r,   Nreturnstr)__name__
__module____qualname__propertyr*   r.   r0    r,   r)   r"   r"   2   s<    $ $ $ $ $ $r,   r"   c                    | r-| d   dk(  r%|r|d   dk(  r|dz  }n|dd }| dd } | r	| d   dk(  r%t        t        j                  g ||        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   r3   pathlibPath)entryinfos     r)   _convert_installed_files_pathrA   @   sm    * E!H$tBx4'GOD9Dab	 E!H$ w||*T*E*++r,   c                  ,    e Zd ZU ded<   ded<   ded<   y)RequiresEntryr3   requirementextramarkerN)r4   r5   r6   __annotations__r8   r,   r)   rC   rC   ^   s    JKr,   rC   c                     e Zd Zed.d       Ze	 	 	 	 	 	 	 	 d/d       Zed0d       Zd1dZd1dZe	d2d       Z
ej                  d2d       Ze	d2d       Ze	d2d	       Ze	d3d
       Ze	d3d       Ze	d3d       Ze	d3d       Ze	d4d       Ze	d5d       Ze	d1d       Ze	d1d       Ze	d6d       Ze	d1d       Ze	d3d       Ze	d3d       Ze	d3d       Ze	d3d       Ze	d3d       Zd7dZd8dZ d9dZ!d:dZ"d;dZ#ej                  d;d       Z$e	d<d       Z%e	d2d        Z&e	d1d!       Z'e	d=d"       Z(d>d?d#Z)d@d$Z*dAd%Z+dBd&Z,dBd'Z-dBd(Z.dCd)Z/d@d*Z0d@d+Z1dDd,Z2y-)EBaseDistributionc                    t               )zLoad the distribution from a metadata directory.

        :param directory: Path to a metadata directory, e.g. ``.dist-info``.
        r%   )cls	directorys     r)   from_directoryzBaseDistribution.from_directorye        "##r,   c                    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%   )rK   metadata_contentsfilenameproject_names       r)   from_metadata_file_contentsz,BaseDistribution.from_metadata_file_contentsm   s      "##r,   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%   )rK   wheelr*   s      r)   
from_wheelzBaseDistribution.from_wheel        "##r,   c                T    | j                    d| j                   d| j                   dS )N z ())raw_nameraw_versionlocationr'   s    r)   __repr__zBaseDistribution.__repr__   s*    --$"2"2!32dmm_AFFr,   c                8    | j                    d| j                   S )NrY   )r[   r\   r'   s    r)   __str__zBaseDistribution.__str__   s    --$"2"2!344r,   c                    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   rW   r,   c                    | j                   }|r&|j                         rt        |j                        S yt	        | j
                        }|r| j                  S y)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(   rc   egg_link_paths      r)   editable_project_locationz*BaseDistribution.editable_project_location   sR     __
++-":>>22  8FM }}$r,   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,   c                f    | j                   }|syt        j                  |      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)rk   r=   r>   is_filer(   rk   s     r)   installed_by_distutilsz'BaseDistribution.installed_by_distutils   s-     **||M*2244r,   c                d    | j                   }|sy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   s/     == ||H%,,66r,   c                    | j                   }|sy|j                  d      syt        j                  |      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rk   endswithr=   r>   is_dirrn   s     r)   "installed_with_setuptools_egg_infoz3BaseDistribution.installed_with_setuptools_egg_info   s>     **%%k2||M*1133r,   c                    | j                   }|sy|j                  d      syt        j                  |      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-inforu   rn   s     r)   installed_with_dist_infoz)BaseDistribution.installed_with_dist_info   s>     **%%l3||M*1133r,   c                    t               r$   r%   r'   s    r)   canonical_namezBaseDistribution.canonical_name  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                :    | j                   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,   c                   	 | j                  t              }	 t        j                  |      S # t        $ r Y yw xY w# t
        t        j                  t        f$ r0}t        j                  dt        | j                  |       Y d}~y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)   rc   zBaseDistribution.direct_url$  s    	nn%=>G	&&w// ! 		
   $
 	
 NN-(##	 	s!   - < 	99B
&BB
c                    	 | j                  d      }|j	                         D ]  }|j                         }|s|c S  y# t        t        t        f$ r Y yw xY w)N	INSTALLER )r   OSError
ValueErrorr   
splitlinesstrip)r(   installer_textlinecleaned_lines       r)   	installerzBaseDistribution.installer>  sd    	!^^K8N #--/ 	$D::<L##	$  %67 		s   ? AAc                $    | j                  d      S )N	REQUESTED)rm   r'   s    r)   	requestedzBaseDistribution.requestedJ  s    ||K((r,   c                ,    t        | j                        S r$   )boolrg   r'   s    r)   editablezBaseDistribution.editableN  s    D2233r,   c                F    | j                   yt        | j                         S )z|If distribution is installed in the current virtual environment.

        Always True if we're not in a virtualenv.
        F)ri   r   r'   s    r)   localzBaseDistribution.localR  s$     ""*//00r,   c                x    | j                   t        y| j                   j                  t        t                    S NF)ri   r   
startswithr   r'   s    r)   in_usersitezBaseDistribution.in_usersite\  s2    ""*i.?&&11.2KLLr,   c                x    | j                   t        y| j                   j                  t        t                    S r   )ri   r   r   r   r'   s    r)   in_site_packagesz!BaseDistribution.in_site_packagesb  s2    ""*m.C&&11.2OPPr,   c                    t               )z7Check whether an entry in the info directory is a file.r%   r(   paths     r)   rm   zBaseDistribution.is_fileh  r+   r,   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_namesl  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_textt       "##r,   c                    t               r$   r%   r'   s    r)   iter_entry_pointsz"BaseDistribution.iter_entry_points}      !##r,   c                    t               r$   r%   r'   s    r)   _metadata_implzBaseDistribution._metadata_impl  r   r,   c                H    | j                         }| j                  |       |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,   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                8    | j                   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4r,   c                N    | j                   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,   c                   | j                   j                  d      }|
t               S 	 t        t        |            }|S # t        $ r7}d}t
        j                  || j                  |       t               cY d}~S d}~ww xY w)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   r3   r   r   r   r[   )r(   r.   specr   messages        r)   requires_pythonz BaseDistribution.requires_python  ss     !!"34=>!	"E
+D
 	   	"EGNN7DMM15>!	"s   ? 	A?,A:4A?:A?c                    t               )zDependencies of this distribution.

        For modern .dist-info distributions, this is the collection of
        "Requires-Dist:" entries in distribution metadata.
        r%   )r(   extrass     r)   iter_dependenciesz"BaseDistribution.iter_dependencies  rN   r,   c                :    | j                   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9r,   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,   c                    	 | j                  d      }d t        j                  |j	                               D        S # t        $ r Y y w xY w)NRECORDc              3  ^   K   | ]%  }t        t        j                  |d                 ' yw)r   Nr<   ).0rows     r)   	<genexpr>zFBaseDistribution._iter_declared_entries_from_record.<locals>.<genexpr>  s"     ScGLLQ()Ss   +-)r   r   csvreaderr   )r(   texts     r)   "_iter_declared_entries_from_recordz3BaseDistribution._iter_declared_entries_from_record  sG    	>>(+D TSZZ@Q5RSS ! 		s   = 	A	A	c                R   	 | j                  d      }d |j                  d      D        }| j                  }| j                  }|||S 	 t        j                  |      j                  |      j                  s|S fd|D        S # t        $ r Y y w xY w# t        $ r |cY S w xY w)Nzinstalled-files.txtc              3  &   K   | ]	  }|s|  y wr$   r8   )r   ps     r)   r   zFBaseDistribution._iter_declared_entries_from_legacy.<locals>.<genexpr>  s     AqqAs   F)keependsc              3     K   | ]7  }t        t        j                  |      j                  j                         9 y wr$   )rA   r=   r>   parts)r   r   info_rels     r)   r   zFBaseDistribution._iter_declared_entries_from_legacy.<locals>.<genexpr>  s2      
 *',,q/*?*?P
s   =A )
r   r   r   r]   rk   r=   r>   relative_tor   r   )r(   r   pathsrootr@   r   s        @r)   "_iter_declared_entries_from_legacyz3BaseDistribution._iter_declared_entries_from_legacy  s    	>>"78D BDOOUO;A}}!!<4<L	||D)55d;H ~~L

 	
 ! 		  	L	s#   B	 $B 		BBB&%B&c                F    | j                         xs | j                         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 9668	
r,   c              #  v  K   	 | j                  d      }dx}}|j                         D ]}  }|j                         }|r|j	                  d      r'|j	                  d      r6|j                  d      r%|j                  d      j                  d      \  }}}nt        |||	        y# t        $ r Y yw xY ww)
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   rv   	partitionrC   )r(   r   rE   rF   r   r   s         r)   _iter_requires_txt_entriesz+BaseDistribution._iter_requires_txt_entries  s     	nn^4G &&( 	ND::<D4??3/s#c(:#'::d#3#=#=c#B q&DfMM	N ! 		s(   B9B* BB9*	B63B95B66B9c              #     K   dh}| j                         D ]1  }t        |j                        }||v r|j                  |       | 3 yw)z'Get extras from the egg-info directory.r   N)r   r   rE   add)r(   known_extrasr?   rE   s       r)   _iter_egg_info_extrasz&BaseDistribution._iter_egg_info_extras  sQ     t446 	E%ekk2E$U#K	s   A	Ac              #  4  K   | j                         D ]  }t        |j                        }|r |j                  rd|j                   d| d}n$|rd| d}n|j                  r|j                  }nd}|r|j                   d|  t|j                    yw)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(   r?   rE   rF   s       r)   _iter_egg_info_dependenciesz,BaseDistribution._iter_egg_info_dependencies"  s      446 	(E%ekk2EU\\N*:5'C%eWA.**+3vh77'''	(s   BBc                    |j                  d      s| j                         D ]  }||d<   	 |j                  d      s| j                         D ]  }||d<   	 yy)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_requires>  si    0779 0,/)0 01335 3-2)*3 2r,   N)rL   r3   r2   rI   )rP   bytesrQ   r3   rR   r3   r2   rI   )rU   Wheelr*   r3   r2   rI   r1   )r2   z
str | None)r2   r   )r2   r   )r2   r   )r2   zDirectUrl | None)r   InfoPathr2   r   )r2   zIterator[str])r   r   r2   r3   )r2   zIterable[BaseEntryPoint])r2   email.message.Message)r2   zdict[str, Any])r2   r   )r8   )r   zCollection[str]r2   zIterable[Requirement])r2   zIterable[str])r2   zIterable[NormalizedName])r2   zIterator[str] | None)r2   zIterator[RequiresEntry])r   r   r2   None)3r4   r5   r6   classmethodrM   rS   rV   r^   r`   r7   r]   	functoolscached_propertyrg   ri   rk   ro   rs   rx   rz   r|   r~   r\   r   rc   r   r   r   r   r   r   rm   r   r   r   r   r   r   r   r[   r   r   r   r   r   r   r   r   r   r   r   r8   r,   r)   rI   rI   d   s   $ $ $ $ $ 	$
 
$ $" $ $G5 $ $  ( 
$ 
$ $ $ 
5 
5 7 7 4 4" 4 4 $ $ $ $ $ $ / /  2 	 	 ) ) 4 4 1 1 M M
 Q Q
$$$$$ 
 
 * * 5 5 > >  $$:
$T
*
 N2(83r,   rI   c                  v    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y
)BaseEnvironmentz6An environment containing distributions to introspect.c                    t               r$   r%   )rK   s    r)   defaultzBaseEnvironment.defaultK  r+   r,   c                    t               r$   r%   )rK   r   s     r)   
from_pathszBaseEnvironment.from_pathsO  r+   r,   c                    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_distributionS  rN   r,   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_distributions[  r   r,   c              #     K   | j                         D ]d  }t        j                  d|j                  t        j                        }|s,t
        j                  d|j                  |j                         a| f yw)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_distributionsd  sp     ,,. 	D
 "$<##mm"
 &;''MM
 J#	s   A9A;TFc                    | j                         }|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                   s|  y wr$   )r   r   ds     r)   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s     +177!+   c              3  :   K   | ]  }|j                   r|  y wr$   r   r  s     r)   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s     2qzz!2r  c              3  :   K   | ]  }|j                   s|  y wr$   r  r  s     r)   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s     .1::!.r  c              3  :   K   | ]  }|j                   s|  y wr$   )r   r  s     r)   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s     11==!1r  c              3  @   K   | ]  }|j                   vs|  y wr$   )r|   )r   r  skips     r)   r   z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>  s     >a!1!1!=>s   )r  )r(   
local_onlyr  include_editableseditables_only	user_onlyits     `    r)   iter_installed_distributionsz,BaseEnvironment.iter_installed_distributionsy  sR    0 ((*+R+B 2R2B.R.B1R1B>2>>r,   N)r2   r   )r   zlist[str] | Noner2   r   )r*   r3   r2   zBaseDistribution | None)r2   Iterator[BaseDistribution])r  r   r  zContainer[str]r  r   r  r   r  r   r2   r  )r4   r5   r6   __doc__r   r   r  r  r  r  stdlib_pkgsr  r8   r,   r)   r   r   H  s    @$ $ $ $$$.  *"&$!?!? !?  	!?
 !? !? 
$!?r,   r   c                       e Zd ZU ded<   ddZy)r   r3   r]   c                    t               r$   r%   r'   s    r)   
as_zipfilezWheel.as_zipfile  r   r,   Nr2   zzipfile.ZipFile)r4   r5   r6   rG   r$  r8   r,   r)   r   r     s    M$r,   r   c                      e Zd ZddZddZy)FilesystemWheelc                    || _         y r$   )r]   rr   s     r)   __init__zFilesystemWheel.__init__  s	     r,   c                D    t        j                  | j                  d      S NT)
allowZip64)zipfileZipFiler]   r'   s    r)   r$  zFilesystemWheel.as_zipfile  s    t}}>>r,   N)r]   r3   r2   r   r%  r4   r5   r6   r)  r$  r8   r,   r)   r'  r'    s    !?r,   r'  c                      e Zd ZddZddZy)MemoryWheelc                     || _         || _        y r$   )r]   stream)r(   r]   r3  s      r)   r)  zMemoryWheel.__init__  s     r,   c                D    t        j                  | j                  d      S r+  )r-  r.  r3  r'   s    r)   r$  zMemoryWheel.as_zipfile  s    t{{t<<r,   N)r]   r3   r3  z	IO[bytes]r2   r   r%  r/  r8   r,   r)   r1  r1    s    =r,   r1  )r?   tuple[str, ...]r@   r5  r2   r3   )@
__future__r   r   email.messageemailr   r   loggingr=   r  r-  collections.abcr   r   r   r   typingr   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.egg_linkr   pip._internal.utils.miscr   r   pip._internal.utils.urlsr   _jsonr   r!  r3   PurePathr   	getLoggerr4   r   r"   rA   rC   rI   r   r   r'  r1  r8   r,   r)   <module>rI     s    " 
      	  E E  ; K I 1 6 < 
 E = 0  0 !!!			8	$$X $,,
, 	,<J a3x a3HR? R?j$H $?e ?=% =r,   