+
    hk                       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/.c                v     \         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   )speces   & :/usr/lib/python3/dist-packages/setuptools/package_index.pyparse_requirement_argr$   H   sB      && =dXF
	s    838c                p   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.exewin32z	.win32-pyz.win-amd64.exez	win-amd64z.win-amd64-pyiiiii)lowerendswith
startswith)namer)   basepy_verplats   &    r#   parse_bdist_wininstr0   Q   s     JJLEtT$D~~f>>,'':DDk3//"R[F:DD^^,--:DDos33"R[F:DD    c                x   \         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#)urllibr   urlparseunquotesplit)	urlparts_schemeserverpath_parameters_queryfragmentr-   s	   &        r#   egg_info_for_urlrD   i   s    LL!!#&E;@8GT<<

3 34D""tz'9||##DJJsOB$78
d{C+>r1   c              #     "   \        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)rD   distros_for_locationEGG_FRAGMENTmatchinterpret_distro_namegroupr
   )r<   metadatar-   rC   rI   s   &&   r#   distros_for_urlrM   t   sl     %c*ND#Cx888""8,,[[^X-     9s,   A<A8A<A<	$A<-A:.A<:A<c                   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versionrF   r&   r(   )r*   r   from_locationr   is_compatiblerR   rS   r   r0   rJ   r	   
EXTENSIONSlen)rQ   basenamerL   wheelwin_baser.   platformexts   &&&     r#   rG   rG      s,   $$CR=  SH_**8xHII  SH_h""$$I!"//#a<
 	
   %8%B"((Hk8 
 S!!3s8),H(XFF  Ir1   c                h    \        \        V 4      \        P                  P	                  V 4      V4      # )zEYield possible egg or source distribution objects based on a filename)rG   r   osr@   rX   )filenamerL   s   &&r#   distros_for_filenamer`      s*    x "''"2"28"<h r1   c           
   #    "   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!
rP   c              3  P   "   T F  p\         P                  ! R V4      x  K  	  R# 5i)z	py\d\.\d$N)rerI   ).0ps   & r#   	<genexpr>(interpret_distro_name.<locals>.<genexpr>   s     KAbhh|Q77s   $&:   NNTFN:N   N)
py_versionrF   r[   )r;   anyrangerW   isdigitr   join)rQ   rX   rL   rj   rF   r[   r=   re   s   &&&&&&  r#   rJ   rJ      s      NN3E##KrK###KrKKK 3u:8B<!!  J
rr s   $C*C*!C*$9C*"AC*c                0   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! V / VB 4      # Nr   )argskwargsfuncs   *,r#   wrapperunique_values.<locals>.wrapper   s    tT4V455r1   r   )rt   ru   s   f r#   unique_valuesrw      s"     4[6 6 Nr1   z3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>c           
   #    "   \         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 URLs,homepager4   N)z<th>Home Pagez<th>Download URLr6   )RELfinditergroupssetmapstrstripr)   r;   HREFr8   r   urljoin
htmldecoderK   findsearch)r<   pagerI   tagrelrelsposs   &&     r#   find_external_linksr      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                  ,    ] 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blocks   &&r#   feedContentChecker.feed   s     	r1   c                    R# )z3
Check the hash. Return False if validation fails.
Tr   r   s   &r#   is_validContentChecker.is_valid   s     r1   c                    R# )z]
Call reporter with information about the checker (hash name)
substituted into the template.
Nr   )r   reportertemplates   &&&r#   reportContentChecker.report  s    
 	r1   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__r   r1   r#   r   r      s    r1   r   c                  h    ] 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/# rh   returnNoner   )formats   "r#   __annotate__HashChecker.__annotate__  s     ! !t !r1   c                	T    Wn         \        P                  ! V4      V n        W n        R # rq   )	hash_namehashlibnewhashexpected)r   r   r   s   &&&r#   __init__HashChecker.__init__  s    "KK	*	 r1   c                    \         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 URLr6   r   )r8   r   r9   r   patternr   	groupdict)clsr<   rC   rI   s   &&  r#   from_urlHashChecker.from_url  s^     <<((-b1!##""8,!##'U__&''r1   c                	<    V P                   P                  V4       R # rq   )r   updater   s   &&r#   r   HashChecker.feed!  s    		r1   c                	P    V P                   P                  4       V P                  8H  # rq   )r   	hexdigestr   r   s   &r#   r   HashChecker.is_valid$  s    yy""$55r1   c                	6    W P                   ,          pV! V4      # rq   )r   )r   r   r   msgs   &&& r#   r   HashChecker.report'  s    '}r1   )r   r   r   N)r   r   r   r   rc   compiler   r   classmethodr   r   r   r   r   r   r1   r#   r   r     s=    jj	#G
