+
     hk  c                  s   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
t
^ RIt^ RIt^ RI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Ht ^ RIHt ^ RIHt ^ RIt^ RIHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t, ^ RI-H.t. ^R	I/H0t0H1t1 ^ R
I2H3t3 ^ RI4H5t5 ]Pl                  ! R4      t7]Pl                  ! R]Pp                  4      t9]Pl                  ! R4      t:]Pl                  ! R]Pp                  4      Pv                  t<RP{                  4       t>. R1Ot?^t@R]P                   R]P                  P                   R]P                  P                   2tER tFR tGR tHR2R ltIR2R ltJR2R ltKR]#R3R ltLR tM]Pl                  ! R]Pp                  4      tN ]MR 4       tO ! R R 4      tP ! R! R"]P4      tQ ! R# R]%4      tR]Pl                  ! R$4      P                  tTR% tUR& tVR3R' ltWR( tX ! R) R*]4      tY ! R+ R,]P                  4      t[]P                  P                  3R- lt^R. t_]W! ]@4      ! ]^4      t^R/ t`R0 taR# )4z$PyPI and direct package downloading.)annotationsN)	translatewraps)
NamedTupleunique_everseen)BINARY_DISTCHECKOUT_DISTDEVELOP_DISTEGG_DISTSOURCE_DISTDistributionEnvironmentRequirementfind_distributionsnormalize_pathparse_version	safe_namesafe_versionto_filename)Wheel)_cfg_read_utf8_with_fallback_read_utf8_with_fallback)log)DistutilsErrorz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z<a href="([^"#]+)">([^<]+)</a>\n\s+\(<a (?:title="MD5 hash"\n\s+)href="[^?]+\?:action=show_md5&amp;digest=([0-9a-f]{32})">md5</a>\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgzPackageIndexzsetuptools/z Python-urllib/Z.c                sv     \         P                  ! V 4      #   \         d   p\        R T : 24      ThRp?ii ; i)z/Not a URL, existing file, or requirement spec: N)r   parse
ValueErrorr   )specZe   & =/usr/lib/python3.14/site-packages/setuptools/package_index.pyparse_requirement_argr    H   sB      && =dXF
	s    838c                sp   V P                  4       pRRRrCpVP                  R4      '       d   VP                  R4      '       d	   V RR	 pRpMhVP                  RR
4      '       d   V RR pV RR
 pRpMCVP                  R4      '       d	   V RR pRpM$VP                  RR4      '       d   V RR pV RR pRpW#V3# )z=Return (base,pyversion) or (None,None) for possible .exe nameN.exez
.win32.exeZwin32z	.win32-pyz.win-amd64.exez	win-amd64z.win-amd64-pyiiiii)lowerendswith
startswith)namer#   basepy_verZplat   &    r   parse_bdist_wininstr*   Q   s     JJLEtT$D~~f>>,'':DDk3//"R[F:DD^^,--:DDos33"R[F:DD    c                sx   \         P                  P                  V 4      pVw  r#rErg\         P                  P                  VP	                  R 4      R,          4      pVR8X  d=   VR8X  d6   \         P                  P                  VP	                  R 4      R,          4      pRV9   d   VP	                  R^4      w  rW3# )/zsourceforge.netdownload#i)urllibr   urlparseunquotesplit)	urlparts_schemeZserverpathZ_parameters_queryfragmentr'   s	   &        r   egg_info_for_urlr:   i   s    LL!!#&E;@8GT<<

3 34D""tz'9||##DJJsOB$78
d{C+>r+   c              #  s   "   \        V 4      w  r#\        WV4       Rj  xL
  V'       dK   \        P                  V4      pV'       d,   \	        WP                  ^4      V\        R7       Rj  xL
  R# R# R#  LX L5i)zEYield egg or source distribution objects that might be found at a URLN)
precedence)r:   distros_for_locationEGG_FRAGMENTmatchinterpret_distro_namegroupr   )r4   metadatar'   r9   r>   s   &&   r   distros_for_urlrB   t   sl     %c*ND#Cx888""8,,[[^X-     9s,   A<A8A<A<	$A<-A:.A<:A<c                s   VP                  R4      '       d   VRR pVP                  R4      '       d    RV9   d   \        P                  ! WV4      .# VP                  R4      '       dZ   RV9   dS   \        V4      pVP	                  4       '       g   . # \        V VP
                  VP                  \        ^,           R7      .# VP                  R4      '       d%   \        V4      w  rEpVe   \        WW%\        V4      # \         F7  pVP                  V4      '       g   K  VR\        V4      )  p\        WV4      u # 	  . # )	z:Yield egg or source distribution objects based on basenamez.egg.zipN.egg-z.whl)locationproject_nameversionr;   r!   r"   )r$   r   Zfrom_locationr   Zis_compatiblerF   rG   r
   r*   r?   r   
