Current File : //proc/2/root/proc/3/root/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyo
�
�wMVc@�s5dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZddl
mZddlmZmZddlmZmZddlmZdd lmZdd
lmZddlmZmZmZddlm Z dd
l!m"Z"ddlm Z dZ#d$Z$dd%d�Z%ye&d�Z'Wne(k
r�d�Z'nXd�Z)d�Z*ej+dej,�Z-d�Z.d�Z/e0dde2ddd�Z3d�Z4e4d��Z5d�Z6d�Z7d e8fd!��YZ9d"e8fd#��YZ:dS(&sH
Support for installing and building the "wheel" binary package format.
i����(twith_statementN(turlsafe_b64encode(tParser(tConfigParsertStringIO(tInvalidWheelFilenametUnsupportedWheel(tdistutils_scheme(tlogger(t
pep425tags(tcall_subprocesstnormalize_pathtmake_path_relative(t
pkg_resources(tScriptMakers.whliitsha256icC�s�tj|�}d}t|d��O}|j|�}x6|rn|t|�7}|j|�|j|�}q9WWdQXdt|j��jd�j d�}||fS(s6Return (hash, length) for path using hashlib.new(algo)itrbNssha256=tlatin1t=(
thashlibtnewtopentreadtlentupdateRtdigesttdecodetrstrip(tpathtalgot blocksizethtlengthtftblockR((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytrehash"s
(cC�s t|t�r|jd�S|S(Ntascii(t
isinstancetunicodetencode(ts((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytbinary1s
cC�s t|t�r|jd�SdS(NR$(R%tstrR'(R(((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyR)6scC�sItjddkr"i}d}nidd6}d}t||||�S(Niitbttnewline(tsystversion_infoR(tnametmodetnltbin((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytopen_for_csv:s
cC�s�tjj|�r�t|d�}zj|j�}|jtd��sItStj j
tj��}td�|ttj�}|j
�}Wd|j�Xt|d�}z|j|�|j|�Wd|j�XtSdS(sLReplace #!python with #!/path/to/python
Return True if file was changed.Rs#!pythons#!Ntwb(tosRtisfileRtreadlinet
startswithR)tFalseR.t
executableR'tgetfilesystemencodingtlinesepRtclosetwritetTrue(Rtscriptt firstlinetexenametrest((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt
fix_scriptCs
sZ^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
\.dist-info$c C�s�|jdd�}x�tj|�D]�}tj|�}|r"|jd�|kr"ttjj||d���:}x0|D](}|j �j
�}|dkrztSqzWWdQXq"q"WtS(sP
Return True if the extracted wheel in wheeldir should go into purelib.
t-t_R0tWHEELsroot-is-purelib: trueN(
treplaceR6tlistdirtdist_info_retmatchtgroupRRtjointlowerRR@R:(R0twheeldirtname_foldedtitemRLtwheeltline((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytroot_is_purelib]s!
cC�s�tjj|�siifSt|��N}t�}x.|D]&}|j|j��|jd�q;W|jd�WdQXtj �}|j
|�i}i}|jd�r�t|j
d��}n|jd�r�t|j
d��}n||fS(Ns
itconsole_scriptstgui_scripts(R6RtexistsRRR?tstriptseekRtRawConfigParsertreadfpthas_sectiontdicttitems(tfilenametfptdataRTtcptconsoletgui((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytget_entrypointsms"
c %�s5|s't|d|d|d|�}nt|��rC|d�n
|d�g�g��jtjj�tjj} i�t��g}
|r�tj| dt dt �nd��t
�����fd �� d'd'��� �
fd
�}|| �t �tjj�dd�}t
|�\����fd
�}
x��D]�}d'}d'}x�tjtjj�|��D]e}d'}|dkr�t}|
}ntjj�||�} ||}|| |t
d|d|�qyWqHWtd'|d��td(��_t �_�fd�}|�_d�_�jdd'�}|r:dtjkr|d|}|
j�j|��ntjjdd�dkr�dtjd |f}|
j�j|��ndtjd |f}|
j�j|��g�D]}tjd|�r�|^q�}x|D]
}�|=q&Wn�jdd'�}|r�dtjkr�d|}|
j�j|��ndtjd |f}|
j�j|��g�D]}tjd|�r�|^q�}x|D]
}�|=q�Wnt��dkr?|
j�jg�j �D]}d |^q"��nt��dkr�|
j�jg�j �D]}d |^qjit d!6��ntjj�dd"�}tjj�dd#�}t!|d$��M}t!|d%��5}t"j#|�}t"j$|�} xj|D]b}!�j|!d|!d�|!d<|!d�krat%|!d�\|!d<|!d&<n| j&|!�qWxu|
D]m}"t%|"�\}#}$|r�|"j'|�r�tjjtjtjj(|"|��}"n| j&|"|#|$f�qyWx(�D] }"| j&�|"ddf�q�WWd'QXWd'QXt)j*||�d'S()sInstall a wheeltuserthometroottpurelibtplatlibtforcetquietcS�st||�jtjjd�S(Nt/(RRIR6Rtsep(tsrctp((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytnormpath�sc�sB�|��}�|��}|�|<|r>�j|�ndS(s6Map archive RECORD paths to installation RECORD paths.N(tadd(tsrcfiletdestfiletmodifiedtoldpathtnewpath(tchangedt installedtlib_dirRrRP(s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytrecord_installed�s
c�s
tjj|�s"tj|�nx�tj|�D]�\}}}|t|�jtjj�}tjj||�} |r�|j tjjd�dj
d�r�q2nx�|D]�}
tjj|||
�}|r�|dkr�|j
d�r��j|
�q�q�|r�|
j
d�r�|
j�j
�jjdd�j��r��j|�q�q�Wx�|D]�}|rw||�rwqYntjj||�}
tjj|||�}tjj| �s�tj| �ntj|
|�t}|r�||�}n�|
||�qYWq2WdS(Niis.dataR,s
.dist-infoRFRG(R6RRXtmakedirstwalkRtlstripRoRNtsplittendswithtappendROR9tproject_nameRItshutiltcopy2R:(tsourcetdesttis_basetfixertfiltertdirtsubdirstfilestbasedirtdestdirR(t
destsubdirR!RtRuRy(t data_dirstinfo_dirR|treq(s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytclobber�s8+
!
*
isentry_points.txtc�s�|j�jd�r"|d }nJ|j�jd�rD|d }n(|j�jd�rf|d }n|}|�kp�|�kS(Ns.exei����s
-script.pyi����s.pya(ROR�(R0t matchname(RdRe(s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytis_entrypoint_wrapper�s
tscriptsR�R�R,c�s6�ji|jd6|jjd�dd6|jd6S(Ntmodulet.itimport_nametfunc(tscript_templatetprefixtsuffixR�(tentry(tmaker(s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt_get_script_text s
s�# -*- coding: utf-8 -*-
import re
import sys
from %(module)s import %(import_name)s
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(%(func)s())
tpiptENSUREPIP_OPTIONSspip = t
altinstalls
pip%s = %siispip(\d(\.\d)?)?$teasy_installseasy_install = seasy_install-%s = %sseasy_install(-\d\.\d)?$s%s = %sRetRECORDs
RECORD.piptrsw+iN(R,(+RRURR6RRotsett
compilealltcompile_dirR@R:tNoneRNRfRJRERtvariantstset_modeR�R�tpoptenvirontextendtmaketgetR.tversiontreRLRt
make_multipleR_R4tcsvtreadertwriterR#twriterowR9trelpathR�tmove(%R0R�RPRgRhRit pycompiletschemetstrip_file_prefixR�t generatedR�tep_fileR�tdatadirR�R�tsubdirR�R�t
pip_scripttspectktpip_epteasy_install_scriptteasy_install_eptkvtrecordttemp_recordt record_int
record_outR�R�trowR!Rtl((RyRdR�ReR�RzR{R�RrR|R�RPs:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytmove_wheel_files�s�!
(
%
$
#
+
6@
!
*
*c�s"tj���fd��}|S(Nc?�sHt�}x8�||�D]'}||kr|j|�|VqqWdS(N(R�Rs(targstkwtseenRR(tfn(s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytuniquevs
(t functoolstwraps(R�R�((R�s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt_uniqueuscc�s�ddlm}tj||jd���}x�|D]y}tjj|j|d�}|V|j d�r5tjj
|�\}}|d }tjj||d�}|Vq5q5WdS( s
Yield all the uninstallation paths for dist based on RECORD-without-.pyc
Yield paths to all the files in RECORD. For each .py file in RECORD, add
the .pyc in the same directory.
UninstallPathSet.add() takes care of the __pycache__ .pyc.
i����(tFakeFileR�is.pyi����s.pycN(tpip.reqR�R�R�tget_metadata_linesR6RRNtlocationR�R�(tdistR�R�R�RtdnR�tbase((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytuninstallation_paths�s
cC�s�y�gtjd|�D]}|^qd}|jd�}t�j|�}|dj�}ttt |j
d���}|SWntSXdS(s�
Return the Wheel-Version of an extracted wheel, if possible.
Otherwise, return False if we couldn't parse / extract it.
iRHs
Wheel-VersionR�N(R
tfind_on_pathR�tget_metadataRtparsestrRYttupletmaptintR�R:(t
source_dirtdR�t
wheel_dataR�((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt
wheel_version�s)cC�s�|std|��n|dtdkrXtd|djtt|��f��n2|tkr�tjddjtt|���ndS(s�
Raises errors or warns if called with an incompatible Wheel-Version.
Pip should refuse to install a Wheel-Version that's a major series
ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
installing a version only minor version ahead (e.g 1.2 > 1.1).
version: a 2-tuple representing a Wheel-Version (Major, Minor)
name: name of wheel or package to raise exception about
:raises UnsupportedWheel: when an incompatible Wheel-Version is given
s(%s is in an unsupported or invalid wheelisB%s's Wheel-Version (%s) is not compatible with this version of pipR�s*Installing from a newer Wheel-Version (%s)N(RtVERSION_COMPATIBLERNR�R*Rtwarn(R�R0((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytcheck_compatibility�s
% tWheelcB�sDeZdZejdej�Zd�Zdd�Z dd�Z
RS(sA wheel files�^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))
((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
\.whl|\.dist-info)$c�s��jj|�}|s+td|��n|�_|jd�jdd��_|jd�jdd��_|jd�jd��_ |jd�jd��_
|jd �jd��_t�fd
��j D���_
dS(sX
:raises InvalidWheelFilename: when the filename is invalid for a wheel
s!%s is not a valid wheel filename.R0RGRFtvertpyverR�tabitplatc3�s>|]4}�jD]$}�jD]}|||fVqqqdS(N(tabistplats(t.0txtytz(tself(s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pys <genexpr>�sN(t
wheel_file_reRLRR`RMRIR0R�R�t
pyversionsR�R�R�t file_tags(R�R`t
wheel_info((R�s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt__init__�s cC�s]|dkrtj}ng|jD]!}||kr"|j|�^q"}|rYt|�SdS(s"
Return the lowest index that one of the wheel's file_tag combinations
achieves in the supported_tags list e.g. if there are 8 supported tags,
and one of the file tags is first in the list, then return 0. Returns
None is the wheel is not supported.
N(R�R tsupported_tagsR�tindextmin(R�ttagstctindexes((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytsupport_index_min�s1cC�s4|dkrtj}ntt|�j|j��S(s'Is this wheel supported on this system?N(R�R R�tboolR�tintersectionR�(R�R((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt supported�sN(t__name__t
__module__t__doc__R�tcompiletVERBOSER�R�R�RR(((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyR��s tWheelBuildercB�s/eZdZggd�Zd�Zd�ZRS(s#Build wheels from a RequirementSet.cC�s7||_||_t|�|_||_||_dS(N(trequirement_settfinderRt wheel_dirt
build_optionstglobal_options(R�RRRRR((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyR��s
cC�s�tjdd|jgt|j�}tjd|j�tjd|j�|dd|jg|j }y!t
|d|jdt�t
SWntjd |j�tSXd
S(sBuild one wheel.s-csjimport setuptools;__file__=%r;exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))s#Running setup.py bdist_wheel for %ssDestination directory: %stbdist_wheels-dtcwdtshow_stdoutsFailed building wheel for %sN(R.R;tsetup_pytlistRRtnotifyR0RRR
R�R:R@terror(R�R�t base_argst
wheel_args((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt
_build_ones
cC�s_|jj|j�|jjj�}g|D]}|js,|^q,}|sQdStjddjg|D]}|j ^qg��tj
d7_
gg}}x:|D]2}|j|�r�|j|�q�|j|�q�Wtj
d8_
|r"tjddjg|D]}|j ^q��n|r[tjddjg|D]}|j ^q>��ndS(s
Build wheels.Ns*Building wheels for collected packages: %st,isSuccessfully built %st sFailed to build %s(
Rt
prepare_filesRtrequirementstvaluestis_wheelRRRNR0tindentRR�(R�treqsetR�tbuildsett
build_successt
build_failure((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pytbuilds&"'
3(R R
RR�RR)(((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyR�s (iii(;Rt
__future__RR�R�R�RR6R�R�R.tbase64Rtemail.parserRtpip.backwardcompatRRtpip.exceptionsRRt
pip.locationsRtpip.logRR�R tpip.utilR
RRtpip._vendorR
tpip._vendor.distlib.scriptsRt wheel_extR�R#R&R)t NameErrorR4RERR
RKRURfR:R�R@R�R�R�R�R�tobjectR�R(((s:/opt/alt/python35/lib/python3.5/site-packages/pip/wheel.pyt<module>sT
� 2