
    <6h                        d dl mZ d dlZd dlZd dlZd dlmZ d dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlZddlmZmZ ddlmZmZmZmZmZ ddlmZ ddlmZmZmZ dd	l m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* dd
l+m,Z,m-Z-  e	j\                  e/      Z0da1 e2ed      rdZ3n2ejh                  jk                  d      rdZ3nejh                  dk(  rdZ3ndZ3 ejl                  d      Z7e7sdejp                  dd z  Z7de7z   Z9e3e7z   Z: e*       jw                  dd      jw                  dd      Z< ejl                  d      Z=e=r6e=jk                  d      r%e=jw                  dd      j}                  d      d    Z=nd Z? e?       Z=[? ej                  dej                  ej                  z        ZC ej                  dej                  ej                  z        ZD ej                  d      ZE ej                  d      ZFd ZGd!ZHe
j                  d"k(  rd# ZJnd$ ZJejp                  d    d%k  rd dlKZKn
dZKd dlLZMd dlNZMd& ZOd' ZP G d( d)eQ      ZR eR       ZS G d* d+eQ      ZTd, ZUd- ZV eV       ZW[Vd/d.ZXy)0    )unicode_literalsN)message_from_file   )__version__DistlibException)	sysconfigZipFilefsdecode	text_typefilter)InstalledDistribution)MetadataWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)
FileOperatorconvert_path	CSVReader	CSVWriterCachecached_propertyget_cache_baseread_exportstempdirget_platform)NormalizedVersionUnsupportedVersionErrorpypy_version_infoppjavajycliipcppy_version_nodotz%s%s   py-_.SOABIzcpython-c                     dt         g} t        j                  d      r| j                  d       t        dk(  rt
        j                  d d }|dk  rqt        j                  d      }|d}|r| j                  d       |d	k  r@t        j                  d
      }|dk(  s|$t
        j                  dk(  r| j                  d       dj                  |       S )Nr#   Py_DEBUGdr%   )      WITH_PYMALLOCTm)r.   r.   Py_UNICODE_SIZE   i u )	
VER_SUFFIXr   get_config_varappend
IMP_PREFIXsysversion_info
maxunicodejoin)partsviwpmuss       ^/var/www/panel.atabookie.online/venv/lib/python3.12/site-packages/pip/_vendor/distlib/wheel.py_derive_abirC   ;   s    z"##J/LL!!"1%BF{..?;CLL%;"112CDBQw2:#..H2LS)wwu~    zz
(?P<nm>[^-]+)
-(?P<vn>\d+[^-]*)
(-(?P<bn>\d+[^-]*))?
-(?P<py>\w+\d+(\.\w+\d+)*)
-(?P<bi>\w+)
-(?P<ar>\w+(\.\w+)*)
\.whl$
z7
(?P<nm>[^-]+)
-(?P<vn>\d+[^-]*)
(-(?P<bn>\d+[^-]*))?$
s   \s*#![^\r\n]*s   ^(\s*#!("[^"]+"|\S+))\s+(.*)$s   #!pythons	   #!pythonw/c                     | S N os    rB   <lambda>rK   h   s     rD   c                 B    | j                  t        j                  d      S )NrE   )replaceosseprI   s    rB   rK   rK   j   s    2663/ rD   r.   c                      t         r%t        j                         D  cg c]  } | d   	 c} S t        j                  j                  S c c} w )Nr   )impget_suffixes	importlib	machineryEXTENSION_SUFFIXES)ss    rB   _get_suffixesrW   t   s:    
!..01!11""555 2s   Ac                    t         rt        j                  | |      S t        j                  j	                  | |      }t        j                  j                  |      }|t        j                  | <   |j                  j                  |       |S rG   )
rQ   load_dynamicrS   utilspec_from_file_locationmodule_from_specr:   modulesloaderexec_module)namepathspecmodules       rB   _load_dynamicrd   {   sg    
d++~~55dDA006"D'rD   c                   ,    e Zd Zd Zd Zd ZddZd Zy)Mounterc                      i | _         i | _        y rG   )impure_wheelslibsselfs    rB   __init__zMounter.__init__   s    	rD   c                 X    || j                   |<   | j                  j                  |       y rG   )rh   ri   update)rk   pathname
extensionss      rB   addzMounter.add   s$    '18$		$rD   c                     | j                   j                  |      }|D ]!  \  }}|| j                  v s| j                  |= # y rG   )rh   popri   )rk   ro   rp   kvs        rB   removezMounter.remove   sA    ''++H5
 	!DAqDII~IIaL	!rD   Nc                 .    || j                   v r| }|S d }|S rG   )ri   )rk   fullnamera   results       rB   find_modulezMounter.find_module   s&    tyy F  FrD   c                     |t         j                  v rt         j                  |   }|S || j                  vrt        d|z        t	        || j                  |         }| |_        |j                  dd      }t        |      dkD  r