EXTENSIONSlen)rE   basenamerA   ZwheelZwin_baser(   platformZext   &&&     r   r<   r<      s,   $$CR=  SH_**8xHII  SH_h""$$I!"//#a<
 	
   %8%B"((Hk8 
 S!!3s8),H(XFF  Ir+   c                sh    \        \        V 4      \        P                  P	                  V 4      V4      # )zEYield possible egg or source distribution objects based on a filename)r<   r   osr7   rJ   )filenamerA      &&r   distros_for_filenamerP      s*    x "''"2"28"<h r+   c           
   #  s  "   VP                  R4      pV'       gK   \        ;QJ d#    R VR,           4       F  '       g   K   RM	  RM! R VR,           4       4      '       d   R# \        \        V4      4       F(  pWg,          R,          P	                  4       '       g   K(   M	  \        V4      p\        V VRP                  VRV 4      RP                  WgR 4      VVVR7      x  R# 5i)	zGenerate the interpretation of a source distro name

Note: if `location` is a filesystem filename, you should call
``pkg_resources.normalize_path()`` on it before passing it to this
routine!
rD   c              3  sP   "   T F  p\         P                  ! R V4      x  K  	  R# 5i)z	py\d\.\d$N)rer>   ).0pr   r   	<genexpr>Z(interpret_distro_name.<locals>.<genexpr>   s     KAbhh|Q77s   $&:   NNTFN:N   N)
py_versionr;   rK   )r3   ZanyZrangerI   Zisdigitr   join)rE   rJ   rA   rW   r;   rK   r5   rS   s   &&&&&&  r   r?   r?      s      NN3E##KrK###KrKKK 3u:8B<!!  J
rr s   $C*C*!C*$9C*"AC*c                s0   a  \        S 4      V 3R l4       pV# )zg
Wrap a function returning an iterable such that the resulting iterable
only ever yields unique items.
c                 s&   < \        S! V / VB 4      # Nr   )argskwargsfuncs   *,r   wrapperZunique_values.<locals>.wrapper   s    tT4V455r+   r   )r\   r]      f r   unique_valuesr_      s"     4[6 6 Nr+   z3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>c           
   #  s  "   \         P                  V4       F  pVP                  4       w  r4\        \	        \
        P                  VP                  4       P                  R4      4      4      pRV9   g
   RV9   g   Ke  \        P                  V4       F=  p\        P                  P                  V \        VP                  ^4      4      4      x  K?  	  K  	  R Fv  pVP                  V4      pVR8w  g   K  \        P!                  W4      pV'       g   K<  \        P                  P                  V \        VP                  ^4      4      4      x  Kx  	  R# 5i)zEFind rel="homepage" and rel="download" links in `page`, yielding URLsZ,Zhomepager-   N)z<th>Home Pagez<th>Download URLr/   )RELfinditerZgroupssetmapstrstripr#   r3   HREFr0   r   urljoin
htmldecoder@   findsearch)r4   pager>   ZtagZrelZrelsZposs   &&     r   find_external_linksrl      s      d#<<>3syy#))+"3"3C"89:t!3s+ll**3
5;;q>0JKK ,	 $ 5iin"9KK*Eull**3
5;;q>0JKK 5s   A6E=A4E6EA Ec                  s,    ] tR t^tRtR tR tR tRtR# )ContentCheckerzH
A null content checker that defines the interface for checking content
c                    R# )z#
Feed a block of data to the hash.
N selfblockrO   r   feedZContentChecker.feed   s     	r+   c                rn   )z3
Check the hash. Return False if validation fails.
Tro   rq      &r   is_validZContentChecker.is_valid   s     r+   c                rn   )z]
Call reporter with information about the checker (hash name)
substituted into the template.
Nro   )rq   reportertemplate   &&&r   reportZContentChecker.report  s    
 	r+   ro   N)	__name__
__module____qualname____firstlineno____doc__rs   rv   rz   __static_attributes__ro   r+   r   rm   rm      s    r+   rm   c                  sh    ] tR tRt]P
                  ! R4      tR R lt]R 4       t	R t
R tR tR	tR
# )HashCheckeri  zK(?P<hash_name>sha1|sha224|sha384|sha256|sha512|md5)=(?P<expected>[a-f0-9]+)c                   V ^8  d   QhRR/# rU   returnNonero   format   "r   __annotate__ZHashChecker.__annotate__  s     ! !t !r+   c                	sT    Wn         \        P                  ! V4      V n        W n        R # rY   )	hash_namehashlibZnewhashexpected)rq   r   r   ry   r   __init__ZHashChecker.__init__  s    "KK	*	 r+   c                s    \         P                  P                  V4      R,          pV'       g   \        4       # V P                  P                  V4      pV'       g   \        4       # V ! R/ VP                  4       B # )z5Construct a (possibly null) ContentChecker from a URLr/   ro   )r0   r   r1   rm   patternrj   Z	groupdict)clsr4   r9   r>      &&  r   from_urlZHashChecker.from_url  s^     <<((-b1!##""8,!##'U__&''r+   c                	s<    V P                   P                  V4       R # rY   )r   Zupdaterp   rO   r   rs   ZHashChecker.feed!  s    		r+   c                	sP    V P                   P                  4       V P                  8H  # rY   )r   Z	hexdigestr   rt   ru   r   rv   ZHashChecker.is_valid$  s    yy""$55r+   c                	s6    W P                   ,          pV! V4      # rY   )r   )rq   rw   rx   msg   &&& r   rz   ZHashChecker.report'  s    '}r+   )r   r   r   N)r{   r|   r}   r~   rQ   compiler   r   classmethodr   rs   rv   rz   r   ro   r+   r   r   r     s=    jj	#G
!
 ( ( 6r+   r   c                  s  a  ] tR tRtRtR=R V 3R llltV 3R ltR>R R lltR>R R	 lltR>R
 R llt	R R lt
R R ltR tR tR R ltR?R R lltR R ltR?V 3R lltR R ltR R ltR tR R ltR  tR@R! R" lltRAR# R$ lltR% tR&tR' tR( R) ltR?R* lt]R+ 4       t] R, 4       t!R- t"]R. 4       t#R/ t$R0 t%R1 R2 lt&R3 t'R4 t(]R5 4       t)R6 R7 lt*R8 R9 lt+R: R; lt,R<t-V ;t.# )Br   i,  z;A distribution index that scans web pages for download URLsc               s$    V ^8  d   QhRRRRRR/# )rU   	index_urlrd   
verify_sslboolr   r   ro   r   r   r   r   PackageIndex.__annotate__/  s(     - --
 - 
-r+   c                	sl  < \         SV `  ! V/ VB  VR RVP                  R 4      '       *  ,           V n        / V n        / V n        / V n        \        P                  ! RP                  \        \        V4      4      4      P                  V n        . V n        \        P                   P"                  V n        R# )r,   N|)superr   r$   r   scanned_urlsfetched_urlspackage_pagesrQ   r   rX   rc   r   r>   allowsto_scanr0   requesturlopenopener)rq   r   ZhostsZ	ca_bundler   rZ   Zkw	__class__s   &&&&&*,r   r   ZPackageIndex.__init__/  s     	$%"%"S)Fy/A/A#/F+F%GG"$"$#%jj#i*?!@AGGnn,,r+   c                	sr   <  \        VP                  4       \        ST `  T4      #   \         d     R # i ; irY   )r   rG   Z	Exceptionr   add)rq   distr   s   &&r   r   ZPackageIndex.addA  s9    	$,,' w{4    		s   ' 66c                    V ^8  d   QhRRRR/# )rU   retriever   r   r   ro   r   r   r   r   r   J  s     31 31 31$ 31r+   c           	     s   WP                   9   d   V'       g   R# RV P                   V&   \        V4      '       g   V P                  V4       R# \        \	        V4      4      pV'       d,   V P                  V4      '       g   R# V P                  RV4       V'       g   V'       d   WP                  9   d"   \        \        V P                  V4      4       R# V P                  V4      '       g   RV P                  V&   R# V P                  RV4       RV P                  V&   RpV P                  WV,          4      pVf   R# \        V\        P                  P                  4      '       d0   VP                   R8X  d   V P                  RVP"                   24       RV P                  VP$                  &   RVP&                  P)                  R	R
4      P+                  4       9  d   VP-                  4        R# VP$                  pVP/                  4       p\        V\0        4      '       ge   \        V\        P                  P                  4      '       d   RpM%VP&                  P3                  R4      ;'       g    RpVP5                  VR4      pVP-                  4        \6        P9                  V4       FL  p	\        P:                  P=                  V\?        V	PA                  ^4      4      4      p
V PC                  V
4       KN  	  VPE                  V PF                  4      '       d(   \I        VRR4      R8w  d   V PK                  W4      pR# R# R# )z<Evaluate a URL as a possible download, and maybe retrieve itNTzFound link: %sz
Reading %sz<Download error on %s: %%s -- Some packages may not be found!i  zAuthentication error: htmlcontent-type zlatin-1charsetZignorecode  )&r   
URL_SCHEMEprocess_filenamelistrB   url_okdebugr   rc   r   infoopen_url
isinstancer0   error	HTTPErrorr   r   r4   headersgetr#   closereadrd   Z	get_paramdecoderf   ra   r   rg   rh   r@   process_urlr%   r   getattrprocess_index)rq   r4   r   diststmplfr'   rk   r   r>   links   &&&        r   r   ZPackageIndex.process_urlJ  sb   ###H!%##!!#&-.E{{3''

