+
     h  c                   s   ^ RI t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	H
t
HtHtHt ^ RIHtHtHtHt ^ RIHtHt ^ RIHt ^RIHtHtHtHt ^RIHt ]P>                  ! ] 4      t!R R	 lt" ! R
 R4      t# ! R R]4      t$R# )i    N)IteratorListOptionalSequenceSetTuple)InvalidWheelFilenameNormalizedNamecanonicalize_nameparse_wheel_filename)BaseDistributionBaseEnvironment)WHEEL_EXTENSION)BadMetadataBasePathget_dist_canonical_nameget_info_location)Distributionc                s0    V ^8  d   QhR\         R\        /#    locationreturn)strZbool)formats   "K/usr/lib/python3.14/site-packages/pip/_internal/metadata/importlib/_envs.py__annotate__r      s     	( 	( 	( 	(    c                 s,   V P                  \        4      '       g   R # \        P                  P	                  V 4      '       g   R #  \        \        P                  P                  V 4      4       \        P                  ! T 4      #   \         d     R # i ; i)F)
Zendswithr   ospathZisfiler	   Zbasenamer   zipfileZ
is_zipfile)r      &r   _looks_like_wheelr      so    _--77>>(##RWW--h78 h''   s   (B BBc                   s   a  ] tR t^%t o Rt]]P                  P                  ]	]
,          3,          tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltR
tV tR# )_DistributionFindera  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.
c                s   < V ^8  d   QhRR/# )r   r   N r   __classdict__   "r   r    _DistributionFinder.__annotate__4   s     7 7$ 7r   c                s$    \        4       V n        R # N)Zset_found_names)selfr   r   __init__Z_DistributionFinder.__init__4   s    14r   c                6   < V ^8  d   QhRS[ RS[S[,          /# r   )r   r    FoundResultr"   r$   r   r   r%   7   s      & &3 &8K+@ &r   c              #  s  "   \        V4      '       d   R# \        P                  P                  V.R7       FL  p\	        V4      p \        V4      pY@P                  9   d   K,  T P                  P                  T4       Y#3x  KN  	  R#   \         d,   p\        P                  RY5P                  4        Rp?K  Rp?ii ; i5i)z!Find distributions in a location.N)r   zSkipping %s due to %s)r   	importlibmetadataZdistributionsr   r   r   loggerZwarningZreasonr'   Zadd)r(   r   distinfo_locationnameZes   &&    r   
_find_implZ_DistributionFinder._find_impl7   s     
 X&& &&448*4ED-d3M.t4 (((!!$'%% F  6xxPs0   ACB	8C	B? B:4C:B??Cc                r*   r   r   r    r
   r"   r$   r   r   r%   L   s%     
H 
HS 
HX.>%? 
Hr   c              #  s   "   V P                  V4       F&  w  r#Vf   RpMVP                  p\        W#V4      x  K(  	  R# 5i)zYFind distributions in a location.

The path can be either a directory, or a ZIP archive.
N)r2   Zparentr   )r(   r   r/   r0   Zinstalled_locations   &&   r   findZ_DistributionFinder.findL   sC     
 $(??8#<D$9="%2%9%9"t4FGG $=s   >A c                r*   r   r3   r"   r$   r   r   r%   X   s!     > >c >h?O6P >r   c              #  s  "   \         P                  ! V4      pVP                  4       '       g   R# VP                  4        F  pVP                  R8w  d   K  VP                  4       ;_uu_ 4       pR V 4       p\        R V 4       R4      pRRR4       X'       g   K]  \        VP                  V4      4      pV P                  V4       F  w  r\        WV4      x  K  	  K  	  R#   + '       g   i     Lb; i5i)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   s@   "   T F  qP                  4       x  K  	  R # 5ir&   )Zstrip.0Zline   & r   	<genexpr><_DistributionFinder.find_legacy_editables.<locals>.<genexpr>h   s     4!$!s   c              3   s8   "   T F  q'       g   K  Vx  K  	  R # 5ir&   r!   r5   r7   r   r8   r9   i   s     "BEDT44Es   	
Z )pathlibZPathZis_dirZiterdirZsuffixZopennextr   Zjoinpathr2   r   )
r(   r   r   ZchildZfZlinesZ
target_relZtarget_locationr/   r0   s
   &&        r   find_legacy_editablesZ)_DistributionFinder.find_legacy_editablesX   s      ||H%{{}}\\^E||{*4!4!"BE"BBG
  !$--
";<O'+'G#"4== (H $ s%   A-C9/C&C9A
C9&C61C9)r'   N)__name__
__module____qualname____firstlineno__Z__doc__r   r,   r-   r   r   r   r+   r)   r2   r4   r<   __static_attributes____classdictcell__r#      @r   r    r    %   sV     
 	**77(9KKLK7 7& &*
H 
H> >r   r    c                   s   a  ] tR t^qt o V 3R lR lt]V 3R lR l4       t]V 3R lR l4       tV 3R lR ltV 3R	 lR
 lt	Rt