|d   |_        |S )Nzunable to find extension for %sr)   r   r   )	r:   r]   ri   ImportErrorrd   
__loader__rsplitlen__package__)rk   rx   ry   r>   s       rB   load_modulezMounter.load_module   s    s{{"[[*F  tyy(!"Ch"NOO"8TYYx-@AF $FOOC+E5zA~%*1X"rD   rG   )__name__
__module____qualname__rl   rq   rv   rz   r   rH   rD   rB   rf   rf      s    %!rD   rf   c                       e Zd ZdZdZdZddZed        Zed        Z	ed        Z
ed	        Zd
 Zed        Zd ZddZd Zd Zd ZddZd Zd Zd Zd Zd Zd ZddZd Zd ZddZy) Wheelz@
    Class to build and install from Wheel files (PEP 427).
    )r   r   sha256Nc                    || _         || _        d| _        t        g| _        dg| _        dg| _        t        j                         | _	        | d| _
        d| _        | j                  | _        yt        j                  |      }|rQ|j!                  d      }|d   | _
        |d   j#                  d	d
      | _        |d   | _        | j                  | _        yt        j$                  j'                  |      \  }}t(        j                  |      }|st+        d|z        |r$t        j$                  j-                  |      | _	        || _        |j!                  d      }|d   | _
        |d   | _        |d   | _        |d   j'                  d      | _        |d   j'                  d      | _        |d   j'                  d      | _        y)zB
        Initialise an instance using a (valid) filename.
        r5   noneanyNdummyz0.1nmvnr(   r'   bnzInvalid name or filename: %rr&   r)   biar)signshould_verifybuildverPYVERpyverabiarchrN   getcwddirnamer`   versionfilename	_filenameNAME_VERSION_REmatch	groupdictrM   ra   splitFILENAME_REr   abspath)rk   r   r   verifyr1   infor   s          rB   rl   zWheel.__init__   s    	#W
8G	yy{DI DL!]]DN%%h/A{{2 J	#Dz11#s; $T
!%$&GGMM($;!%%h/* ,:<D,E F F#%77??7#;DL!){{2 J	#Dz $T
!$Z--c2
:++C0 J,,S1	rD   c                 R   | j                   rd| j                   z   }nd}dj                  | j                        }dj                  | j                        }dj                  | j                        }| j
                  j                  dd      }| j                  d||d|d|d|dS )zJ
        Build and return a filename from the various components.
        r'   r5   r)   r(   .whl)r   r=   r   r   r   r   rM   r`   )rk   r   r   r   r   r   s         rB   r   zWheel.filename   s    
 ==T]]*HH$hhtxx xx		",,&&sC0)-GXu),d4 	4rD   c                     t         j                  j                  | j                  | j                        }t         j                  j                  |      S rG   )rN   ra   r=   r   r   isfile)rk   ra   s     rB   existszWheel.exists   s1    ww||DLL$--8ww~~d##rD   c              #      K   | j                   D ]+  }| j                  D ]  }| j                  D ]	  }|||f   - y wrG   )r   r   r   )rk   r   r   r   s       rB   tagsz
Wheel.tags   sL     ZZ 	+Exx + II +Dd**++	+s   <>c                    t         j                  j                  | j                  | j                        }| j
                  d| j                  }d|z  }t        j                  d      }t        |d      5 }| j                  |       t        t        g}d }|D ]U  }	 t        j                  ||      }	|j                  |	      5 }
 ||
      }t        |      }|r	 d d d         n	 d d d        W |st#        ddj                  |      z        	 d d d        |S # 1 sw Y   5xY w# t         $ r Y w xY w# 1 sw Y   S xY w)Nr'   %s.dist-infoutf-8r)fileobjz8Invalid wheel, because metadata is missing: looked in %sz, )rN   ra   r=   r   r   r`   r   codecs	getreaderr	   get_wheel_metadatar   r   	posixpathopenr   KeyError
ValueError)rk   ro   name_verinfo_dirwrapperzffnsry   fnmetadata_filenamebfwfs               rB   metadatazWheel.metadata   sK   77<<dmm<"ii6!H,""7+Xs# 	Kr##B' +,DECF 	(1x(D%!23 "r$R[!)"!5!!	" " ""	   "9;?99S>"J K K +	K0 " "
   '	K0 sT   6%D5'D&DD&#D5&D&.!D5D#D&&	D2/D51D22D55D?c                 0   | j                   d| j                  }d|z  }t        j                  |d      }|j	                  |      5 } t        j                  d      |      }t        |      }d d d        t        |      S # 1 sw Y   t              S xY w)Nr'   r   WHEELr   )	r`   r   r   r=   r   r   r   r   dict)rk   r   r   r   r   r   r   messages           rB   r   zWheel.get_wheel_metadata  s    "ii6!H,%NN8W=WW&' 	,2*!!'*2.B'+G	, G}	, G}s   'BBc                     t         j                  j                  | j                  | j                        }t        |d      5 }| j                  |      }d d d        |S # 1 sw Y   S xY w)Nr   )rN   ra   r=   r   r   r	   r   )rk   ro   r   ry   s       rB   r   z
Wheel.info&  sT    77<<dmm<Xs# 	1r,,R0F	1	1s   AA'c                    t         j                  |      }|ru|j                         }|d | ||d  }}d|j                         v rt        }nt
        }t        j                  |      }|rd|j                         d   z   }nd}||z   }||z   }|S |j                  d      }|j                  d      }	|dk  s||	kD  rd}
n|||dz    d	k(  rd	}
nd}
t
        |
z   |z   }|S )
Ns   pythonw    rD         
r   r%   s   
)	
SHEBANG_REr   endlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind)rk   datar1   r   shebangdata_after_shebangshebang_pythonargscrlfterms              rB   process_shebangzWheel.process_shebang-  s    T"%%'C*.t*d34j'GW]]_,!0!/!''0Aahhjn,$t+G//D  5!B5!BAvb26?g-"D D!D(4/DrD   c                    || j                   }	 t        t        |      } ||      j                         }t        j                  |      j                  d      j                  d      }||fS # t        $ r t	        d|z        w xY w)NzUnsupported hash algorithm: %r   =ascii)
	hash_kindgetattrhashlibAttributeErrorr   digestbase64urlsafe_b64encoderstripdecode)rk   r   r   hasherry   s        rB   get_hashzWheel.get_hashK  s    I	.Wi0F $$&))&188>EEgN&    	."#C#,$- . .	.s   A- -Bc                     t        |      }|j                  |ddf       t        |      5 }|D ]  }|j                  |        	 d d d        y # 1 sw Y   y xY w)Nr5   )listr8   r   writerow)rk   recordsrecord_patharchive_record_pathwriterrows         rB   write_recordzWheel.write_recordW  sY    w-+R45{# 	%v %$%	% 	% 	%s   AAc                    g }|\  }}|D ]q  \  }}t        |d      5 }	|	j                         }
d d d        d| j                  
      z  }t        j                  j                  |      }|j                  |||f       s t        j                  j                  |d      }t        t        j                  j                  |d            }| j                  |||       |j                  ||f       y # 1 sw Y   xY w)Nrbz%s=%sRECORD)
r   readr   rN   ra   getsizer8   r=   to_posixr   )rk   r   libdirarchive_pathsr   distinfor   appfr   r   sizes                rB   write_recordszWheel.write_records^  s    !(" 	/EBa  !vvx t}}T22F77??1%DNNB-.	/ GGLL8,bggll8X67'1b)b!W%   s   C..C7	c                     t        |dt        j                        5 }|D ].  \  }}t        j	                  d||       |j                  ||       0 	 d d d        y # 1 sw Y   y xY w)NwzWrote %s to %s in wheel)r	   zipfileZIP_DEFLATEDloggerdebugwrite)rk   ro   r   r   r   r   s         rB   	build_zipzWheel.build_zipn  s\    XsG$8$89 	 R&  A62>B 	  	  	 s   4AA#c           
      
   |i }t        t        fdd            d   }|dk(  rd}t        g}t        g}t        g}nd}t
        g}dg}d	g}|j                  d
|      | _        |j                  d|      | _        |j                  d|      | _	        |   }	| j                  d| j                  }
d|
z  }d|
z  }g }dD ]N  }|vr	|   }t        j                  j                  |      s.t        j                  |      D ]  \  }}}|D ]  }t!        t        j                  j#                  ||            }t        j                  j%                  ||      }t'        t        j                  j#                  |||            }|j)                  ||f       |dk(  s|j+                  d      rt-        |d      5 }|j/                         }ddd       | j1                        }t-        |d      5 }|j3                  |       ddd         Q |	}d}t        j                  |      D ]  \  }}}||k(  r]t5        |      D ]F  \  }}t!        |      }|j+                  d      s#t        j                  j#                  ||      }||=  n |sJ d       |D ]y  }t!        |      j+                  d      rt        j                  j#                  ||      }t'        t        j                  j%                  ||            }|j)                  ||f       {  t        j6                  |      }|D ]l  }|dvst!        t        j                  j#                  ||            }t'        t        j                  j#                  ||            }|j)                  ||f       n d|xs | j8                  z  dt:        z  d|z  g}| j<                  D ]   \  }}}|j)                  d|d|d|       " t        j                  j#                  |d      }t-        |d      5 }|j3                  dj#                  |             ddd       t'        t        j                  j#                  |d            }|j)                  ||f       d  } t?        || !      }| jA                  ||f|	|       t        j                  j#                  | jB                  | jD                        }!| jG                  |!|       |!S # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w)"z
        Build a wheel from files in specified paths, and use any specified tags
        when determining the name of the wheel.
        Nc                     | v S rG   rH   )rJ   pathss    rB   rK   zWheel.build.<locals>.<lambda>|  s    qEz rD   )purelibplatlibr   r  falsetruer   r   r   r   r   r'   %s.datar   )r   headersscriptsr  .exer   wb
.dist-infoz(.dist-info directory expected, not found)z.pycz.pyo)r   	INSTALLERSHAREDr   zWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %szTag: r   r  
c                 H    | d   }|j                  d      }d|v r|dz  }||fS )Nr   rE   r  i'  )count)tr   ns      rB   sorterzWheel.build.<locals>.sorter  s2    1BAr!U
r7NrD   )key)$r   r   IMPVERABIARCHr   getr   r   r   r`   r   rN   ra   isdirwalkr
   r=   relpathr   r8   endswithr   r   r   r  	enumeratelistdirwheel_versionr   r   sortedr  r   r   r	  )"rk   r  r   r*  libkeyis_puredefault_pyverdefault_abidefault_archr   r   data_dirr   r   r  ra   rootdirsfilesr   r   rpr   r   r   r   idnwheel_metadatar   r   r   r  ro   s"    `                                rB   buildzWheel.buildt  s   
 <Df13IJKANYG#HM%K 6LG"GM!(K!7LXXg}5
88E;/HHV\2	v"ii6x'!H, 2 	.C%:Dww}}T")+ .%D$# 
.$RWW\\$%;<WW__Q5%bggll8S"&EF%,,b!W5)+AJJv4F!%a 0!'(vvx0#'#7#7#=D!%a .! !. .
..	.( !# 	.D$t| 't_ EAr!"B{{<0#%77<<b#9 G  K!KKx .B<(()9:GGLLr*bggooa67$$b!W-.	.* 

8$ 	.BCCRWW\\(B78bggll8R89$$b!W-		. #m&It7I7IJ#k1!G+

 !%		 	HE3!!UC"FG	HGGLL7+!S\ 	/QGGDIIn-.	/bggll8W56b!W%	 }&9 	Hh/G77<<dmm<x/M0 0. .V	/ 	/s$   :S'	0S4	!T'S14S>T
c                 $    |j                  d      S )zl
        Determine whether an archive entry should be skipped when verifying
        or installing.
        )rE   z/RECORD.jws)r'  )rk   arcnames     rB   
skip_entryzWheel.skip_entry  s      455rD   c           	         |j                   }|j                  d      }|j                  dd      }|j                  dd      }t        j                  j	                  | j
                  | j                        }| j                  d| j                  }	d|	z  }
d|	z  }t        j                  |t              }t        j                  |d      }t        j                  |d	      }t        j                  d
      }t        |d      5 }|j                  |      5 } ||      }t        |      }ddd       d   j!                  dd      }t#        |D cg c]  }t%        |       c}      }|| j&                  k7  r|r || j&                  |       |d   dk(  r|d   }n|d   }i }|j                  |      5 }t)        |      5 }|D ]  }|d   }|||<    	 ddd       ddd       t        j                  |
d      }t        j                  |d      }t        j                  |
dd      }t+        |      } d| _        t.        j0                   }!g }"t3        j4                         }#|#|_        d|_        	 |j;                         D ]  }$|$j                  }%t=        |%t>              r|%}&n|%jA                  d
      }&| jC                  |&      rF||&   }|d   r)tE        |$jF                        |d   k7  rtI        d|&z        |d   rj|d   j!                  dd      \  }'}(|j                  |%      5 }|jK                         })ddd       | jM                  )|'      \  }*}+|+|(k7  rtI        d|%z        |r+|&jO                  ||f      rtP        jS                  d|&       |&jO                  |      xr |&jU                  d       },|&jO                  |      rC|&j!                  d d      \  }*}-}.t        j                  j	                  ||-   tW        |.            }/n1|&||fv rt        j                  j	                  |tW        |&            }/|,s	|j                  |%      5 }| jY                  ||/       ddd       t        j                  d!k(  r&t        jZ                  |/|$j\                  d"z	  d#z         |"j_                  |/       |sS|d   rNt        |/d$      5 }|jK                         })| jM                  |)'      \  }*}0|0+k7  rtI        d%|/z        	 ddd       |!s|/jU                  d&      s	 | ja                  |/|'      }1|"j_                  |1       t        j                  jg                  tW        |%            }2t        j                  j	                  |#|2      }3|j                  |%      5 }| jY                  ||3       ddd       t        j                  j!                  |/      \  }4}2|4|_        |ji                  |2      }5| jk                  |5       |"jm                  |5        |rtP        jS                  d*       d}6nd}7| jn                  d   }|d+k(  rt        j                  |d,      }8	 |j                  |8      5 }tq        |      }9ddd       i }7d-D ]  }:d.|:z  };|;9v si x|7d/|:z  <   }<|9|;   js                         D ]Y  }=|=jt                  d0|=jv                  }>|=jx                  r!|>d1d2j	                  |=jx                        z  z  }>|>|<|=j                  <   [  nZ	 |j                  |      5 } ||      }t{        j|                  |      j                  d4      }7|7r|7j                  d5      }7ddd       |7r|7j                  d7i       }?|7j                  d8i       }@|?s@r|j                  dd      }At        j                  j                  |A      st        d9      A|_        |?j                         D ].  \  };}=|;d:|=}B|ji                  |B      }5| jk                  |5       0 @rFd;di}C@j                         D ]/  \  };}=|;d:|=}B|ji                  |BC      }5| jk                  |5       1 t        j                  j	                  ||      }t        |      }6t        |      }|d= |d= ||d<<   |6j                  ||      }|r|"j_                  |       |6j                  |"|d=   |       |6t        j                  |#       cddd       S # 1 sw Y   xY wc c}w # 1 sw Y   DxY w# 1 sw Y   IxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   GxY w# tb        $ r tP        je                  d(d)       Y w xY w# 1 sw Y   xY w# 1 sw Y   
xY w# tb        $ r tP        je                  d3       Y Gw xY w# 1 sw Y   UxY w# tb        $ r tP        je                  d6       Y yw xY w# tb        $ r' tP        j                  d>       | j                           w xY w# t        j                  |#       w xY w# 1 sw Y   yxY w)?a~  
        Install a wheel to the specified paths. If kwarg ``warner`` is
        specified, it should be a callable, which will be called with two
        tuples indicating the wheel version of this software and the wheel
        version in the file, if there is a discrepancy in the versions.
        This can be used to issue any warnings to raise any exceptions.
        If kwarg ``lib_only`` is True, only the purelib/platlib files are
        installed, and the headers, scripts, data and dist-info metadata are
        not written. If kwarg ``bytecode_hashed_invalidation`` is True, written
        bytecode will try to use file-hash based invalidation (PEP-552) on
        supported interpreter versions (CPython 2.7+).

        The return value is a :class:`InstalledDistribution` instance unless
        ``options.lib_only`` is True, in which case the return value is ``None``.
        warnerlib_onlyFbytecode_hashed_invalidationr'   r  r   r   r   r   r   NzWheel-Versionr)   r   zRoot-Is-Purelibr  r  r  streamr   r5   r  )dry_runTr%   size mismatch for %s=digest mismatch for %szlib_only: skipping %sr  rE   posix   i  r   zdigest mismatch on write for %sz.py)hashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)consoleguiz
%s_scriptszwrap_%s:z [%s],zAUnable to read legacy script metadata, so cannot generate scriptsrp   zpython.commandsz8Unable to read JSON metadata, so cannot generate scriptswrap_consolewrap_guizValid script path not specifiedz = rL  libprefixzinstallation failed.)JrC  r#  rN   ra   r=   r   r   r`   r   r   r   r   r   r	   r   r   r   tupleintr*  r   r   recordr:   dont_write_bytecodetempfilemkdtemp
source_dir
target_dirinfolist
isinstancer   r   r<  str	file_sizer   r   r   
startswithr  r  r'  r   copy_streamchmodexternal_attrr8   byte_compile	Exceptionwarningbasenamemakeset_executable_modeextendr   r   valuesrR  suffixflagsjsonloadr$  r   itemsr   r   write_shared_locationswrite_installed_filesshutilrmtree	exceptionrollback)Drk   r  makerkwargsrC  r>  r?  bc_hashed_invalidationro   r   r1  r   metadata_namewheel_metadata_namerecord_namer   r   bwfr   r   wvr6  file_versionr   r   r   readerr   r   data_pfxinfo_pfx
script_pfxfileopbcoutfilesworkdirzinfor;  	u_arcnamekindvaluer   r(   r   	is_scriptwherer5  outfile	newdigestpycr   worknamer7  	filenamesdistcommandsepepdatar  rt   r-   ru   rV   console_scriptsgui_scripts
script_dirscriptoptionssD                                                                       rB   installzWheel.install  s	   " --H%::j%0!',J,1"3 77<<dmm<"ii6x'!H,!x1IJ'nnXw?nnXx8""7+Xs# L	'r,- 0S\+B/0 )//Q7B "!5Q#a&!56L 2 22t))<8()V3y)y)G% )b) )V% )F%(
))) !~~h3H ~~h3H")R@J "'2F FM,,,BH &&(G  'E#Ec'[[] M3E#nnG!'95$+	$+NN7$;	y1 !),C1v#eoo"6#a&"@. 046?0@ A A1v&)!fll3&:eWWW- -#%779D-$(MM$$=	6!U?"2 48:A4B #C C  I$8$8(H9M$N%<iH !*!5!5j!A "D)2););F)C%C  !++H5'0sA'>5""$'',,uU|\"=M"N %)<k(JJ$"$'',,v|I7N"O$WWW- <"..r7;< 77g-HHW&+&9&9R&?5%HJ 0&3q6!%gt!4 K')wwy/3}}T4/H9#,#6*: <@BI<J +K %K $7K '"2"25"9	>&,&9&9$+8N ': 'P !) 4  WW--l7.CD#%77<<#<WWW- ="..r8<= "$w!7B+-($)JJrN	229= 	2[M3^ LL!;<D  $H#'99_#=L#u,&^^H6HI6!# ;)5c):;')H'9 6$03$6#$;DF$FHY_$=-3AY-=-=-? %678xx,J+,77,-388AGG;L1L,LA45!&&		%6	6F!#!7 O3%,S\+/99R=+<+<\+J#+/7||<M/NH	O  *2,,~r*J&.ll:r&B*k).9b)AJ#%77==#<&0 2= '> !>/9E,(7(=(=(? F167);,1JJv,>	 & : :9 EF
  ++0$-,7,=,=,? !JDAq:;Q-?F05

670KI$*$>$>y$I!J
 VX6A03D !KEi(i(#)E%L33E7CA * ..xx/68 g&YL	' L	'0 0 "6) )) )R- -,< <K K $- > !'/H8< !/ !>>= =0; ;  ) 6"NN ,5 66O O
  ) F"NN ,E FFP    !78!
 g&YL	' L	's  h9d(&h9d
 Ah91d >dd Bh9-B7g,$d-5Dg,d:#A%g,9e
g,g,"$eAg,!e;4B.g,#f4f fA;fg,g'A f:'g/E3g,"h9d	h9dd  d*	%h9-d72g,:e?g,eg, e84g,7e88g,;f g,f	ff73g,6f77g,:g	?gg)%g,(g))g,,0hhh66h99ic                     t         Qt        j                  j                  t	               t        d      dt        j                  d d z        }t        |      a t         S )Nzdylib-cachez%s.%sr%   )	cacherN   ra   r=   r   r]  r:   r;   r   )rk   bases     rB   _get_dylib_cachezWheel._get_dylib_cache  sI    =77<< 0#m2D '#*:*:2A*> >@D$KErD   c           	         t         j                  j                  | j                  | j                        }| j
                  d| j                  }d|z  }t        j                  |d      }t        j                  d      }g }t        |d      5 }	 |j                  |      5 } ||      }	t        j                  |	      }
| j                         }|j                  |      }t         j                  j                  |j                   |      }t         j                  j#                  |      st        j$                  |       |
j'                         D ]  \  }}t         j                  j                  |t)        |            }t         j                  j+                  |      sd}npt        j,                  |      j.                  }t0        j0                  j3                  |      }|j5                  |      }t1        j0                  |j6                   }||kD  }|r|j9                  ||       |j;                  ||f        	 d d d        d d d        |S # 1 sw Y   xY w# t<        $ r Y !w xY w# 1 sw Y   |S xY w)Nr'   r   
EXTENSIONSr   r   T)rN   ra   r=   r   r   r`   r   r   r   r   r	   r   rm  rn  r  prefix_to_dirr  r$  makedirsro  r   r   statst_mtimedatetimefromtimestampgetinfo	date_timeextractr8   r   )rk   ro   r   r   r;  r   ry   r   r   r   rp   r  rR  
cache_baser`   r&  destr  	file_timer   
wheel_times                        rB   _get_extensionszWheel._get_extensions  s   77<<dmm<"ii6!H,..<8""7+Xs# 	rWWW% 4 B!%2J 113E"00:F!#ejj&!AJ77==4J/)3)9)9); 4g!ww||JW8MN!ww~~d3&*G(*(>(>I(0(9(9(G(G ))+I#%::g#6D)1):):DNN)KJ&09&<G"JJw
;tTl344	4 14 4,  1	4 sC   I&I!FI9II	I	I# I&"I##I&&I0c                     t        |       S )zM
        Determine if a wheel is compatible with the running system.
        )is_compatiblerj   s    rB   r  zWheel.is_compatible  s     T""rD   c                      y)zP
        Determine if a wheel is asserted as mountable by its metadata.
        TrH   rj   s    rB   is_mountablezWheel.is_mountable  s     rD   c                    t         j                  j                  t         j                  j                  | j                  | j
                              }| j                         sd|z  }t        |      | j                         sd|z  }t        |      |t        j                  v rt        j                  d|       y |r t        j                  j                  |       n t        j                  j                  d|       | j                         }|rPt        t        j                   vr#t        j                   j                  t               t        j#                  ||       y y )Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr   )rN   ra   r   r=   r   r   r  r   r  r:   r  r  r8   insertr  _hook	meta_pathrq   )rk   r8   ro   msgrp   s        rB   mountzWheel.mount!  s    77??277<<dmm#LM!!#=HC"3''  "88CC"3''sxxLL-x8)8,--/J-MM((/		(J/ rD   c                    t         j                  j                  t         j                  j                  | j                  | j
                              }|t        j                  vrt        j                  d|       y t        j                  j                  |       |t        j                  v rt        j                  |       t        j                  s;t        t        j                  v r$t        j                  j                  t               y y y )Nz%s not in path)rN   ra   r   r=   r   r   r:   r  r  rv   r  rh   r  )rk   ro   s     rB   unmountzWheel.unmount6  s    77??277<<dmm#LM388#LL)84HHOOH%5...X&&&CMM)MM((/ * 'rD   c                    t         j                  j                  | j                  | j                        }| j
                  d| j                  }d|z  }t        j                  |d      }t        j                  |d      }t        j                  d      }t        |d      5 }|j                  |      5 } ||      }	t        |	       d d d        i }
|j                  |      5 }t        |      5 }|D ]  }|d   }||
|<    	 d d d        d d d        |j                         D ]
  }|j                  }t        |t               r|}n|j#                  d      }|j%                  d	      }d
|v rt'        d|z        | j)                  |      ri|
|   }|d   r)t+        |j,                        |d   k7  rt'        d|z        |d   s|d   j%                  dd      \  }}|j                  |      5 }|j/                         }d d d        | j1                  |      \  }}||k7  st'        d|z         	 d d d        y # 1 sw Y   uxY w# 1 sw Y   GxY w# 1 sw Y   LxY w# 1 sw Y   dxY w# 1 sw Y   y xY w)Nr'   r   r   r   r   r   rA  r   rE   ..invalid entry in wheel: %rr%   rD  r   rE  rF  )rN   ra   r=   r   r   r`   r   r   r   r   r	   r   r   r   r[  r\  r   r   r   r   r<  r]  r^  r   r   )rk   ro   r   r   rz  r{  r   r   r|  r   r   r   r  r   r   r  r;  r  r  r  r   r(   r   s                          rB   r   zWheel.verifyB  sv   77<<dmm<"ii6!H, (nnXw?nnXx8""7+Xs# *	?r,- &S\!"%& G% )b) )V% )F%(
)))  ?..gy1 'I 'w 7I OOC(19* ,79B,C D D ??9-i(q6c%//2c!f<* ,02;,< = =q6"%a&,,sA"6KD%) )R!wwy) $dD 9IAv. 046=0> ? ?5?*	? *	?& &) )) )8) )K*	? *	?sy   "I.4H;I.#I0IIB9I.)I..I"?"I."I.;I	 I.III	I."I+'I..I7c           	         d }d }t         j                  j                  | j                  | j                        }| j
                  d| j                  }d|z  }t        j                  |d      }	t               5 }
t        |d      5 }i }|j                         D ]  }|j                  }t        |t              r|}n|j                  d      }||	k(  r9d|v rt        d	|z        |j                  ||
       t         j                  j                  |
t!        |            }|||<    	 d
d
d
        ||      \  }} ||fi |}|r  |||      \  }}|r||k(  r	 |||       |1t#        j$                  dd|
      \  }}t        j&                  |       nWt         j                  j)                  |      st        d|z        t         j                  j                  || j                        }t+        |j-                               }t         j                  j                  |
|      }||f}| j/                  ||
|       | j1                  ||       |t3        j4                  ||       d
d
d
       |S # 1 sw Y   LxY w# 1 sw Y   S xY w)a  
        Update the contents of a wheel in a generic way. The modifier should
        be a callable which expects a dictionary argument: its keys are
        archive-entry paths, and its values are absolute filesystem paths
        where the contents the corresponding archive entries can be found. The
        modifier is free to change the contents of the files pointed to, add
        new entries and remove entries, before returning. This method will
        extract the entire contents of the wheel to a temporary location, call
        the modifier, and then use the passed (and possibly updated)
        dictionary to write a new wheel. If ``dest_dir`` is specified, the new
        wheel is written there -- otherwise, the original wheel is overwritten.

        The modifier should return True if it updated the wheel, else False.
        This method returns the same value the modifier returns.
        c                 x    d x}}|dt         }|| vrd|z  }|| v r| |   }t        |      j                  }||fS )NrE   z%s/PKG-INFOra   )r   r   r   )path_mapr   r   ra   r  s        rB   get_versionz!Wheel.update.<locals>.get_version  sS    !!Gd%'?@C("#h.h}"-55D= rD   c                 
   d }	 t        |        | j                  d      }|dk  rd| z  }nZ| |dz   d  j                  d      D cg c]  }t        |       }}|dxx   dz  cc<   | d | ddj	                  d |D              }|rSt        |
      }||_	        |j                  t              }|j                  ||       t        j                  d| |       y y c c}w # t
        $ r t        j                  d	|        Y |w xY w)Nr'   r   z%s+1r   r)   r   +c              3   2   K   | ]  }t        |        y wrG   )r]  ).0r6  s     rB   	<genexpr>z7Wheel.update.<locals>.update_version.<locals>.<genexpr>  s      ?/#$A?/s   z0Cannot update non-compliant (PEP-440) version %rr  )ra   legacyzVersion updated from %r to %r)r   r   r   rT  r=   r   r  r  r   r   r'  r   r  )r   ra   updatedr6  rV   r>   mdr  s           rB   update_versionz$Wheel.update.<locals>.update_version  s
   G+!'*LL%q5$w.G-4QUV_-B-B3-GHSVHEH"INI)0!chh ?/(-?/ 7/ 0G 4($
'?@d62<gwO  I + +!")++s$   A C  C/C  C   DDr'   r   r   r   r   r  r  Nr   zwheel-update-)rk  rR  dirzNot a directory: %r)rN   ra   r=   r   r   r`   r   r   r   r	   r[  r\  r   r   r   r  r   rW  mkstempcloser$  r   ro  r  r	  rr  copyfile)rk   modifierdest_dirrw  r  r  ro   r   r   r{  r  r   r  r  r;  r  ra   original_versionr(   modifiedcurrent_versionfdnewpathr   r   r   s                             rB   rn   zWheel.updatez  sa   "	!	P. 77<<dmm<"ii6!H,nnXx8Y -	7'3' /2[[] /E#nnG!'95$+	$+NN7$;	 K/ y(. 0;=F0G H HJJug.77<<i1HID*.HY'//$ #.h"Aa3F3H(3Hh(G%";K(K"?D9#"*"2"2&:I7>#@KB HHRL77==2./D/708 9 9 ggll8T]]CG $X^^%5 677<<:)""4-@w6#OOGX6[-	7\ [/ /-	7\ s&   ;J B I3)E J 3I=	8J  J
)NFFrG   )NN)F)r   r   r   __doc__r*  r   rl   propertyr   r   r   r   r   r   r   r   r   r   r  r	  r9  r<  r  r  r  r  r  r  r  r   rn   rH   rD   rB   r   r      s     MI'2R 4 4  $ $ + +  >  <
!%&  sj6 n'`!F#0*
06?pdrD   r   c                      dd l } | j                         }g }|d   dk(  rP|d   j                  d      D ].  }|j                  |j	                         rt        |      nd       0 t        |      }|S )Nr   glibcr   r)   )platformlibc_verr   r8   isdigitrT  rS  )r  verry   rV   s       rB   _get_glibc_versionr    sh    



CF
1vQc" 	8AMMAIIK#a&Q7	8vMrD   c                  b   t         g} t         d   }t        t        j                  d   dz
  dd      D ]-  }| j	                  dj                  |t        |      g             / g }t               D ]8  }|j                  d      s|j	                  |j                  dd      d          : |j                          t        dk7  r|j                  dt               |j	                  d       g }t        g}t        j                  d	k(  rt        j                   d
t              }|r|j#                         \  }}}}	t%        |      }|	g}
|	dv r|
j	                  d       |	dv r|
j	                  d       |	dv r|
j	                  d       |	dv r|
j	                  d       |	dv r|
j	                  d       |dk\  r:|
D ]*  }|d|d|d|}|t        k7  s|j	                  |       , |dz  }|dk\  r:|D ]`  }|D ]W  }	|j	                  dj                  t&        | d   f      ||	f       |dk7  s6t        j                  j                  d      sV|	j)                  dd      }	t+               }t-        |      dk(  s|dk\  r/|j	                  dj                  t&        | d   f      |d|	z  f       |dk\  r/|j	                  dj                  t&        | d   f      |d|	z  f       |dk\  r/|j	                  dj                  t&        | d   f      |d|	z  f       |j	                  dj                  t&        | d   f      |d|d   d|d   d|	f       Z c t/        |       D ]`  \  }}|j	                  dj                  t&        |f      ddf       |dk(  s5|j	                  dj                  t&        |d   f      ddf       b t/        |       D ]X  \  }}|j	                  dj                  d |f      ddf       |dk(  s1|j	                  dj                  d |d   f      ddf       Z t1        |      S )!zG
    Return (pyver, abi, arch) tuples compatible with this Python.
    r   r   r   r5   z.abir)   r%   r   darwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcfat)r  r  x86_64fat3)ppc64r  fat64)r  r  intel)r  r  r  r  r  	universalr(   linuxlinux_)r%      zmanylinux1_%s)r%      zmanylinux2010_%s)r%      zmanylinux2014_%s
manylinux_r   r&   )r6   ranger:   r;   r8   r=   r]  rW   r_  r   sortr!  r  r"  r  rer   r   rT  r9   rM   r  r   r(  set)versionsmajorminorabisrk  ry   archesr1   r`   r   matchesr   rV   r   r>   r6  r   s                    rB   compatible_tagsr    s    |HqMEs''*Q.B7 6E
 3456 D/ 1V$KKS!,Q/01 	IIK
f}AsKKFVF
||xHH0$7'(xxz$D%JEfG&u%00v&**w'))w'BB{+1*$ )E)-ueUCADya() 
 1*  M 	MDMM277J#<=sDIJf}!8!8!A||Hb1*,u:?rww
HQK/H'I3'6'='? @'rww
HQK/H'I3'9D'@'B C'rww
HQK/H'I3'9D'@'B CMM*hqk!:;S16q58TJLM!	MM,  ) N
7rww
G45vuEF6MM277J
#;<feLMN  ) H
7rwwg/?@6MM277D'!*#56FGH
 v;rD   c                     t        | t              st        |       } d}|t        }|D ]7  \  }}}|| j                  v s|| j                  v s%|| j
                  v s4d} |S  |S )NFT)r\  r   COMPATIBLE_TAGSr   r   r   )wheelr   ry   r  r   r   s         rB   r  r  A  so    eU#eF| S$%++#"2tuzz7IFM	 MrD   rG   )Y
__future__r   r   r   r  emailr   r   rm  loggingrN   r   r  rr  r:   rW  r  r5   r   r   compatr   r	   r
   r   r   databaser   r   r   r   r   rZ   r   r   r   r   r   r   r   r   r   r   r   r   r   	getLoggerr   r  r  hasattrr9   r  r_  r7   r6   r;   r   r   rM   r"  r!  r   rC   compile
IGNORECASEVERBOSEr   r   r   r   r   r   rO   r   rQ   importlib.machineryrS   importlib.utilrW   rd   objectrf   r  r   r  r  r  r  rH   rD   rB   <module>r     sd   (    #    	  	  
   + C C + Q Q! ! ! @			8	$
3#$J\\V$J\\UJJ%Y%%&89
#**2A..Jz	j	 ~c3'//S9iw'3>>*%
++j$
'
-
-c
21
5C$ -Cbjj ]]RZZ	! "** ]]RZZ! RZZ)*
BJJ@A 66S=H/HA
C6	"f "J 		oF odM` "#
rD   