+S1C+<+<$<TXXu%&{{3%)Dc"		,$!%#MMM#cz*9a//00QVVs]II.quug67#'!%% ~r:@@BBGGIuuvvx$$$!V\\3344#))--i8EEI;;w1D		]]4(E<<''jQ.HIDT" ) >>$..))ga.F#.M%%c0D /N)r+   c               r   )rU   nestedr   r   r   ro   r   r   r   r   r     s     ' '4 'D 'r+   c                	s4   \         P                  P                  V4      '       g   V P                  R V4       R# \         P                  P	                  V4      '       dt   V'       gl   \         P                  P                  V4      p\         P                  ! V4       F2  pV P                  \         P                  P                  W44      R4       K4  	  \        V4      pV'       d4   V P                  RV4       \        \        V P                  V4      4       R# R# )zNot found: %sNTz	Found: %s)rM   r7   existswarnisdirZrealpathlistdirr   rX   rP   r   r   rc   r   )rq   Zfnr   r7   Zitemr      &&&   r   r   ZPackageIndex.process_filename  s    ww~~b!!IIor*77==V77##B'D

4(%%bggll4&>E ) %R(JJ{B'TXXu%& r+   c               s     V ^8  d   QhRRRR/# )rU   fatalr   r   ro   r   r   r   r   r     s       $ r+   c                	sV   \        V4      pT;'       d#    VP                  ^4      P                  4       R8H  pV'       g<   V P                  \        P
                  P                  V4      ^,          4      '       d   R# RpV'       d   \        WQ,          4      hV P                  WQ4       R# )rV   fileTz
Note: Bypassing %s (disallowed host; see https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#restricting-downloads-with-allow-hosts for details).
F)	r   r@   r#   r   r0   r   r1   r   r   )rq   r4   r   ZsZis_filer   r   r   r   ZPackageIndex.url_ok  s    sO44
((*f4dkk&,,"7"7"<Q"?@@W 	
  ++IIcr+   c               r   r   ro   r   r   r   r   r     s     ? ?T ?r+   c                	s    \        \        P                  P                  V4      pR  V 4       p\	        \
        P                  ! V P                  V4      4       R# )c              3  s   "   T F>  p\         P                  ! V4       F!  pVP                  R 4      '       g   K  W3x  K#  	  K@  	  R# 5i)z	.egg-linkN)rM   r   r$   )rR   r7   entry   &  r   rT   Z.PackageIndex.scan_egg_links.<locals>.<genexpr>  s=      
D)~~k* TM) s
   2AAN)filterrM   r7   r   r   	itertoolsZstarmapscan_egg_link)rq   Zsearch_pathZdirsZ	egg_linksr   r   scan_egg_linksZPackageIndex.scan_egg_links  sB    bggmm[1

	 	Yt119=>r+   c               r   r   ro   r   r   r   r   r     s      D r+   c           
     	s   \        \        P                  P                  W4      4      p\	        \        R \        \        P                  VP                  4       4      4      4      p\        V4      ^8w  d   R # Vw  rV\        \        P                  P                  W4      4       FF  p\        P                  P                  ! V.VO5!  Vn        \        Vn        V P                  V4       KH  	  R # rY   )r   rM   r7   rX   r   r   rc   rd   re   Z
splitlinesrI   r   rE   r   r;   r   )rq   r7   r   ZcontentZlinesZegg_pathZ_setup_pathr   rL   r   r   ZPackageIndex.scan_egg_link  s    *277<<+DEVD#cii1C1C1E"FGHu:? %&rww||D'CDDGGLL66DM)DOHHTN Er+   c           	     	s   RpVP                  V P                  4      '       g   V# \        \        \        P
                  P                  V\        V P                  4      R  P                  R4      4      4      p\        V4      ^8w  g   RV^,          9   d   V# \        V^ ,          4      p\        V^,          4      pRV P                  P                  VP                  4       / 4      V&   \        V4      \        V4      3# )Nr,   r.   T)NN)r%   r   r   rc   r0   r   r2   rI   r3   r   r   r   Z
