
    $Ȃi                     j   S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	J
r
JrJrJrJrJr  S SKJrJr  S SKJrJr  S SKJr  S SKJr  S SKJr  SS	KJrJrJrJ r   SS
K!J"r"  \RF                  " \$5      r%S\&S\'4S jr( " S S5      r)\ RT                  " SS9S\\&   SS4S j5       r+ " S S\5      r,g)    N)IteratorListOptionalSequenceSetTuple)NormalizedNamecanonicalize_name)BaseDistributionBaseEnvironment)Wheel
deprecated)WHEEL_EXTENSION   )BadMetadataBasePathget_dist_canonical_nameget_info_location)Distributionlocationreturnc                 2   U R                  [        5      (       d  g[        R                  R	                  U 5      (       d  g[
        R                  R                  [        R                  R                  U 5      5      (       d  g[        R                  " U 5      $ )NF)endswithr   ospathisfiler   wheel_file_rematchbasenamezipfile
is_zipfiler   s    WD:\sksbv-state-backend\venv\Lib\site-packages\pip/_internal/metadata/importlib/_envs.py_looks_like_wheelr%      sf    _--77>>(##$$RWW%5%5h%?@@h''    c                       \ rS rSrSr\\R                  R                  \	\
   4   rSS jrS\S\\   4S jrS\S\\   4S jrS\S\\   4S	 jrS\S\\   4S
 jrS\S\\   4S jrS\S\\   4S jrSrg)_DistributionFinder"   a  Finder to locate distributions.

The main purpose of this class is to memoize found distributions' names, so
only one distribution is returned for each package name. At lot of pip code
assumes this (because it is setuptools's behavior), and not doing the same
can potentially cause a distribution in lower precedence path to override a
higher precedence one if the caller is not careful.

Eventually we probably want to make it possible to see lower precedence
installations as well. It's useful feature, after all.
r   Nc                 "    [        5       U l        g N)set_found_names)selfs    r$   __init___DistributionFinder.__init__1   s    14r&   r   c              #   x  #    [        U5      (       a  g[        R                  R                  U/S9 HK  n[	        U5      n [        U5      nX@R                  ;   a  M+  U R                  R                  U5        X#4v   MM     g! [         a+  n[        R                  SX5R                  5         SnAM  SnAff = f7f)z!Find distributions in a location.N)r   zSkipping %s due to %s)r%   	importlibmetadatadistributionsr   r   r   loggerwarningreasonr-   add)r.   r   distinfo_locationnamees         r$   
_find_impl_DistributionFinder._find_impl4   s     
 X&& &&448*4ED-d3M.t4 (((!!$'%% F  6xxPs/   >B:B6B:
B7 B2,B:2B77B:c              #      #    U R                  U5       H%  u  p#Uc  SnOUR                  n[        X#U5      v   M'     g7f)zYFind distributions in a location.

The path can be either a directory, or a ZIP archive.
N)r=   parentr   )r.   r   r9   r:   installed_locations        r$   find_DistributionFinder.findI   sC     
 $(??8#<D$9="%2%9%9"t4FGG $=s   <>c              #     #    [         R                  " U5      nUR                  5       (       d  gUR                  5        H  nUR                  S:w  a  M  UR                  5        nS U 5       n[        S U 5       S5      nSSS5        W(       d  MS  [        UR                  U5      5      nU R                  U5       H  u  p[        XU5      v   M     M     g! , (       d  f       N^= f7f)av  Read location in egg-link files and return distributions in there.

The path should be a directory; otherwise this returns nothing. This
follows how setuptools does this for compatibility. The first non-empty
line in the egg-link is read as a path (resolved against the egg-link's
containing directory if relative). Distributions found at that linked
location are returned.
Nz	.egg-linkc              3   >   #    U H  oR                  5       v   M     g 7fr+   )strip.0lines     r$   	<genexpr>2_DistributionFinder.find_linked.<locals>.<genexpr>e   s     4!$!s   c              3   4   #    U H  o(       d  M  Uv   M     g 7fr+    rG   s     r$   rJ   rK   f   s     "BEDT44Es   		 )pathlibPathis_diriterdirsuffixopennextstrjoinpathr=   r   )
r.   r   r   childflines
target_reltarget_locationr9   r:   s
             r$   find_linked_DistributionFinder.find_linkedU   s      ||H%{{}}\\^E||{*4!4!"BE"BBG
  !$--
";<O'+'G#"4== (H $ s   A"C*$CAC*
C'	#C*c              #   2  #    SSK Jn  SSKJn  [        R
                  " U5       nU HQ  nUR                  R                  S5      (       d  M%  U" UR                  5       H  nUR                  U5      v   M     MS     S S S 5        g ! , (       d  f       g = f7f)Nr   )find_distributionspkg_resourcesz.egg)
pip._vendor.pkg_resourcesr`   pip._internal.metadatarb   r   scandirr;   r   r   r   )r.   r   r`   legacyitentryr9   s          r$   _find_eggs_in_dir%_DistributionFinder._find_eggs_in_dirm   sj     @BZZ!Rzz**622.uzz:D --d33 ;  "!!s   #BAB=	B
BBc              #      #    SSK Jn  SSKJn   [        R
                  " U5      nU" XA5       H  nUR                  U5      v   M     g ! [        R                   a     g f = f7f)Nr   )find_eggs_in_zipra   )rc   rl   rd   rb   	zipimportzipimporterZipImportErrorr   )r.   r   rl   rf   importerr9   s         r$   _find_eggs_in_zip%_DistributionFinder._find_eggs_in_zipy   s[     >B	 ,,X6H %X8D%%d++ 9 '' 		s'   A#A	 #A#	A A#A  A#c              #      #    [         R                  R                  U5      (       a  U R                  U5       Sh  vN   [        R
                  " U5      (       a  U R                  U5       Sh  vN   gg N: N7f)a]  Find eggs in a location.

This actually uses the old *pkg_resources* backend. We likely want to
deprecate this so we can eventually remove the *pkg_resources*
dependency entirely. Before that, this should first emit a deprecation
warning for some versions when using the fallback since importing
*pkg_resources* is slow for those who don't need it.
N)r   r   isdirri   r!   r"   rq   )r.   r   s     r$   	find_eggs_DistributionFinder.find_eggs   s`      77==""--h777h''--h777 ( 87s!   9A:A63A:/A80A:8A:)r-   )r   N)__name__
__module____qualname____firstlineno____doc__r   r2   r3   r   r   r   FoundResultr/   rV   r   r=   r   rB   r]   ri   rq   ru   __static_attributes__rM   r&   r$   r(   r(   "   s    
 	**77(9KKLK7&3 &8K+@ &*
HS 
HX.>%? 
H>C >H5E,F >0
4# 
4(;K2L 
4
,# 
,(;K2L 
,8# 8(3C*D 8r&   r(   )maxsizec                 $    [        SU  S3SSSS9  g )NzLoading egg at z is deprecated.z#to use pip for package installationz24.3i*0  )r7   replacementgone_inissuer   r#   s    r$   _emit_egg_deprecationr      s     
/:9	r&   c                       \ rS rSrS\\   SS4S jr\S\4S j5       r	\S\
\\      S\4S j5       rS\\   4S jrS	\S\
\   4S
 jrSrg)Environment   pathsr   Nc                     Xl         g r+   _paths)r.   r   s     r$   r/   Environment.__init__   s    r&   c                 .    U " [         R                  5      $ r+   sysr   )clss    r$   defaultEnvironment.default   s    388}r&   c                 D    Uc  U " [         R                  5      $ U " U5      $ r+   r   )r   r   s     r$   
from_pathsEnvironment.from_paths   s    =sxx= 5zr&   c              #     #    [        5       nU R                   Hf  nUR                  U5       S h  vN   UR                  U5       H  n[	        UR
                  5        Uv   M     UR                  U5       S h  vN   Mh     g  NS N7fr+   )r(   r   rB   ru   r   r   r]   )r.   finderr   r9   s       r$   _iter_distributionsEnvironment._iter_distributions   sq     $&H{{8,,,((2%dmm4
 3 ))(333 $,
 4s"   .BBA	B:B;
BBr;   c                 f   ^ [        U5      mU4S jU R                  5        5       n[        US 5      $ )Nc              3   J   >#    U H  nUR                   T:X  d  M  Uv   M     g 7fr+   )canonical_name)rH   distributionr   s     r$   rJ   /Environment.get_distribution.<locals>.<genexpr>   s(      
 =**n< L =s   #	#)r
   iter_all_distributionsrU   )r.   r;   matchesr   s      @r$   get_distributionEnvironment.get_distribution   s4    *40
 $ ; ; =

 GT""r&   r   )rw   rx   ry   rz   r   rV   r/   classmethodr   r   r   r   r   r   r   r   r   r}   rM   r&   r$   r   r      s    hsm      xS	2   
4X.>%? 4#S #X6F-G #r&   r   )-	functoolsimportlib.metadatar2   loggingr   rO   r   r!   rm   typingr   r   r   r   r   r   pip._vendor.packaging.utilsr	   r
   pip._internal.metadata.baser   r   pip._internal.models.wheelr   pip._internal.utils.deprecationr   pip._internal.utils.filetypesr   _compatr   r   r   r   _distsr   	getLoggerrw   r5   rV   boolr%   r(   	lru_cacher   r   rM   r&   r$   <module>r      s       	  
   A A I I , 6 9 V V  			8	$( ( (o8 o8d T"HSM d  ##/ #r&   