!
 ( ( 6r1   r   c                    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               $    V ^8  d   QhRRRRRR/# )rh   	index_urlr   
verify_sslboolr   r   r   )r   s   "r#   r   PackageIndex.__annotate__/  s(     - --
 - 
-r1   c                	l  < \         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# )r3   N|)superr   r*   r   scanned_urlsfetched_urlspackage_pagesrc   r   rn   r   r   rI   allowsto_scanr8   requesturlopenopener)r   r   hosts	ca_bundler   rr   kw	__class__s   &&&&&*,r#   r   PackageIndex.__init__/  s     	$%"%"S)Fy/A/A#/F+F%GG"$"$#%jj#i*?!@AGGnn,,r1   c                	r   <  \        VP                  4       \        ST `  T4      #   \         d     R # i ; irq   )r   rS   	Exceptionr   add)r   distr   s   &&r#   r   PackageIndex.addA  s9    	$,,' w{4    		s   ' 66c                    V ^8  d   QhRRRR/# )rh   retriever   r   r   r   )r   s   "r#   r   r   J  s     31 31 31$ 31r1   c           	        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charsetignorecode  )&r   
URL_SCHEMEprocess_filenamelistrM   url_okdebugr   r   r   infoopen_url
isinstancer8   error	HTTPErrorr   r   r<   headersgetr)   closereadr   	get_paramdecoder   r|   r   r   r   rK   process_urlr+   r   getattrprocess_index)r   r<   r   diststmplfr-   r   r   rI   links   &&&        r#   r   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)r1   c                    V ^8  d   QhRRRR/# )rh   nestedr   r   r   r   )r   s   "r#   r   r     s     ' '4 'D 'r1   c                	4   \         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)r^   r@   existswarnisdirrealpathlistdirr   rn   r`   r   r   r   r   )r   fnr  r@   itemr   s   &&&   r#   r   PackageIndex.process_filename  s    ww~~b!!IIor*77==V77##B'D

4(%%bggll4&>E ) %R(JJ{B'TXXu%& r1   c                    V ^8  d   QhRRRR/# )rh   fatalr   r   r   )r   s   "r#   r   r     s       $ r1   c                	V   \        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# )ri   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   rK   r)   r   r8   r   r9   r   r  )r   r<   r  sis_filer   s   &&&   r#   r   PackageIndex.url_ok  s    sO44
((*f4dkk&,,"7"7"<Q"?@@W 	
  ++IIcr1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s     ? ?T ?r1   c                	    \        \        P                  P                  V4      pR  V 4       p\	        \
        P                  ! V P                  V4      4       R# )c              3     "   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)r^   r  r*   )rd   r@   entrys   &  r#   rf   .PackageIndex.scan_egg_links.<locals>.<genexpr>  s=      
D)~~k* TM) s
   2AAN)filterr^   r@   r	  r   	itertoolsstarmapscan_egg_link)r   search_pathdirs	egg_linkss   &&  r#   scan_egg_linksPackageIndex.scan_egg_links  sB    bggmm[1

	 	Yt119=>r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s      D r1   c           
     	   \        \        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 # rq   )r   r^   r@   rn   r   r  r   r   r   