setdefaultr#   r   )rq   r   ZNO_MATCH_SENTINELr5   pkgvers   &&    r   _scanZPackageIndex._scan  s    &t~~..$$S--tC4G4I/J/P/PQT/UVWu:?cU1Xo$$ a!58$?C%%ciik26t<3S!111r+   c                sH   \         P                  V4       FK  p V P                  \        P                  P                  V\        VP                  ^4      4      4      4       KM  	  V P                  V4      w  rEV'       g   R# \        W4       Fi  p\        V4      w  rxVP                  R4      '       d2   V'       g*   V'       d   VRV RV 2,          pMV P                  V4       V P                  V4       Kk  	  \        P                  R V4      #   \         d     EK
  i ; i)z#Process the contents of a PyPI pager   .pyz#egg=rD   c                sD    R P                   ! V P                  ^^^4      !  # )z<a href="{}#md5={}">{}</a>)r   r@   )Zmru   r   Z<lambda>Z,PackageIndex.process_index.<locals>.<lambda>  s    2991771a;KLr+   )rf   ra   r   r0   r   rg   rh   r@   r   rl   r:   r$   need_version_infoscan_urlPYPI_MD5sub)	rq   r4   rk   r>   r   r   new_urlr'   frags	   &&&      r   r   ZPackageIndex.process_index  s     ]]4(E

6<<//ZA5OPQ ) ::c? +35G)'2JD}}U##Dse1SE22G**3/MM'" 6 ||Ld
 	
%  s   ADD! D!c               r   r   ro   r   r   r   r   r     s     
 
 
r+   c                	s*    V P                  R V4       R# )zPPage at %s links to .py file(s) without version info; an index scan is required.N)scan_allrq   r4   rO   r   r   ZPackageIndex.need_version_info  s     	
r+   c               r   r   ro   r   r   r   r   r     s     & &4 &r+   c                	s    V P                   V P                  9  d.   V'       d   V P                  ! V.VO5!   V P                  R 4       V P	                  V P                   4       R# )z6Scanning index of all packages (this may take a while)N)r   r   r   r   r   rq   r   rZ      &&*r   r   ZPackageIndex.scan_all  sE    >>!2!22		#%%IINOdnn%r+   c               r   r   ro   r   r   r   r   r     s      D r+   c                	s.   V P                  V P                  VP                  ,           R ,           4       V P                  P	                  VP
                  4      '       g4   V P                  V P                  VP                  ,           R ,           4       V P                  P	                  VP
                  4      '       g   V P                  V4       \        V P                  P	                  VP
                  R4      4       F  pV P                  V4       K  	  R# )r,   Nro   )	r   r   unsafe_namer   r   keyrF   not_found_in_indexr   )rq   requirementr4      && r   find_packagesZPackageIndex.find_packages  s    dnn{'>'>>DE!!%%koo66MM$..;+C+CCcIJ!!%%koo66##K0**..{CDCMM# Er+   c                	s   < V P                  4        V P                  V4       WP                  ,           F  pW19   d   Vu # V P                  R W4       K!  	  \        SV `  W4      # )z%s does not match %s)prescanr   r   r   r   obtain)rq   r   Z	installerr   r   s   &&& r   r   ZPackageIndex.obtain  sY    ;'))D"JJ-{A * w~k55r+   c               r   r   ro   r   r   r   r   r     s      D r+   c                s@   VP                  V P                  RV 24       VP                  4       '       gi   VP                  4        \        P
                  ! V4       \        VP                  P                   R\        P                  P                  V4       R24      hR# )z
checker is a ContentChecker
zValidating %s checksum for z validation failed for z; possible download problem?N)rz   r   rv   r   rM   unlinkr   r   r&   r7   rJ   )rq   checkerrN   tfp   &&&&r   
check_hashZPackageIndex.check_hash  s     	tzz%@
#KL!!IIKIIh <<$$%%<RWW=M=Mh=W<X Y- -  "r+   c               r   r   ro   r   r   r   r   r     s     ) )d )r+   c                s   V F  pV P                   eC   \        V4      '       d2   VP                  R4      '       g   \        \	        V4      4      '       d   V P                  V4       Kf  V P                   P                  V4       K  	  R# )z;Add `urls` to the list that will be prescanned for searchesNfile:)r   r   r%   r   rB   r   append)rq   Zurlsr4   r   r   add_find_linksZPackageIndex.add_find_links  s`    C$!#>>'**,-- c" ##C( r+   c                s    V P                   '       d*   \        \        V P                  V P                   4      4       RV n         R# )z7Scan urls scheduled for prescanning (e.g. --find-links)N)r   r   rc   r   rt   ru   r   r   ZPackageIndex.prescan(  s)    <<<T]]DLL12r+   c               r   r   ro   r   r   r   r   r   .  s       r+   c                	s    WP                   ,          '       d   V P                  R r2MV P                  Rr2V! W1P                  4       V P	                  4        R# )z#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?)N)r   r   r   r   r   )rq   r   Zmethr   r   r   r   ZPackageIndex.not_found_in_index.  s>      		#H#		#X#S))*r+   c                s   \        V\        4      '       g   \        V4      pV'       dJ   V P                  W4      p\	        V4      w  rVVP                  R4      '       d   V P                  WFV4      pV# \        P                  P                  V4      '       d   V# \        V4      p\        V P                  W4      RR4      # )a  Locate and/or download `spec` to `tmpdir`, returning a local path

`spec` may be a ``Requirement`` object, or a string containing a URL,
an existing local filename, or a project/version requirement spec
(i.e. the string form of a ``Requirement`` object).  If it is the URL
of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one
that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is
automatically created alongside the downloaded file.

If `spec` is a ``Requirement`` object or a string containing a
project/version requirement spec, this method returns the location of
a matching distribution (possibly after downloading it to `tmpdir`).
If `spec` is a locally existing file or directory name, it is simply
returned unchanged.  If `spec` is a URL, it is downloaded to a subpath
of `tmpdir`, and the local filename is returned.  Various errors may be
raised if a problem occurs during downloading.
r   rE   N)r   r   r   _download_urlr:   r$   	gen_setuprM   r7   r   r    r   fetch_distribution)rq   r   tmpdirschemeZfoundr'   r9   s   &&&    r   r-   ZPackageIndex.download6  s    $ $,,%F**48!1$!7=='' NN5FCE%%,T2t..t<j$OOr+   c               s(    V ^8  d   QhRRRRRRRR/# )rU   
force_scanr   source
develop_okr   zDistribution | Nonero   r   r   r   r   r   X  s:     P? P? 	P?
 P? P? 
