+
    WGj"                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIt^ RIHt ^ RIHtHtHtHtHt ^ RIHt ]P,                  R8H  t]P0                  ! ]4      tR R ltR	 R
 ltR R ltR2R R lltR R ltR R lt Rt!R3t"R4t#R]!3t$R5t%]$]",           ]%,           ]#,           t&R R lt'R R lt(]PR                  ! ^R7      R R l4       t*]PR                  ! ^R7      R R l4       t+R R lt,R  R! lt-R" R# lt.]! R$4      t/ ! R% R&]]/,          4      t0]Pb                  ! R'4      t2]PR                  R( R) l4       t3R* 3R+ R, llt4R- R. lt5R/s6R0 R1 lt7R# )6z3A package should contain a link to the actual file.)annotationsN)Path)CallableIterableIteratorSequenceTypeVar)url2pathnamewin32c                    V ^8  d   QhRRRR/# )   querystrreturnzdict[str, str] )formats   "-lib/python3.14/site-packages/unearth/utils.py__annotate__r      s     ? ?s ?~ ?    c                    \         P                  ! V 4      P                  4        UUu/ uF  w  rW^ ,          bK  	  upp# u uppi )z Parse the query string of a url.)parseparse_qsitems)r   kvs   &  r   parse_queryr      s6     %u 5 ; ; => =AtG =>>>s   A c                    V ^8  d   QhRRRR/# )r   urir   r   r   )r   s   "r   r   r      s     
 
3 
3 
r   c                   RV 9  d   RV ,           p \         P                  ! V 4      pRVP                  9   dV   VP                  P                  R4      w  r#pRV VP                   2p\         P
                  ! VP                  W%R7      4      p V # )zCleans VCS uris from pip format://zssh://:/)netlocpath)r   urlparser"   
rpartitionr#   
urlunparse_replace)r   parsedr"   _
path_startr#   s   &     r   add_ssh_scheme_to_git_urir+      s|     Cn$&--$*MM$<$<S$A!Fzzl6;;-0D""6??&?#LMCJr   c                    V ^8  d   QhRRRR/# )r   namer   r   r   )r   s   "r   r   r   '   s     ! !s !s !r   c                4    V P                  R^4      ^ ,          # )z-Strip the extras part following package name.[)split)r-   s   &r   strip_extrasr1   '   s    ::c1a  r   c               $    V ^8  d   QhRRRRRR/# )r   r"   r   schemer   r   )r   s   "r   r   r   ,   s!     " "# "s " "r   c                d    V P                  R4      ^8  d   RV 9  d   RV 9  d   RV  R2p V RV  2# )z!
Build a full URL from a netloc.
r    @r/   ]r   )count)r"   r3   s   &&r   build_url_from_netlocr8   ,   sA     ||CA#V"368IVHAXS!!r   c                    V ^8  d   QhRRRR/# )r   r"   r   r   ztuple[str, int | None]r   )r   s   "r   r   r   6   s     . . .!7 .r   c                    \        V 4      p\        P                  ! V4      pVP                  ;'       g    RVP                  3# )z*
Return the host-port pair from a netloc.
 )r8   r   r$   hostnameport)r"   urlr(   s   &  r   parse_netlocr?   6   s7      
'C^^C F??  b&++--r   c                    V ^8  d   QhRRRR/# )r   r>   r   r   r   r   )r   s   "r   r   r   ?   s     $ $S $T $r   c                   V P                  R4      '       g   Q RV : R24       h\        P                  ! V 4      w  rp pV'       d   VR8X  d   RpM%\        '       d   RV,           pM\	        RV : 24      h\        W#,           4      p\        '       d[   V'       gS   \        V4      ^8  dC   V^ ,          R8X  d5   V^,          P                  4       '       d   VR	,          R9   d
   VR