splitlinesrW   r   rQ   r   rF   r   )r   r@   r  contentlinesegg_path_setup_pathr   s   &&&     r#   r  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r1   c           	     	   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# )Nr3   r5   T)NN)r+   r   r   r   r8   r   r:   rW   r;   r   r   r   
setdefaultr)   r   )r   r  NO_MATCH_SENTINELr=   pkgvers   &&    r#   _scan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1r1   c                H   \         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=rP   c                D    R P                   ! V P                  ^^^4      !  # )z<a href="{}#md5={}">{}</a>)r   rK   )ms   &r#   <lambda>,PackageIndex.process_index.<locals>.<lambda>  s    2991771a;KLr1   )r   r|   r1  r8   r   r   r   rK   r    r   rD   r*   need_version_infoscan_urlPYPI_MD5sub)	r   r<   r   rI   r/  r0  new_urlr-   frags	   &&&      r#   r   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                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s     
 
 
r1   c                	*    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r   r<   s   &&r#   r9  PackageIndex.need_version_info  s     	
r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s     & &4 &r1   c                	    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:  r   r   rr   s   &&*r#   rB  PackageIndex.scan_all  sE    >>!2!22		#%%IINOdnn%r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s      D r1   c                	.   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# )r3   Nr   )	r:  r   unsafe_namer   r   keyrR   not_found_in_indexr   )r   requirementr<   s   && r#   find_packages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r1   c                	   < 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)prescanrO  rL  r   r   obtain)r   rN  	installerr   r   s   &&& r#   rS  PackageIndex.obtain  sY    ;'))D"JJ-{A * w~k55r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s      D r1   c                @   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)r   r   r   r   r^   unlinkr   r   r,   r@   rX   )r   checkerr_   tfps   &&&&r#   
check_hashPackageIndex.check_hash  s     	tzz%@
#KL!!IIKIIh <<$$%%<RWW=M=Mh=W<X Y- -  "r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s     ) )d )r1   c                   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   rM   r:  append)r   urlsr<   s   && r#   add_find_linksPackageIndex.add_find_links  s`    C$!#>>'**,-- c" ##C( r1   c                    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   r   r:  r   s   &r#   rR  PackageIndex.prescan(  s)    <<<T]]DLL12r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r   .  s       r1   c                	    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)rL  r   r  rK  rB  )r   rN  methr   s   &&  r#   rM  PackageIndex.not_found_in_index.  s>      		#H#		#X#S))*r1   c                   \        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.
r4  rQ   N)r   r   r   _download_urlrD   r*   	gen_setupr^   r@   r  r$   r   fetch_distribution)r   r!   tmpdirschemefoundr-   rC   s   &&&    r#   r4   PackageIndex.download6  s    $ $,,%F**48!1$!7=='' NN5FCE%%,T2t..t<j$OOr1   c               (    V ^8  d   QhRRRRRRRR/# )rh   
force_scanr   source
develop_okr   zDistribution | Noner   )r   s   "r#   r   r   X  s:     P? P? 	P?
 P? P? 
P?r1   c                D  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                   V ^8  d   QhRR/# )rh   envzEnvironment | Noner   )r   s   "r#   r   5PackageIndex.fetch_distribution.<locals>.__annotate__v  s     	 	- 	r1   c                  < 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)rL  rF   r   r  r   r   r4   rQ   download_locationr^   r@   r  )
reqrx  r   testlocru  r   skippedrt  rn  s
   &&   r#   r   -PackageIndex.fetch_distribution.<locals>.findv  s    { GG??l2:7*		D   D){UU;(F(T(Tf*4--v>C-0*ww~~d&<&<==# %" r1   z:No local packages or working download links found for %s%sza source distribution of r   zBest match: %s)rQ   rq   )r   r~   rR  rO  r   r  cloner{  )
r   rN  rn  rs  rt  ru  local_indexr   r   r  s
   f&f&ff&  @r#   rm  PackageIndex.fetch_distributionX  s    4 			$k2%	 	0 LLN{+$D/1D<||'$D<
{+$D<IIL777==2
 II&-::t'='=:>>r1   c               $    V ^8  d   QhRRRRRR/# )rh   rs  r   rt  r   z
str | Noner   )r   s   "r#   r   r     s$      /3EI	r1   c                J    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)rm  rQ   )r   rN  rn  rs  rt  r   s   &&&&& r#   fetchPackageIndex.fetch  s)     &&{JO== r1   c                	@   \         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)ri   Nzsetup.pywzutf-8)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.)rH   rI   rJ   rK   rS   rW   r^   r@   rX   dirnamern   r  samefileshutilcopy2openwriterR   splitextr   )
r   r_   rC   rn  rI   dr   rX   dstr  s
   &&&&      r#   rl  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           	     	   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-Lengthwbr6   )r   r   r   r   r   r8   r   r   r   r   r   dl_blocksizeget_allmaxr   int
reporthookr  r   r   r  r[  r   )r   r<   r_   fprY  r   blocknumbssizesizesrZ  r   s   &&&         r#   _download_to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                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s      D r1   c                	    R # rq   r   )r   r<   r_   r  blksizer  s   &&&&&&r#   r  PackageIndex.reporthook  s    r1   c           	     	>   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
InvalidURLrn   rr   r   r  r   r8   r   r   URLErrorreasonBadStatusLinelineHTTPExceptionOSError)r   r<   warningvargr   s   &&&   r#   r   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                T    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(?:(?<=([/\\]|:))\.\.(?=[/\\]|$))|(?:^\.\.(?=[/\\]|$)))rn   rc   r<  )r,   r   s   & r#   	_sanitizePackageIndex._sanitize*  s,    & (( 
  vvgtT**r1   c                    \        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'