P?r+   c                sD  a aaaa	 S P                  RV4       \        4       o	RpR
R VV V	VV3R lllpV'       d*   S P                  4        S P                  V4       V! V4      pV'       g   Ve	   V! W4      pVf'   S P                  e   S P                  4        V! V4      pVf"   V'       g   S P                  V4       V! V4      pVf*   S P                  RS;'       d    R;'       g    RV4       R# S P                  RV4       VP                  VP                  R	7      # )a  Obtain a distribution suitable for fulfilling `requirement`

`requirement` must be a ``pkg_resources.Requirement`` instance.
If necessary, or if the `force_scan` flag is set, the requirement is
searched for in the (online) package index as well as the locally
installed packages.  If a distribution matching `requirement` is found,
the returned distribution's ``location`` is the value you would have
gotten from calling the ``download()`` method with the matching
distribution's URL or filename.  If no matching distribution is found,
``None`` is returned.

If the `source` flag is set, only source distributions and source
checkout links will be considered.  Unless the `develop_ok` flag is
set, development and system eggs (i.e., those using the ``.egg-info``
format) will be ignored.
zSearching for %sNc               r   )rU   envzEnvironment | Nonero   r   r   r   r   Z5PackageIndex.fetch_distribution.<locals>.__annotate__v  s     	 	- 	r+   c                s  < Vf   SpWP                   ,           F  pVP                  \        8X  d5   S'       g-   VS9  d$   SP                  RV4       SP	                  V4       KL  W 9   ;'       d#    VP                  \
        8*  ;'       g    S'       * pV'       g   K  SP                  VP                  S	4      pWBn        \        P                  P                  VP                  4      '       g   K  Vu # 	  R # )Nz&Skipping development or system egg: %s)r   r;   r	   r   r   r   r-   rE   download_locationrM   r7   r   )
