Files
PowerToys/PythonHome/Lib/site-packages/pip/wheel.pyc

125 lines
18 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<00>Sc@<40>s2dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddl m Z ddl mZddlmZmZddlmZmZddlmZdd lmZdd
lmZdd lmZmZmZdd lm Z dd l!m"Z"dd lm Z dZ#d$Z$dd%d<00>Z%ye&d<00>Z'Wne(k
r<>d<00>Z'nXd<00>Z)d<00>Z*ej+dej,<00>Z-d<00>Z.d<00>Z/e0dde2dd<00>Z3d<00>Z4e4d<00><00>Z5d<00>Z6d<00>Z7d e8fd!<00><00>YZ9d"e8fd#<00><00>YZ:dS(&sH
Support for installing and building the "wheel" binary package format.
i<EFBFBD><EFBFBD><EFBFBD><EFBFBD>(twith_statementN(turlsafe_b64encode(tParser(t ConfigParsertStringIO(tInvalidWheelFilenametUnsupportedWheel(tdistutils_scheme(tlogger(t
pep425tags(tcall_subprocesstnormalize_pathtmake_path_relative(t pkg_resources(t ScriptMakers.whliitsha256icC<>s<>tj|<00>}d}t|d<00><00>O}|j|<00>}x6|rn|t|<00>7}|j|<00>|j|<00>}q9WWdQXdt|j<00><00>jd<00>j d<00>}||fS(s6Return (hash, length) for path using hashlib.new(algo)itrbNssha256=tlatin1t=(
thashlibtnewtopentreadtlentupdateRtdigesttdecodetrstrip(tpathtalgot blocksizethtlengthtftblockR((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytrehash"s  (cC<>s t|t<00>r|jd<00>S|S(Ntascii(t
isinstancetunicodetencode(ts((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytbinary1s cC<>s t|t<00>r|jd<00>SdS(NR$(R%tstrR'(R(((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyR)6scC<>sItjddkr"i}d}nidd6}d}t||||<00>S(Niitbttnewline(tsyst version_infoR(tnametmodetnltbin((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt open_for_csv:s   cC<>s<>tjj|<00>r<>t|d<00>}zj|j<00>}|jtd<00><00>sItStj j
tj <00><00>}td<00>|ttj <00>}|j <00>}Wd|j<00>Xt|d<00>}z|j|<00>|j|<00>Wd|j<00>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@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt
fix_scriptCs     sZ^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
\.dist-info$cC<>s<>|jdd<00>}x<>tj|<00>D]<5D>}tj|<00>}|r"|jd<00>|kr"ttjj||d<00><00><00>:}x0|D](}|j <00>j
<00>}|dkrzt SqzWWdQXq"q"Wt S(sP
Return True if the extracted wheel in wheeldir should go into purelib.
t-t_R0tWHEELsroot-is-purelib: trueN( treplaceR6tlistdirt dist_info_retmatchtgroupRRtjointlowerRR@R:(R0twheeldirt name_foldedtitemRLtwheeltline((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytroot_is_purelib]s!  cC<>s<>tjj|<00>siifSt|<00><00>N}t<00>}x.|D]&}|j|j<00><00>|jd<00>q;W|jd<00>WdQXtj <00>}|j
|<00>i}i}|j d<00>r<>t |j d<00><00>}n|j d<00>r<>t |j d<00><00>}n||fS(Ns
itconsole_scriptst gui_scripts(R6RtexistsRRR?tstriptseekRtRawConfigParsertreadfpt has_sectiontdicttitems(tfilenametfptdataRTtcptconsoletgui((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytget_entrypointsms"
    c$ <03>s |s't|d|d|d|<00>}nt|<00> <00>rC|d<19>n
|d<19>g<00>g<00><00> jtjj<00>tjj}i<00>t<00><00>g} |r<>tj|dt dt <00>nd<00><00>t
<00><00><00><00><00> fd <00><00> d(d(<00><00><00> <00>
fd
<00>}
|
|<00>t <00><01>st d <00>
<16><00>tjj <00>d d <00>} t| <00>\<00><00><00><00>fd<00>} x<><00>D]<5D>} d(}d(}x<>tjtjj <00> | <00><00>D]e}d(}|dkr<>t}| }ntjj <00> | |<00>}||}|
||t
d|d|<00>q<>Wq^Wtd(|d<19><00>td)<00><00>_t <00>_<00>fd<00>}|<00>_d<00>_<00>jdd(<00>}|rPdtjkr<>d|}| j<00>j|<00><00>ntjjdd<00>dkr<>dtjd |f}| j<00>j|<00><00>ndtjd |f}| j<00>j|<00><00>g<00>D]}tjd|<00>r|^q}x|D] }<00>|=q<Wn<00>jdd(<00>}|r dtjkr<>d|}| j<00>j|<00><00>ndtjd |f}| j<00>j|<00><00>g<00>D]}tjd |<00>r<>|^q<>}x|D] }<00>|=q<>Wnt<00><00>d krU| j<00>j g<00>j!<00>D]}d!|^q8<04><00>nt<00><00>d kr<>| j<00>j g<00>j!<00>D]}d!|^q<>it d"6<><00>ntjj <00>d d#<00>}tjj <00>d d$<00>}t"|d%<00><00>}t"|d&<00><00><>}t#j$|<00>}t#j%|<00>}xj|D]b} <00>j| d | d <19>| d <| d <19>krwt&| d <19>\| d<| d'<n|j'| <00>q"Wx6| D].}!t&|!<00>\}"}#|j'|!|"|#f<00>q<>Wx(<00>D] }!|j'<00>|!ddf<00>q<>WWd(QXWd(QXt(j)||<00>d(S(*sInstall a wheeltuserthometroottpurelibtplatlibtforcetquietcS<>st||<00>jtjjd<00>S(Nt/(R RIR6Rtsep(tsrctp((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytnormpath<74>sc<13>sB<00>|<00><00>}<00>|<00><00>}|<00>|<|r><00>j|<00>ndS(s6Map archive RECORD paths to installation RECORD paths.N(tadd(tsrcfiletdestfiletmodifiedtoldpathtnewpath(tchangedt installedtlib_dirRrRP(s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytrecord_installed<65>s