__downloaded__z\.egg\.zip$rO   )rD   r  rc   r<  r^   r@   rn   )r   r<   rn  r,   	_fragments   &&&  r#   _resolve_download_filename'PackageIndex._resolve_download_filenameG  sW     +3/}}   	
 vvnfd3ww||F))r1   c                x    V P                  W4      pV P                  W4      ;'       g    V P                  W4      # )z"
Determine the download filename.
)r  _download_vcs_download_other)r   r<   rn  r_   s   &&& r#   rk  PackageIndex._download_url^  s8     223?!!#0WWD4H4H4WWr1   c                    \         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)	r8   r   urlsplitro  	partitionr~   r   nextiter)r<   ro  presep_postalloweds   &     r#   _resolve_vcsPackageIndex._resolve_vcse  sh     &&s+22 **3/%uenvS	'99:D#)400r1   c                	   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: r5   zDoing z clone from z to r  z--quietz-Ccheckoutz--cwdupz-rz-q)r  r  zChecking out )r  r   r  _vcs_split_rev_from_urlr   
subprocess
check_calldict)r   r<   spec_filenamevcsr_   r  revco_commandss   &&&     r#   r  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r1   c                	4   \         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)
r8   r   r  ro  r   url2pathnamer9   r@   r   _attempt_download)r   r<   r_   ro  s   &&& r#   r  PackageIndex._download_other  sm    &&s+22V>>..v||/D/DS/I/N/NOOC%%c44r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s     $ $t $r1   c                	*    V P                  VR 4       R# )TN)r   rC  s   &&r#   r:  PackageIndex.scan_url  s    d#r1   c                	    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)r   r<   r_   r   s   &&& r#   r  PackageIndex._attempt_download  sF    ##C2W[[4::<<..sXFFOr1   c                	J    \         P                  ! V4       \        R V 24      h)zUnexpected HTML page found at )r^   rX  r   )r   r<   r   r_   s   &&&&r#   r  #PackageIndex._invalid_download_html  s!    
		(=cUCDDr1   c                X   \         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  r5   @Nr   )ro  r@   rC   r6   )
r8   r   r  ro  r;   r@   r  
rpartition_replacegeturl)r<   r=   clean_schemeno_fragment_pathr  r  r  post
clean_pathr  resolveds   &          r#   r  $PackageIndex._vcs_split_rev_from_url  s     %%c*||))#q1"5 "'!5!5c!:!Q)44S9$),3+4,
>>	 " 

 &( 	 }r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     s      4 r1   c                	6    \         P                  ! V.VO5!   R # rq   )r   r   rG  s   &&*r#   r   PackageIndex.debug  s    		#r1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r           $ r1   c                	6    \         P                  ! V.VO5!   R # rq   )r   r   rG  s   &&*r#   r   PackageIndex.info      tr1   c                   V ^8  d   QhRR/# r   r   )r   s   "r#   r   r     r  r1   c                	6    \         P                  ! V.VO5!   R # rq   )r   r  rG  s   &&*r#   r  PackageIndex.warn  r   r1   )r   r   r   r   r   r   r   )zhttps://pypi.org/simple/)*NT)Frq   )FFFN)FF)/r   r   r   r   r   r   r   r   r   r   r"  r  r1  r   r9  rB  rO  rS  r[  rb  rR  rM  r4   rm  r  rl  r  r  r  r   staticmethodr  r   r  rk  r  r  r  r:  r  r  r  r   r   r  r   __classcell__r   s   @r#   r   r   ,  s   E- -$!31j'  ? 2 