Zreqr   r   ZtestZlocr   rq   skippedr   r   s
   &&   r   ri   Z-PackageIndex.fetch_distribution.<locals>.findv  s    { GG??l2:7*		D   D){UU;(F(T(Tf*4--v>C-0*ww~~d&<&<==# %" r+   z:No local packages or working download links found for %s%sza source distribution of r   zBest match: %s)rE   rY   )r   rb   r   r   r   r   cloner   )
rq   r   r   r   r   r   Zlocal_indexr   ri   r   s
   f&f&ff&  @r   r   ZPackageIndex.fetch_distributionX  s    4 			$k2%	 	0 LLN{+$D/1D<||'$D<
{+$D<IIL777==2
 II&-::t'='=:>>r+   c               s$    V ^8  d   QhRRRRRR/# )rU   r   r   r   r   z
str | Nonero   r   r   r   r   r     s$      /3EI	r+   c                sJ    V P                  WW44      pVe   VP                  # R# )a  Obtain a file suitable for fulfilling `requirement`

DEPRECATED; use the ``fetch_distribution()`` method now instead.  For
backward compatibility, this routine is identical but returns the
``location`` of the downloaded distribution instead of a distribution
object.
N)r   rE   )rq   r   r   r   r   r   s   &&&&& r   fetchZPackageIndex.fetch  s)     &&{JO== r+   c                	s@   \         P                  V4      pT;'       dH    \        WP                  ^4      R4       Uu. uF  pVP                  '       g   K  VNK  	  up;'       g    . p\        V4      ^8X  Edh   \        P                  P                  V4      p\        P                  P                  V4      V8w  d   \        P                  P                  W74      p\        P                  P                  V4      '       d&   \        P                  P                  W4      '       g   \        P                  ! W4       Tp\        \        P                  P                  VR4      RRR7      ;_uu_ 4       p	V	P!                  RV^ ,          P"                  : RV^ ,          P                  : R\        P                  P%                  V4      ^ ,          : R	24       RRR4       V# V'       d   \'        R
V: RV: 24      h\'        R4      hu upi   + '       g   i     T# ; i)rV   Nzsetup.pyZwzutf-8)Zencodingz(from setuptools import setup
setup(name=z
, version=z, py_modules=[z])
z9Can't unambiguously interpret project/version identifier zI; any dashes in the name or version should be escaped using underscores. zpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)r=   r>   r?   r@   rG   rI   rM   r7   rJ   ZdirnamerX   r   ZsamefileshutilZcopy2openwriterF   Zsplitextr   )
rq   rN   r9   r   r>   Zdr   rJ   Zdstr   s
   &&&&      r   r   ZPackageIndex.gen_setup  s   ""8,   /xQNNA99 N   	 u:?ww''1H wwx(F2ggll64s++0@0@0O0OLL/"Hbggll6:6gNNRV

""'("7"7!:*U1XEUEUDXXfgigngngwgw  yA  hB  CD  hE  gH  HLM O
 O KH< X  %y*  !G A$ ON
 Os   HH2A%HH	i    c           	     	s   V P                  R V4       Rp \        P                  V4      pV P                  V4      p\	        V\
        P                  P                  4      '       d)   \        RV RVP                   RVP                   24      hVP                  4       p^ pV P                  pRpRV9   d>   VP                  R4      p	\        \        \        V	4      4      pV P!                  WWgV4       \#        VR4      ;_uu_ 4       p
 VP%                  V4      pV'       dA   VP'                  V4       V
P)                  V4       V^,          pV P!                  WWgV4       KZ   T P+                  YBT
4       RRR4       TT'       d   TP-                  4        # #   + '       g   i     L+; i  T'       d   TP-                  4        i i ; i)	zDownloading %sNzCan't download :  zcontent-lengthzContent-LengthZwbr/   )r   r   r   r   r   r0   r   r   r   r   r   dl_blocksizeZget_allZmaxrc   Zint
reporthookr   r   rs   r  r   r   )rq   r4   rN   fpr   r   blocknumZbssizeZsizesr   rr   s   &&&         r   _download_toZPackageIndex._download_to  si   		"C(	!**3/Gs#B"fll4455$se2bggYax%PQQggiGH""BD7*(893sE?+xTBh%%GGBKEU+		%( AxTJ37 & 
  &% 
 s+   C0F* F!AF4	F* F'	"F* *Gc               r   r   ro   r   r   r   r   r     s      D r+   c                	s    R # rY   ro   )rq   r4   rN   r  Zblksizer  s   &&&&&&r   r  ZPackageIndex.reporthook  s    r+   c           	     	s>   VP                  R 4      '       d   \        V4      #  \        WP                  4      #   \        \
        P                  P                  3 dp   pRP                  TP                   Uu. uF  p\        T4      NK  	  Mu upi up4      pT'       d   T P                  Y%4        Rp?R# \        T RT 24      ThRp?i\        P                  P                   d   pTu Rp?# Rp?i\        P                  P                    dK   pT'       d"   T P                  Y#P"                  4        Rp?R# \        RT RTP"                   24      ThRp?i\
        P                  P$                   dJ   pT'       d"   T P                  Y#P&                  4        Rp?R# \        T RTP&                   24      ThRp?i\
        P                  P(                  \*        3 d7   pT'       d   T P                  Y#4        Rp?R# \        RT RT 24      ThRp?ii ; i)r   r  NzDownload error for r  z7 returned a bad status line. The server might be down, )r%   
local_openopen_with_authr   r   httpclient
InvalidURLrX   rZ   rd   r   r   r0   r   r   ZURLErrorZreasonZBadStatusLineZlineZHTTPExceptionZOSError)rq   r4   ZwarningZvZargr   r   r   r   ZPackageIndex.open_url
  s   >>'""c?"	N!#{{33DKK223 	<((7CH78C		'''$uAcU^4!;||%% 	H||$$ 	U		'88,,$':3%r!((%LMSTT{{(( 			'66**$e VVH&  ))73 	N		'%%$':3%r!%EFAM		Ns   9 %HC7B
C C7C H)H*C1+H1 HH#E<E H9H:#F>#F>>&H%H&HHHc                sT    RP                  R4      p\        P                  ! VRV 4      # )a9  
Replace unsafe path directives with underscores.

>>> san = PackageIndex._sanitize
>>> san('/home/user/.ssh/authorized_keys')
'_home_user_.ssh_authorized_keys'
>>> san('..\\foo\\bing')
'__foo_bing'
>>> san('D:bar')
'D_bar'
>>> san('C:\\bar')
'C__bar'
>>> san('foo..bar')
'foo..bar'
>>> san('D:../foo')
'D___foo'
r   _):z[/\\]z6(?:(?<=([/\\]|:))\.\.(?=[/\\]|$))|(?:^\.\.(?=[/\\]|$)))rX   rQ   r   )r&   r   r   r   	_sanitizeZPackageIndex._sanitize*  s,    & (( 
  vvgtT**r+   c                s    \        V4      w  r4T P                  T;'       g    R4      p\        P                  ! RRV4      p\        P
                  P                  W#4      # )a  
>>> import pathlib
>>> du = PackageIndex._resolve_download_filename
>>> root = getfixture('tmp_path')
>>> url = 'https://files.pythonhosted.org/packages/a9/5a/0db.../setuptools-78.1.0.tar.gz'
>>> str(pathlib.Path(du(url, root)).relative_to(root))
'setuptools-78.1.0.tar.gz'
Z__downloaded__z\.egg\.zip$rC   )r:   r  rQ   r   rM   r7   rX   )r   r4   r   r&   Z	_fragments   &&&  r   _resolve_download_filenameZ'PackageIndex._resolve_download_filenameG  sW     +3/}}   	
 vvnfd3ww||F))r+   c                sx    V P                  W4      pV P                  W4      ;'       g    V P                  W4      # )z"
Determine the download filename.
)r  _download_vcs_download_other)rq   r4   r   rN   r   r   r   ZPackageIndex._download_url^  s8     223?!!#0WWD4H4H4WWr+   c                s    \         P                  P                  V 4      P                  pVP	                  R4      w  r#p\        RR.R.\        V4      ,          ,           4      p\        \        V0V,          4      R4      # )z
>>> rvcs = PackageIndex._resolve_vcs
>>> rvcs('git+http://foo/bar')
'git'
>>> rvcs('hg+https://foo/bar')
'hg'
>>> rvcs('git:myhost')
'git'
>>> rvcs('hg:myhost')
>>> rvcs('http://foo/bar')
+svngithgN)	r0   r   urlsplitr   	partitionrb   r   ZnextZiter)r4   r   presepZ_postZalloweds   &     r   _resolve_vcsZPackageIndex._resolve_vcse  sh     &&s+22 **3/%uenvS	'99:D#)400r+   c                	s   V P                  V4      pV'       g   R # VR8X  d   \        RV 24      hVP                  R4      w  p pV P                  V4      w  rV P	                  RV RV RV 24       \
        P                  ! VRRW.4       \        VR	VR
RV.VRVRR	RVR.R7      pVe1   V P	                  RV 24       \
        P                  ! Ws,          4       V# )Nr  z/Invalid config, SVN download is not supported: r.   zDoing z clone from z to r   z--quietz-CZcheckoutz--cwdZupz-rz-q)r  r  zChecking out )r  r   r  _vcs_split_rev_from_urlr   
subprocessZ
check_calldict)rq   r4   Zspec_filenameZvcsrN   r  revZco_commandsrL   r   r  ZPackageIndex._download_vcsx  s    $%< A#G  '005!Q//4		F3%|C5XJ?@sGYFGdHj)SAWhdD#tD
 ?IIcU+,!!+"23r+   c                	s4   \         P                  P                  V4      P                  pVR 8X  dG   \         P                  P                  \         P                  P                  V4      P                  4      # V P                  VR4       V P                  W4      # )r   T)