c<13>s tjj|<00>s"tj|<00>nx<>tj|<00>D]<5D>\}}}|t|<00>jtjj<00>}tjj||<00>} |r<>|j tjjd<00>dj
d<00>r<>q2nx<>|D]<5D>}
tjj|||
<00>} |r<>|dkr<>| j
d<00>r<><00>j |
<00>q<>q<>|r<>|
j
d<00>r<>|
j <00>j <00>jjdd<00>j <00><00>r<><00> sQtd<00><00><00>j | <00>q<>q<>Wx<57>|D]<5D>} |r<>|| <00>r<>qlntjj|| <00>} tjj||| <00>}tjj| <00>s<>tj| <00>ntj| |<00>t}|r||<00>}n<00>| ||<00>qlWq2WdS( Niis.dataR,s
.dist-infoRFRGsMultiple .dist-info directories(R6RRXtmakedirstwalkRtlstripRoRNtsplittendswithtappendROR9t project_nameRItAssertionErrortshutiltcopy2R:(tsourcetdesttis_basetfixertfiltertdirtsubdirstfilestbasedirtdestdirR(t
destsubdirR!RtRuRy(t data_dirstinfo_dirR|treq(s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytclobber<65>s:+ ! * s!%s .dist-info directory not foundisentry_points.txtc<13>s<>|j<00>jd<00>r"|d }nJ|j<00>jd<00>rD|d }n(|j<00>jd<00>rf|d }n|}|<00>kp<>|<00>kS(Ns.exei<65><69><EFBFBD><EFBFBD>s
-script.pyi<79><69><EFBFBD><EFBFBD>s.pya(ROR<>(R0t matchname(RdRe(s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytis_entrypoint_wrapper<65>s   tscriptsR<73>R<>R,c<13>s6<00>ji|jd6|jjd<00>dd6|jd6S(Ntmodulet.it import_nametfunc(tscript_templatetprefixtsuffixR<78>(tentry(tmaker(s@c:\Users\lifqian\Desktop\Python27\lib\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)?)?$t easy_installseasy_install = seasy_install-%s = %sseasy_install(-\d\.\d)?$s%s = %sRetRECORDs
RECORD.piptrsw+iN(R,(*RRURR6RRotsett
compileallt compile_dirR@R:tNoneR<65>RNRfRJRERtvariantstset_modeR<65>R<>tpoptenvirontextendtmaketgetR.tversiontreRLRt make_multipleR_R4tcsvtreadertwriterR#twriterowR<77>tmove($R0R<>RPRgRhRit pycompiletschemeR<65>t generatedR<64>tep_fileR<65>tdatadirR<72>R<>tsubdirR<72>R<>t
pip_scripttspectktpip_epteasy_install_scriptteasy_install_eptkvtrecordt temp_recordt record_int
record_outR<74>R<>trowR!Rtl(( RyRdR<>ReR<>RzR{R<>RrR|R<>RPs@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytmove_wheel_files<65>s<>! 
  ( %  
$ 
#
+ 
  6@ !  *c<03>s"tj<00><00><00>fd<00><00>}|S(Nc?<3F>sHt<00>}x8<00>||<00>D]'}||kr|j|<00>|VqqWdS(N(R<>Rs(targstkwtseenRR(tfn(s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytuniquets
   (t functoolstwraps(R<>R<>((R<>s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt_uniquesscc<>s<>ddlm}tj||jd<00><00><00>}x<>|D]y}tjj|j|d<19>}|V|j d<00>r5tjj
|<00>\}}|d }tjj||d<17>}|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<><69><EFBFBD><EFBFBD>(tFakeFileR<65>is.pyi<79><69><EFBFBD><EFBFBD>s.pycN( tpip.reqR<71>R<>R<>tget_metadata_linesR6RRNtlocationR<6E>R<>(tdistR<74>R<>R<>RtdnR<6E>tbase((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytuninstallation_paths~s
 
cC<>s<>y<>gtjd|<00>D] }|^qd}|jd<00>}t<00>j|<00>}|dj<00>}ttt |j
d<00><00><00>}|SWnt SXdS(s<>
Return the Wheel-Version of an extracted wheel, if possible.
Otherwise, return False if we couldn't parse / extract it.
iRHs Wheel-VersionR<6E>N( R t find_on_pathR<68>t get_metadataRtparsestrRYttupletmaptintR<74>R:(t
source_dirtdR<64>t
wheel_dataR<61>((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt wheel_version<6F>s)cC<>s<>|std|<16><00>n|dtdkrXtd|djtt|<00><00>f<16><00>n2|tkr<>tjddjtt|<00><00><16>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<70>s*Installing from a newer Wheel-Version (%s)N(RtVERSION_COMPATIBLERNR<>R*Rtwarn(R<>R0((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytcheck_compatibility<74>s %  tWheelcB<>sDeZdZejdej<00>Zd<00>Zdd<00>Z dd<00>Z
RS(s A wheel files<65>^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))
((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
\.whl|\.dist-info)$c<03>s<><00>jj|<00>}|s+td|<16><00>n|<00>_|jd<00>jdd<00><00>_|jd<00>jdd<00><00>_|jd<00>jd<00><00>_ |jd<00>jd<00><00>_
|jd <00>jd<00><00>_ t <00>fd
<00><00>j D<><00><00>_ d S( sX
:raises InvalidWheelFilename: when the filename is invalid for a wheel
s!%s is not a valid wheel filename.R0RGRFtvertpyverR<72>tabitplatc3<>s>|]4}<00>jD]$}<00>jD]}|||fVqqqdS(N(tabistplats(t.0txtytz(tself(s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pys <genexpr><3E>sN(t wheel_file_reRLRR`RMRIR0R<>R<>t
pyversionsR<73>R<>R<>t file_tags(R<>R`t
wheel_info((R<>s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt__init__<5F>s cC<>s]|dkrtj}ng|jD]!}||kr"|j|<00>^q"}|rYt|<00>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<73>tindextmin(R<>ttagstctindexes((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytsupport_index_min<69>s  1cC<>s4|dkrtj}ntt|<00>j|j<00><00>S(s'Is this wheel supported on this system?N(R<>R R<>tboolR<6C>t intersectionR<6E>(R<>R((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt supported<65>s  N( t__name__t
__module__t__doc__R<5F>tcompiletVERBOSER<45>R<>R<>RR(((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyR<79><00>s   t WheelBuildercB<>s/eZdZggd<00>Zd<00>Zd<00>ZRS(s#Build wheels from a RequirementSet.cC<>s7||_||_t|<00>|_||_||_dS(N(trequirement_settfinderR t wheel_dirt build_optionstglobal_options(R<>RRRRR((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyR<79><00>s
   cC<>s<>tjdd|jgt|j<00>}tjd|j<16>tjd|j<16>|dd|jg|j }y!t
|d|j dt <00>t SWntjd |j<16>t SXd
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: %st bdist_wheels-dtcwdt show_stdoutsFailed building wheel for %sN(R.R;tsetup_pytlistRRtnotifyR0RRR
R<>R:R@terror(R<>R<>t base_argst
wheel_args((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt
_build_one<6E>s 
cC<>s_|jj|j<00>|jjj<00>}g|D]}|js,|^q,}|sQdStjddjg|D]}|j ^qg<00><16>tj
d7_
gg}}x:|D]2}|j |<00>r<>|j |<00>q<>|j |<00>q<>Wtj
d8_
|r"tjddjg|D]}|j ^q<01><16>n|r[tjddjg|D]}|j ^q><01><16>ndS(s Build wheels.Ns*Building wheels for collected packages: %st,isSuccessfully built %st sFailed to build %s( Rt prepare_filesRt requirementstvaluestis_wheelRRRNR0tindentRR<>(R<>treqsetR<74>tbuildsett build_successt build_failure((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pytbuilds&"'  3(RR R
R<>RR((((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyR <00>s (iii(;R
t
__future__RR<>R<>R<>RR6R<>R<>R.tbase64Rt email.parserRtpip.backwardcompatRRtpip.exceptionsRRt pip.locationsRtpip.logRR<>R tpip.utilR
R R t pip._vendorR tpip._vendor.distlib.scriptsRt wheel_extR<74>R#R&R)t NameErrorR4RER R RKRURfR:R<>R@R<>R<>R<>R<>R<>tobjectR<74>R (((s@c:\Users\lifqian\Desktop\Python27\lib\site-packages\pip\wheel.pyt<module>sT                <0F>   2