:
&6) PDP?d'R L DN@ + +8 * *,X 1 1$25$E  > r1   z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c                P    V P                  ^ 4      p\        P                  ! V4      # )    )rK   r   unescape)rI   whats   & r#   decode_entityr    s    ;;q>D==r1   c                "    \        \        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  )texts   &r#   r   r     s     mT**r1   c                   a  V 3R  lpV# )c                   <a  V V3R  lpV# )c                    < \         P                  ! 4       p\         P                  ! S4        S! V / VB \         P                  ! V4       #   \         P                  ! T4       i ; irq   )socketgetdefaulttimeoutsetdefaulttimeout)rr   rs   old_timeoutrt   timeouts   *, r#   _socket_timeout@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeout  sN     224K$$W-6T,V,((5((5s   A A$r   )rt   r  r  s   f r#   r  'socket_timeout.<locals>._socket_timeout  s    	6 r1   r   )r  r  s   f r#   socket_timeoutr    s    	 r1   c                    \         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   )r8   r   r:   encodebase64	b64encoder   replace)authauth_s
auth_bytesencoded_bytesencodeds   &    r#   _encode_authr'    sR     \\!!$'FJ$$Z0M""$G??4$$r1   c                  <    ] 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'
r   usernamepasswordc                   V ^8  d   QhRR/# )rh   r   r   r   )r   s   "r#   r   Credential.__annotate__  s     2 2 2r1   c                	8    V P                    R V P                   2# )r  )r*  r+  r   s   &r#   __str__Credential.__str__  s    --$--11r1   r   N)r   r   r   r   r   __annotations__r/  r   r   r1   r#   r)  r)    s     MM2 2r1   r)  c                  D   a  ] tR tRtV 3R lt]R 4       tR tR tRt	V ;t
# )
PyPIConfigi  c                4  < \         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.pypircN)r*  r+  
repository)
r  fromkeysr   r   r^   r@   rn   
expanduserr  r   )r   defaultsrcr   s   &  r#   r   PyPIConfig.__init__  sf     ==!GL"WW\\"'',,S19=77>>"(2 r1   c                	    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 )r6  )sectionsr   r   r  r   _get_repo_cred)r   sectionsections_with_repositoriess   &  r#   creds_by_repositoryPyPIConfig.creds_by_repository'  sc      ==?&
*xx.446 G* 	# &
 C++-GHII&
s   (A' A'c                	    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# )r6  r*  r+  )r   r   r)  )r   r?  repos   && r#   r>  PyPIConfig._get_repo_cred1  s]    xx.446ZHHWj)//1HHWj)//1
 
 	
r1   c                    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)rA  itemsr+   )r   r<   r6  creds   &&  r#   find_credentialPyPIConfig.find_credential8  s:    
 !% 8 8 > > @J~~j)) !A r1   r   )r   r   r   r   r   propertyrA  r>  rI  r   r  r  s   @r#   r3  r3    s-    	3 J J
 r1   r3  c                   \         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 Authorizationz
User-Agent)r  https)r8   r   r9   r*   r  r  r  
_splituserr3  rI  r   r*  r   r   r'  
urlunparser   Request
add_header
user_agentr<   )r<   r   parsedro  netlocr@   paramsqueryr>  r"  addressrH  r   r=   r=  r   r  s2h2path2param2query2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Ir1   c                H    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  )hostuserdelims   &  r#   rO  rO  s  s,     ,DD**td**r1   c                    V # rq   r   )r<   s   &r#   
fix_sf_urlrd  ~  s    Jr1   c                   \         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 directoriesr3   z
index.htmlz	<a href="z">z</a>zB<html><head><title>{url}</title></head><body>{files}</body></html>r  )r<   filesOKr   zPath not foundz	Not foundr   z	text/html)r8   r   r9   r   r  r^   r@   isfiler   r*   r	  r  rn   r   r`  r   ioStringIOr   r   )r<   r>   _serverr@   _paramrB   _fragr_   rf  r  filepathbodyr   statusmessager   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Mr1   )r   rM   r0   rJ   rq   )   )br   
__future__r   r  configparserr   r   http.clientr  ri  r  r^   rc   r  r  r  sysurllib.errorr8   urllib.parseurllib.requestfnmatchr   	functoolsr   typingr   more_itertoolsr   
setuptoolspkg_resourcesr	   r
   r   r   r   r   r   r   r   r   r   r   r   r   setuptools.wheelr   unicode_utilsr   r   	distutilsr   distutils.errorsr   r   rH   Ir   r;  rI   r   r;   rV   __all___SOCKET_TIMEOUT__version__version_infomajorminorrS  r$   r0   rD   rM   rG   r`   rJ   rw   r{   r   r   r   r   r<  r  r  r   r  r'  r)  RawConfigParserr3  r   r   r  rO  rd  r  r   r1   r#   <module>r     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r1   