r0   r   r  r   r   url2pathnamer1   r7   r   _attempt_download)rq   r4   rN   r   r   r   r  ZPackageIndex._download_other  sm    &&s+22V>>..v||/D/DS/I/N/NOOC%%c44r+   c               r   r   ro   r   r   r   r   r     s     $ $t $r+   c                	s*    V P                  VR 4       R# )TN)r   r   rO   r   r   ZPackageIndex.scan_url  s    d#r+   c                	s    V P                  W4      pR VP                  RR4      P                  4       9   d   V P                  WV4      # V# )r   r   r   )r	  r   r#   _invalid_download_html)rq   r4   rN   r   r   r   r#  ZPackageIndex._attempt_download  sF    ##C2W[[4::<<..sXFFOr+   c                	sJ    \         P                  ! V4       \        R V 24      h)zUnexpected HTML page found at )rM   r   r   )rq   r4   r   rN   r   r   r$  Z#PackageIndex._invalid_download_html  s!    
		(=cUCDDr+   c                sX   \         P                  P                  V 4      pVP                  P	                  R^4      R,          pVP
                  P                  R4      w  p pVP                  R4      w  rVpV'       d   WW3MVR3w  rVP                  VVRR7      P                  4       p
W3# )a  
Given a possible VCS URL, return a clean URL and resolved revision if any.

>>> vsrfu = PackageIndex._vcs_split_rev_from_url
>>> vsrfu('git+https://github.com/pypa/setuptools@v69.0.0#egg-info=setuptools')
('https://github.com/pypa/setuptools', 'v69.0.0')
>>> vsrfu('git+https://github.com/pypa/setuptools#egg-info=setuptools')
('https://github.com/pypa/setuptools', None)
>>> vsrfu('http://foo/bar')
('http://foo/bar', None)
r  r.   @Nr   )r   r7   r9   r/   )
r0   r   r  r   r3   r7   r  
rpartitionZ_replaceZgeturl)r4   r5   Zclean_schemeZno_fragment_pathr  r  r  ZpostZ
clean_pathr!  Zresolveds   &          r   r  Z$PackageIndex._vcs_split_rev_from_url  s     %%c*||))#q1"5 "'!5!5c!:!Q)44S9$),3+4,
>>	 " 

 &( 	 }r+   c               r   r   ro   r   r   r   r   r     s      4 r+   c                	6    \         P                  ! V.VO5!   R # rY   )r   r   r   r   r   r   ZPackageIndex.debug  s    		#r+   c               r   r   ro   r   r   r   r   r           $ r+   c                	r'  rY   )r   r   r   r   r   r   ZPackageIndex.info      tr+   c               r   r   ro   r   r   r   r   r     r(  r+   c                	r'  rY   )r   r   r   r   r   r   ZPackageIndex.warn  r)  r+   )r   r   r   r   r   r   r   )zhttps://pypi.org/simple/)Z*NT)FrY   )FFFN)FF)/r{   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r-   r   r   r   r  r	  r  r   Zstaticmethodr  r   r  r   r  r  r  r   r#  r$  r  r   r   r   r   __classcell__r      @r   r   r   ,  s   E- -$!31j'  ? 2 
:
&6) PDP?d'R L DN@ + +8 * *,X 1 1$25$E  > r+   z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c                sP    V P                  ^ 4      p\        P                  ! V4      # )i    )r@   r   Zunescape)r>   Zwhatr   r   decode_entityr-    s    ;;q>D==r+   c                s"    \        \        V 4      # )z
Decode HTML entities in the given text.

>>> htmldecode(
...     'https://../package_name-0.1.2.tar.gz'
...     '?tokena=A&amp;tokenb=B">package_name-0.1.2.tar.gz')
'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz'
)
entity_subr-  )Ztextru   r   rh   rh     s     mT**r+   c                s   a  V 3R  lpV# )c                s   <a  V V3R  lpV# )c                 s   < \         P                  ! 4       p\         P                  ! S4        S! V / VB \         P                  ! V4       #   \         P                  ! T4       i ; irY   )socketZgetdefaulttimeoutZsetdefaulttimeout)rZ   r[   Zold_timeoutr\   timeouts   *, r   _socket_timeoutZ@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeout  sN     224K$$W-6T,V,((5((5s   A A$ro   )r\   r1  r0  s   f r   r1  Z'socket_timeout.<locals>._socket_timeout  s    	6 r+   ro   )r0  r1  r^   r   socket_timeoutr2    s    	 r+   c                s    \         P                  P                  V 4      pVP                  4       p\        P
                  ! V4      pVP                  4       pVP                  RR4      # )a  
Encode auth from a URL suitable for an HTTP header.
>>> str(_encode_auth('username%3Apassword'))
'dXNlcm5hbWU6cGFzc3dvcmQ='

Long auth strings should not cause a newline to be inserted.
>>> long_auth = 'username:' + 'password'*10
>>> chr(10) in str(_encode_auth(long_auth))
False

r   )r0   r   r2   Zencodebase64Z	b64encoder   Zreplace)authZauth_sZ
auth_bytesZencoded_bytesZencodedr)   r   _encode_authr6    sR     \\!!$'FJ$$Z0M""$G??4$$r+   c                  s<    ] tR tRt$ RtR]R&   R]R&   R R ltRtR	# )

Credentiali  zx
A username/password pair.