,          p\        V4      # )z 
Convert a file: URL to a path.
zfile:z1You can only turn file: urls into filenames (not )	localhostr;   z\\z8non-local file URIs are not supported on this platform: r!   :r      N:   NN)r    z:/)	
startswithr   urlsplitWINDOWS
ValueErrorr	   lenisalphar   )r>   r)   r"   r#   s   &   r   url_to_pathrL   ?   s     >>'"" 
;C7!D" "NN3/AtQV{*	&FsgN
 	
 &D 	INGsNGOOI$Bx:r   z.whlz.zipc                    V ^8  d   QhRRRR/# )r   r-   r   r   boolr   )r   s   "r   r   r   t   s     % %# %$ %r   c                T    \        V 4      ^,          P                  4       pV\        9   # )z9Return True if `name` is a considered as an archive file.)splitextlowerARCHIVE_EXTENSIONS)r-   exts   & r   is_archive_filerT   t   s%    
4.

!
!
#C$$$r   c                    V ^8  d   QhRRRR/# )r   r"   r   r   )tuple[tuple[str, str | None] | None, str]r   )r   s   "r   r   r   z   s     V V3 V+T Vr   c                    V P                  R 4      w  rpV'       g   RV3# VP                  R4      w  rEp\        P                  ! V4      V'       d   \        P                  ! V4      3V3# R3V3# )r5   Nr    )r%   	partitionr   unquote)r"   authhas_authhostuserhas_passpasswords   &      r   split_auth_from_netlocr`   z   sj    !,,S1DDTz#~~c2DHMM$Hx!8OQUUU$OQUUUr   )maxsizec                    V ^8  d   QhRRRR/# )r   r>   r   r   rV   r   )r   s   "r   r   r      s     B BS B%N Br   c                    \         P                  ! V 4      p\        VP                  4      w  r#Vf   RV 3# V\         P                  ! VP                  VR7      4      3# )z:Return a tuple of ((username, password), url_without_auth)N)r"   )r   r$   r`   r"   r&   r'   )r>   r(   rZ   r"   s   &   r   split_auth_from_urlrd      sR     ^^C F)&--8LD|Sy!!&///"@AAAr   c               $    V ^8  d   QhRRRRRR/# )r   leftr   rightr   rN   r   )r   s   "r   r   r      s&     O Os O3 O4 Or   c                    \         P                  ! V 4      P                  R4      \         P                  ! V4      P                  R4      8H  # )z.
Compare two urls, ignoring the ending slash.
r!   )r   rY   rstrip)rf   rg   s   &&r   compare_urlsrj      s7    
 ==%%c*emmE.B.I.I#.NNNr   c                    V ^8  d   QhRRRR/# )r   r#   r   r   r   r   )r   s   "r   r   r      s     	 	t 	 	r   c                    V P                  4       '       g   \        V 4      #  V P                  4       P                  \        P
                  ! 4       4      p\        V4      #   \         d    \        T 4      u # i ; i)z)Show the path relative to cwd if possible)is_absoluter   absoluterelative_tor   cwdrI   )r#   relatives   & r   display_pathrr      sc    4y==?..txxz: 8}  4ys   2A   A98A9c                    V ^8  d   QhRRRR/# )r   r#   r   r   ztuple[str, str]r   )r   s   "r   r   r      s      3 ? r   c                    \         P                  P                  V 4      w  rVP                  4       P	                  R4      '       d   VRR V,           pVRR pW3# )z6Like os.path.splitext but also takes off the .tar part.tarN)osr#   rP   rQ   endswith)r#   baserS   s   &  r   rP   rP      sQ      &IDzz|V$$23i#oCRy9r   c                    V ^8  d   QhRRRR/# )r   sizer   r   r   )r   s   "r   r   r      s     ( (c (c (r   c                     \        V 4      pTR8  d   TR,          R,          R R2# TR8  d   \        TR,          4       R2# TR8  d   TR,          R R2# \        T4       R2#   \        \        3 d     R # i ; i)	zsize unknowni  g     @@z.1fz MBz kBz bytesi@B i'  )int	TypeErrorrI   )r{   int_sizes   & r   format_sizer      s    t9 +V#d*3/s33	I	ho&'s++	DV#C(,,h-'' z" s   A& &A;:A;Tc                  V    ] tR t^tRtR R ltR R ltR R ltR R	 ltR
 R lt	Rt