V tR# )Environmentc                s4   < V ^8  d   QhRS[ S[,          RR/# )r   pathsr   N)r   r   r"   r$   r   r   Environment.__annotate__r   s      hsm  r   c                s    Wn         R # r&   _paths)r(   rF      &&r   r)   ZEnvironment.__init__r   s    r   c                s    < V ^8  d   QhRS[ /# r   r   )r   r"   r$   r   r   rG   v   s       r   c                s.    V ! \         P                  4      # r&   sysr   )clsr   r   defaultZEnvironment.defaultu   s    388}r   c                sF   < V ^8  d   QhRS[ S[S[,          ,          RS[/# )r   rF   r   )r   r   r   r   r"   r$   r   r   rG   z   s$      xS	2  r   c                sF    Vf   V ! \         P                  4      # V ! V4      # r&   rL   )rN   rF   rJ   r   
from_pathsZEnvironment.from_pathsy   s    =sxx= 5zr   c                s0   < V ^8  d   QhRS[ S[,          /# rK   )r    r
   r"   r$   r   r   rG      s     > >X.>%? >r   c              #  s   "   \        4       pV P                   F5  pVP                  V4       R j  xL
  VP                  V4       R j  xL
  K7  	  R #  L# L5ir&   )r    rI   r4   r<   )r(   Zfinderr   s   &  r   _iter_distributionsZEnvironment._iter_distributions   sG     $&H{{8,,,33H=== $,=s!   .AAA	A
AAc                r*   )r   r1   r   )r   r   r
   r"   r$   r   r   rG      s!     # #S #X6F-G #r   c                sf   a \        V4      oV3R  lV P                  4        4       p\        VR4      # )c              3   sN   <"   T F  pVP                   S8X  g   K  Vx  K  	  R # 5ir&   )canonical_name)r6   ZdistributionrR   s   & r   r8   Z/Environment.get_distribution.<locals>.<genexpr>   s(      
 =**n< L =s   %
%N)r   Ziter_all_distributionsr;   )r(   r1   ZmatchesrR   s   && @r   get_distributionZEnvironment.get_distribution   s4    *40
 $ ; ; =

 GT""r   rH   N)r=   r>   r?   r@   r)   ZclassmethodrO   rP   rQ   rS   rA   rB   rC   rD   r   rE   rE   q   sK          
> ># #r   rE   )%Zimportlib.metadatar,   Zloggingr   r:   rM   r   Ztypingr    r   r   r   r   r   Zpip._vendor.packaging.utilsr   r   r   r	   Zpip._internal.metadata.baser
   r   Zpip._internal.utils.filetypesr   Z_compatr   r   r   r   Z_distsr   Z	getLoggerr=   r.   r   r    rE   r!   r   r   <module>rT      sg      	  
  A A  J 9 V V  			8	$	(I> I>X#/ #r   