Displayed separated by `:`.
>>> str(Credential('username', 'password'))
'username:password'
rd   usernamepasswordc               r   )rU   r   rd   ro   r   r   r   r   ZCredential.__annotate__  s     2 2 2r+   c                	s8    V P                    R V P                   2# )r  )r8  r9  rt   ru   r   __str__ZCredential.__str__  s    --$--11r+   ro   N)r{   r|   r}   r~   r   Z__annotations__r:  r   ro   r+   r   r7  r7    s     MM2 2r+   r7  c                  sD   a  ] tR tRtV 3R lt]R 4       tR tR tRt	V ;t
# )
PyPIConfigi  c                s4  < \         P                  . ROR4      p\        SV `  V4       \        P
                  P                  \        P
                  P                  R4      R4      p\        P
                  P                  V4      '       d   \        W4       R# R# )z
Load from ~/.pypirc
r   Z~z.pypircN)r8  r9  
repository)
r   Zfromkeysr   r   rM   r7   rX   Z
expanduserr   r   )rq   ZdefaultsZrcr   s   &  r   r   ZPyPIConfig.__init__  sf     ==!GL"WW\\"'',,S19=77>>"(2 r+   c                	s    V P                  4        Uu. uF-  pV P                  VR 4      P                  4       '       g   K+  VNK/  	  pp\        \	        V P
                  V4      4      # u upi )r<  )Zsectionsr   re   r   rc   _get_repo_cred)rq   sectionZsections_with_repositoriesr   r   creds_by_repositoryZPyPIConfig.creds_by_repository'  sc      ==?&
*xx.446 G* 	# &
 C++-GHII&
s   (A' A'c                	s    V P                  VR 4      P                  4       pV\        V P                  VR4      P                  4       V P                  VR4      P                  4       4      3# )r<  r8  r9  )r   re   r7  )rq   r>  Zrepor   r   r=  ZPyPIConfig._get_repo_cred1  s]    xx.446ZHHWj)//1HHWj)//1
 
 	
r+   c                s    V P                   P                  4        F   w  r#VP                  V4      '       g   K  Vu # 	  R# )zt
If the URL indicated appears to be a repository defined in this
config, return the credential for that repository.
N)r?  Zitemsr%   )rq   r4   r<  credr   r   find_credentialZPyPIConfig.find_credential8  s:    
 !% 8 8 > > @J~~j)) !A r+   ro   )r{   r|   r}   r~   r   Zpropertyr?  r=  rA  r   r*  r+  r,  r   r;  r;    s-    	3 J J
 r+   r;  c                s   \         P                  P                  V 4      pVw  r4rVrxVP                  R4      '       d    \        P
                  P                  R4      hVR9   d   \        V4      w  rMRRrV	'       gS   \        4       P                  V 4      pV'       d2   \        V4      p	VP                  V 3p\        P                  ! R.VO5!   V	'       di   R\        V	4      ,           p	W:WVWx3p\         P                  P                  V4      p\         P                   P#                  V4      pVP%                  RV	4       M\         P                   P#                  V 4      pVP%                  R\&        4       V! V4      pV	'       dk   \         P                  P                  VP(                  4      w  ppppppVV8X  d4   VV
8X  d-   VVVVVV3p\         P                  P                  V4      Vn        V# )	z4Open a urllib2 request, handling HTTP authenticationr  znonnumeric port: ''Nz*Authenticating as %s for %s (from .pypirc)zBasic ZAuthorizationz
User-Agent)r  Zhttps)r0   r   r1   r$   r  r  r  
_splituserr;  rA  rd   r8  r   r   r6  Z
urlunparser   ZRequestZ
add_header
user_agentr4   )r4   r   Zparsedr   Znetlocr7   ZparamsZqueryr   r5  Zaddressr@  r   r5   r   r   r  Zs2Zh2Zpath2Zparam2Zquery2Zfrag2s   &&                     r   r  r  C  s    \\""3'F06-FD% skk$$%:;;"""6*gtg|++C0t9D==#%DHHAIDI,t,,u:,,))%0..((1?D1..((-|Z0	B 06||/D/DRVV/L,Bvvu<B'Mvvu<E\\,,U3BFIr+   c                sH    V P                  R4      w  rp V'       d   W3# RV 3# )zJsplituser('user[:passwd]@host[:port]')
--> 'user[:passwd]', 'host[:port]'.r%  N)r&  )ZhostZuserZdelimr   r   rB  rB  s  s,     ,DD**td**r+   c                s    V # rY   ro   )r4   ru   r   
fix_sf_urlrD  ~  s    Jr+   c                s   \         P                  P                  V 4      w  rr4rV\         P                  P	                  V4      p\
        P                  P                  V4      '       d    \         P                  P                  V 4      # VP                  R4      '       d   \
        P                  P                  V4      '       d   . p\
        P                  ! V4       F|  p	\
        P                  P                  Wy4      p
V	R8X  d   \        V
4      p Mn\
        P                  P                  V
4      '       d
   V	R,          p	VP                  RV	 RV	 R24       K~  	  RpVP                  V RP                  V4      R7      p^R	rMR
RRrpRR/p\         P"                  ! V4      p\         P$                  P'                  WWV4      # )z7Read a local path, with special support for directoriesr,   z
index.htmlz	<a href="z">z</a>zB<html><head><title>{url}</title></head><body>{files}</body></html>r3  )r4   filesZOKr   zPath not foundz	Not foundr   z	text/html)r0   r   r1   r   r"  rM   r7   Zisfiler   r$   r   r   rX   r   r   r   ioZStringIOr   r   )r4   r6   Z_serverr7   Z_paramr8   Z_fragrN   rE  r   ZfilepathZbodyr   ZstatusZmessager   Zbody_streams   &                r   r
  r
    sW   4:LL4I4I#4N1GdF~~**40H	ww~~h~~%%c**	s		h 7 7H%Aww||H0HL /9x((SLL9QCr!D12 & XD;;3dii.>;?Dt #%5{{+G++d#K<<!!#wMMr+   )r   rB   r*   r?   rY   )i   )br   Z
__future__r    r4  Zconfigparserr   r   Zhttp.clientr  rF  r   rM   rQ   r   r/  r  ZsysZurllib.errorr0   Zurllib.parseZurllib.requestZfnmatchr   Z	functoolsr   Ztypingr   Zmore_itertoolsr   Z
setuptoolsZpkg_resourcesr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   Zsetuptools.wheelr   Zunicode_utilsr   r   Z	distutilsr   Zdistutils.errorsr   r   r=   ZIrf   r   r>   r   r3   rH   Z__all__Z_SOCKET_TIMEOUTZ__version__Zversion_infoZmajorZminorrC  r    r*   r:   rB   r<   rP   r?   r_   r`   rl   rm   r   r   r   r.  r-  rh   r2  r6  r7  ZRawConfigParserr;  r   r   r  rB  rD  r
  ro   r+   r   <module>rG     s$   * "      	  	 	    
       *      # Q  +zz67	zz3RTT:::J ZZ,bdd399
.446
 :112/#BRBRBXBXAYYZ[^[k[k[q[qZrs
0	 F .2kTXD
 	jjKRTTR
 L L$ 2. Bb
; b
N ZZ<=AA

	+%*2 2 %-- %P  &~~55 +`+  0@Nr+   