R# )LazySequencez$A sequence that is lazily evaluated.c                    V ^8  d   QhRRRR/# )r   dataIterable[T]r   Noner   )r   s   "r   r   LazySequence.__annotate__   s      [ T r   c                	    Wn         R # N_inner)selfr   s   &&r   __init__LazySequence.__init__   s    r   c                   V ^8  d   QhRR/# )r   r   Iterator[T]r   )r   s   "r   r   r      s      + r   c                	V    \         P                  ! V P                  4      w  V n        pV# r   )	itertoolsteer   )r   thiss   & r   __iter__LazySequence.__iter__   s     %MM$++6Tr   c                   V ^8  d   QhRR/# )r   r   r}   r   )r   s   "r   r   r      s       r   c                	.    ^ pV  F  pV^,          pK  	  V# )    r   )r   ir)   s   &  r   __len__LazySequence.__len__   s    AFA r   c                   V ^8  d   QhRR/# )r   r   rN   r   )r   s   "r   r   r      s      $ r   c                	    V  F  p R # 	  R# )TFr   )r   r)   s   & r   __bool__LazySequence.__bool__   s    A r   c                    V ^8  d   QhRRRR/# )r   indexr}   r   r   r   )r   s   "r   r   r      s     / / / /r   c                	x    V^ 8  d   \        R4      h\        V 4       F  w  r#W!8X  g   K  Vu # 	  \        R4      h)r   z"Negative indices are not supportedzIndex out of range)
IndexError	enumerate)r   r   r   items   &&  r   __getitem__LazySequence.__getitem__   s=    19ABB GAz ' -..r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   __static_attributes__r   r   r   r   r      s#    .
/ /r   r   z!(==|!=|<=|>=|<|>)(\s*)([^,;\s)]*)c                    V ^8  d   QhRRRR/# )r   	specifierr   r   r   )r   s   "r   r   r      s     = =C =C =r   c                8    R R lp\         P                  W4      # )zzSince packaging 22.0, legacy specifiers like '>=4.*' are no longer
supported. We try to normalize them to the new format.
c                    V ^8  d   QhRRRR/# )r   matchzre.Match[str]r   r   r   )r   s   "r   r   *fix_legacy_specifier.<locals>.__annotate__   s     & &M &c &r   c                p   V P                  4       w  rpVR	9   d   V P                  ^ 4      # RV9   dD   \        P                  ! R\        ^R7       VP                  RR4      pVR
9   d   RpMFVR9   d   RpM<RV9   d6   \        P                  ! R\        ^R7       VP                  R4      ^ ,          pV V 2# )==z.*z6.* suffix can only be used with `==` or `!=` operators)
stacklevelz.0<>=+z@Local version label can only be used with `==` or `!=` operators)r   z!=)r   z<=)>r   )groupsgroupwarningswarnFutureWarningreplacer0   )r   operatorr)   versions   &   r   fix_wildcard*fix_legacy_specifier.<locals>.fix_wildcard   s    $||~W|#;;q>!7?MMH
 oodD1G;&[(G^MMR
 mmC(+GG9%%r   )_legacy_specifier_resub)r   r   s   & r   fix_legacy_specifierr      s    &0  ##L<<r   c                    ^# )rE   r   )r)   s   &r   <lambda>r      s    Ar   c               (    V ^8  d   QhRRRRRRRR/# )	r   iterabler   callbackzCallable[[int], None]stepperzCallable[[T], int]r   r   r   )r   s   "r   r   r      s0         #     	 r   c              #     "   ^ pV  F  p Vx  W2! V4      ,          pV! V4       K   	  R#   Y2! T4      ,          pT! T4       i ; i5i)r   Nr   )r   r   r   	completedr   s   &&&  r   iter_with_callbackr      sO     
 I	 J&IY  &IYs   A+AAAc                    V ^8  d   QhRRRR/# )r   mr   r   r   )r   s   "r   r   r     s     
 
S 
S 
r   c                     V '       g   R# \        \        \        P                  V 4      4      p \	        V 4      p\        V 4      p\        V4       F  w  r4WBV,          8w  g   K  VRV u # 	  V# )zFGiven multiple pathnames, returns the longest common leading componentr;   N)tuplemaprw   fspathminmaxr   )r   s1s2r   cs   *    r   commonprefixr     sZ    c"))Q A	QB	QB"1:bq6M  Ir   Fc                    V ^8  d   QhRRRR/# )r   r>   r   r   ztuple[str, str] | Noner   )r   s   "r   r   r     s        6 r   c                    ^ RI HpH p ^ RIHp T! T 4      P
                  p T! \        P                  ! R4      4      pTP                  T4      pTf   R# T^ ,          T^,          3#   \         d     R# i ; i  \         d     R# T\        3 dD   p\        '       g-   \        P                  R\        T4      P                  T4       Rs
 Rp?R# Rp?ii ; i)z3Get the auth for the given url from the netrc file.)NetrcParseErrornetrcN)URLNETRCz&Couldn't parse netrc because of %s: %sT)r   r   ImportErrorhttpxr   r\   rw   getenvFileNotFoundErrorOSError_netrc_warnedloggerwarningtyper   authenticators)r>   r   r   r   r<   authenticatoreinfos   &       r   get_netrc_authr     s    0 3x}}H
bii01 ''1D|7DG-    W% }NN8$q':J:JA !Ms4   A( A: (A76A7:C
CC8CC)https)z.tar.bz2z.tbz)z.tar.xzz.txzz.tlzz.tar.lzz	.tar.lzma)z.tar.gzz.tgzru   )8r   
__future__r   	functoolsr   loggingrw   resysurllib.parser   r   pathlibr   typingr   r   r   r   r   urllib.requestr	   platformrH   	getLoggerr   r   r   r+   r1   r8   r?   rL   WHEEL_EXTENSIONBZ2_EXTENSIONSXZ_EXTENSIONSZIP_EXTENSIONSTAR_EXTENSIONSrR   rT   r`   	lru_cacherd   rj   rr   rP   r   r   r   compiler   r   r   r   r   r   r   r   r   <module>r     sd   9 "    	 	 
    B B '
,,'
!			8	$?

!
".$N % /*,#n4~EU %V S!B "B S!O "O	( CL/8A; /< zz"FG  = =F #. 
 r   