ž 7’Re@Qc@sZdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZddlmZmZddlmZmZddlmZdd lmZdd lmZdd lmZmZmZdd lm Z dd l!m"Z"dd lm Z dZ#d.Z$dd/dd„Z%ye&dd„Z'Wne(k rdd„Z'YnXdd„Z)dd„Z*ej+dej,ƒZ-dd„Z.dd„Z/d0ddd1ddd d!„Z3d"d#„Z4e4d$d%„ƒZ5d&d'„Z6d(d)„Z7Gd*d+„d+e8ƒZ9Gd,d-„d-e8ƒZ:dS(2uH Support for installing and building the "wheel" binary package format. i(uwith_statementN(uurlsafe_b64encode(uParser(u ConfigParseruStringIO(uInvalidWheelFilenameuUnsupportedWheel(udistutils_scheme(ulogger(u pep425tags(ucall_subprocessunormalize_pathumake_path_relative(u pkg_resources(u ScriptMakeru.whliusha256ic Cs§tj|ƒ}d}t|dƒO}|j|ƒ}x6|rn|t|ƒ7}|j|ƒ|j|ƒ}q9WWdQXdt|jƒƒjdƒj dƒ}||fS(u6Return (hash, length) for path using hashlib.new(algo)iurbNusha256=ulatin1u=( uhashlibunewuopenureadulenuupdateuurlsafe_b64encodeudigestudecodeurstrip(upathualgou blocksizeuhulengthufublockudigest((u"/tmp/pip-zej_zi-build/pip/wheel.pyurehash"s  (urehashcCs t|tƒr|jdƒS|S(Nuascii(u isinstanceuunicodeuencode(us((u"/tmp/pip-zej_zi-build/pip/wheel.pyubinary1s ubinarycCs t|tƒr|jdƒSdS(Nuascii(u isinstanceustruencode(us((u"/tmp/pip-zej_zi-build/pip/wheel.pyubinary6scCsItjddkr"i}d}nidd6}d}t||||S(Niiubuunewline(usysu version_infouopen(unameumodeunlubin((u"/tmp/pip-zej_zi-build/pip/wheel.pyu open_for_csv:s   u open_for_csvcCsÜtjj|ƒrØt|dƒ}zj|jƒ}|jtdƒƒsIdStj j tj ƒƒ}tdƒ|ttj ƒ}|j ƒ}Wd|jƒXt|dƒ}z|j|ƒ|j|ƒWd|jƒXdSdS(uLReplace #!python with #!/path/to/python Return True if file was changed.urbu#!pythonu#!NuwbFT(uosupathuisfileuopenureadlineu startswithubinaryuFalseusysu executableuencodeugetfilesystemencodingulinesepureaducloseuwriteuTrue(upathuscriptu firstlineuexenameurest((u"/tmp/pip-zej_zi-build/pip/wheel.pyu fix_scriptCs     u fix_scriptuZ^(?P(?P.+?)(-(?P\d.+?))?) \.dist-info$c Cs·|jddƒ}xžtj|ƒD]}tj|ƒ}|r"|jdƒ|kr"ttjj||dƒƒ:}x0|D](}|j ƒj ƒ}|dkrzdSqzWWdQXq"q"WdS( uP Return True if the extracted wheel in wheeldir should go into purelib. u-u_unameuWHEELuroot-is-purelib: trueNTF( ureplaceuosulistdiru dist_info_reumatchugroupuopenupathujoinulowerurstripuTrueuFalse(unameuwheeldiru name_foldeduitemumatchuwheeluline((u"/tmp/pip-zej_zi-build/pip/wheel.pyuroot_is_purelib]s!  uroot_is_purelibc Csõtjj|ƒsiifSt|ƒN}tƒ}x.|D]&}|j|jƒƒ|jdƒq;W|jdƒWdQXtj ƒ}|j |ƒi}i}|j dƒrÄt |j dƒƒ}n|j dƒrët |j dƒƒ}n||fS(Nu iuconsole_scriptsu gui_scripts(uosupathuexistsuopenuStringIOuwriteustripuseeku ConfigParseruRawConfigParserureadfpu has_sectionudictuitems(ufilenameufpudataulineucpuconsoleugui((u"/tmp/pip-zej_zi-build/pip/wheel.pyuget_entrypointsms"     uget_entrypointsc $s(|s't|d|d|d|ƒ}nt|ˆ ƒrC|d‰n |d‰g‰g‰ˆ jtjjƒtjj} i‰tƒ‰g} |r¯tj| dd0dd0ƒndd „‰d1‡‡‡‡‡ fd d †‰ dd‡‡‡ ‡ fd d †} | | ˆd0ƒˆs#t dˆ ƒ‚tjj ˆddƒ} t| ƒ\‰‰‡‡fdd†} x¢ˆD]š}d}d}x…tjtjj ˆ |ƒƒD]e}d}|dkrÂt}| }ntjj ˆ ||ƒ} ||}| | |d1d|d|ƒq›WqjWtd|dƒ‰td2ƒˆ_d0ˆ_‡fdd†}|ˆ_dˆ_ˆjddƒ}|rSdtjkr¡d|}| jˆj|ƒƒntjjddƒdkròdtjdd …|f}| jˆj|ƒƒndtjdd!…|f}| jˆj|ƒƒd"d#„ˆDƒ}x|D] }ˆ|=q?Wnˆjd$dƒ}|rþdtjkrd%|}| jˆj|ƒƒnd&tjdd!…|f}| jˆj|ƒƒd'd#„ˆDƒ}x|D] }ˆ|=qêWntˆƒdkr<| jˆjd(d#„ˆjƒDƒƒƒntˆƒdkr„| jˆjd)d#„ˆjƒDƒid0d*6ƒƒntjj ˆdd+ƒ}tjj ˆdd,ƒ}t |d-ƒM}t |d.ƒ5}t!j"|ƒ}t!j#|ƒ}xj|D]b} ˆj| d| dƒ| d<| dˆkrTt$| dƒ\| d <| d/.normpathcsBˆ|ˆƒ}ˆ|ˆƒ}|ˆ|<|r>ˆj|ƒndS(u6Map archive RECORD paths to installation RECORD paths.N(uadd(usrcfileudestfileumodifieduoldpathunewpath(uchangedu installedulib_dirunormpathuwheeldir(u"/tmp/pip-zej_zi-build/pip/wheel.pyurecord_installed§s  u*move_wheel_files..record_installedc s&tjj|ƒs"tj|ƒnxýtj|ƒD]ì\}}}|t|ƒd…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³ˆ sWtdƒ‚ˆj | ƒq³q³Wx°|D]¨} |r|| ƒrqrntjj|| ƒ} tjj||| ƒ}tjj| ƒsßtj| ƒntj| |ƒd }|r ||ƒ}nˆ| ||ƒqrWq2WdS( Niiu.datauu .dist-infou-u_uMultiple .dist-info directoriesF(uosupathuexistsumakedirsuwalkulenulstripusepujoinusplituendswithuappenduloweru startswithu project_nameureplaceuAssertionErrorushutilucopy2uFalse(usourceudestuis_baseufixerufilterudirusubdirsufilesubasedirudestdirusu destsubdirufusrcfileudestfileuchanged(u data_dirsuinfo_dirurecord_installedureq(u"/tmp/pip-zej_zi-build/pip/wheel.pyuclobber¯s:%+ ! * u!move_wheel_files..clobberu!%s .dist-info directory not foundiuentry_points.txtcs”|jƒjdƒr(|dd…}nV|jƒjdƒrP|dd…}n.|jƒjdƒrx|dd…}n|}|ˆkp“|ˆkS( Nu.exeiu -script.pyi u.pyaiüÿÿÿiöÿÿÿiüÿÿÿ(uloweruendswith(unameu matchname(uconsoleugui(u"/tmp/pip-zej_zi-build/pip/wheel.pyuis_entrypoint_wrapperßsu/move_wheel_files..is_entrypoint_wrapperuscriptsufixerufilterucs6ˆji|jd6|jjdƒdd6|jd6S(Numoduleu.iu import_nameufunc(uscript_templateuprefixusuffixusplit(uentry(umaker(u"/tmp/pip-zej_zi-build/pip/wheel.pyu_get_script_text s  u*move_wheel_files.._get_script_textuÏ# -*- 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()) upipuENSUREPIP_OPTIONSupip = u altinstallu pip%s = %sNiicSs(g|]}tjd|ƒr|‘qS(upip(\d(\.\d)?)?$(ureumatch(u.0uk((u"/tmp/pip-zej_zi-build/pip/wheel.pyu Js u$move_wheel_files..u easy_installueasy_install = ueasy_install-%s = %scSs(g|]}tjd|ƒr|‘qS(ueasy_install(-\d\.\d)?$(ureumatch(u.0uk((u"/tmp/pip-zej_zi-build/pip/wheel.pyu Vs cSsg|]}d|‘qS(u%s = %s((u.0ukv((u"/tmp/pip-zej_zi-build/pip/wheel.pyu ]s cSsg|]}d|‘qS(u%s = %s((u.0ukv((u"/tmp/pip-zej_zi-build/pip/wheel.pyu _s uguiuRECORDu RECORD.pipuruw+iTF(u(*udistutils_schemeuroot_is_pureliburstripuosupathusepusetu compileallu compile_diruTrueuFalseuNoneuAssertionErrorujoinuget_entrypointsulistdiru fix_scriptu ScriptMakeruvariantsuset_modeu_get_script_textuscript_templateupopuenvironuextendumakeugetusysuversionulenu make_multipleuitemsu open_for_csvucsvureaderuwriterurehashuwriterowu startswithurelpathushutilumove($unameurequwheeldiruuseruhomeurootu pycompileuschemeustrip_file_prefixusourceu generateduclobberuep_fileuis_entrypoint_wrapperudatadirufixerufilterusubdirudestu_get_script_textu pip_scriptuspecupip_epukueasy_install_scriptueasy_install_epurecordu temp_recordu record_inu record_outureaderuwriterurowufuhul(( uchangeduconsoleu data_dirsuguiuinfo_diru installedulib_dirumakerunormpathurecord_installedurequwheeldiru"/tmp/pip-zej_zi-build/pip/wheel.pyumove_wheel_filesˆs¨!    !!( %   $  #    ,6 ! * *umove_wheel_filescs%tjˆƒ‡fdd†ƒ}|S(Nc?sHtƒ}x8ˆ||ŽD]'}||kr|j|ƒ|VqqWdS(N(usetuadd(uargsukwuseenuitem(ufn(u"/tmp/pip-zej_zi-build/pip/wheel.pyuuniquevs    u_unique..unique(u functoolsuwraps(ufnuunique((ufnu"/tmp/pip-zej_zi-build/pip/wheel.pyu_uniqueus!u_uniqueccs¼ddlm}tj||jdƒƒƒ}x‡|D]}tjj|j|dƒ}|V|j dƒr5tjj |ƒ\}}|dd…}tjj||dƒ}|Vq5q5WdS( u 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(uFakeFileuRECORDu.pyNiu.pyciýÿÿÿ( upip.requFakeFileucsvureaderuget_metadata_linesuosupathujoinulocationuendswithusplit(udistuFakeFileururowupathudnufnubase((u"/tmp/pip-zej_zi-build/pip/wheel.pyuuninstallation_paths€s  uuninstallation_pathsc Csyzdd„tjd|ƒDƒd}|jdƒ}tƒj|ƒ}|djƒ}ttt |j dƒƒƒ}|SWn dSYnXdS( u† Return the Wheel-Version of an extracted wheel, if possible. Otherwise, return False if we couldn't parse / extract it. cSsg|] }|‘qS(((u.0ud((u"/tmp/pip-zej_zi-build/pip/wheel.pyu s u!wheel_version..iuWHEELu Wheel-Versionu.NF( u pkg_resourcesu find_on_pathuNoneu get_metadatauParseruparsestrustriputupleumapuintusplituFalse(u source_dirudistu wheel_datauversion((u"/tmp/pip-zej_zi-build/pip/wheel.pyu wheel_version–s#u wheel_versioncCsŽ|std|ƒ‚n|dtdkrXtd|djtt|ƒƒfƒ‚n2|tkrŠtjddjtt|ƒƒƒndS(uê 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 u(%s is in an unsupported or invalid wheeliuB%s's Wheel-Version (%s) is not compatible with this version of pipu.u*Installing from a newer Wheel-Version (%s)N(uUnsupportedWheeluVERSION_COMPATIBLEujoinumapustruloggeruwarn(uversionuname((u"/tmp/pip-zej_zi-build/pip/wheel.pyucheck_compatibility©s %  ucheck_compatibilitycBsY|EeZdZdZejdejƒZdd„Zd dd„Z d dd„Z d S( uWheelu A wheel fileuž^(?P(?P.+?)-(?P\d.*?)) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) \.whl|\.dist-info)$csêˆjj|ƒ}|s+td|ƒ‚n|ˆ_|jdƒjddƒˆ_|jdƒjddƒˆ_|jdƒjdƒˆ_ |jdƒjdƒˆ_ |jd ƒjdƒˆ_ t ‡fd d †ˆj Dƒƒˆ_ d S( uX :raises InvalidWheelFilename: when the filename is invalid for a wheel u!%s is not a valid wheel filename.unameu_u-uverupyveru.uabiuplatc3s>|]4}ˆjD]$}ˆjD]}|||fVqqqdS(N(uabisuplats(u.0uxuyuz(uself(u"/tmp/pip-zej_zi-build/pip/wheel.pyu àsu!Wheel.__init__..N(u wheel_file_reumatchuInvalidWheelFilenameufilenameugroupureplaceunameuversionusplitu pyversionsuabisuplatsusetu file_tags(uselfufilenameu wheel_info((uselfu"/tmp/pip-zej_zi-build/pip/wheel.pyu__init__Ïs uWheel.__init__csHˆdkrtj‰n‡fdd†|jDƒ}|rDt|ƒSdS(u" 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. cs+g|]!}|ˆkrˆj|ƒ‘qS((uindex(u.0uc(utags(u"/tmp/pip-zej_zi-build/pip/wheel.pyu ìs u+Wheel.support_index_min..N(uNoneu pep425tagsusupported_tagsu file_tagsumin(uselfutagsuindexes((utagsu"/tmp/pip-zej_zi-build/pip/wheel.pyusupport_index_minãs  uWheel.support_index_mincCs4|dkrtj}ntt|ƒj|jƒƒS(u'Is this wheel supported on this system?N(uNoneu pep425tagsusupported_tagsuboolusetu intersectionu file_tags(uselfutags((u"/tmp/pip-zej_zi-build/pip/wheel.pyu supportedïs  uWheel.supportedN( u__name__u __module__u __qualname__u__doc__ureucompileuVERBOSEu wheel_file_reu__init__uNoneusupport_index_minu supported(u __locals__((u"/tmp/pip-zej_zi-build/pip/wheel.pyuWheelÄs   uWheelcBsD|EeZdZdZggdd„Zdd„Zdd„ZdS( u WheelBuilderu#Build wheels from a RequirementSet.cCs7||_||_t|ƒ|_||_||_dS(N(urequirement_setufinderunormalize_pathu wheel_diru build_optionsuglobal_options(uselfurequirement_setufinderu wheel_diru build_optionsuglobal_options((u"/tmp/pip-zej_zi-build/pip/wheel.pyu__init__ùs    uWheelBuilder.__init__c Cs³tjdd|jgt|jƒ}tjd|jƒtjd|jƒ|dd|jg|j }y!t |d|j dd ƒd SWn tjd |jƒd SYnXd S( uBuild one wheel.u-cujimport setuptools;__file__=%r;exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))u#Running setup.py bdist_wheel for %suDestination directory: %su bdist_wheelu-ducwdu show_stdoutuFailed building wheel for %sNFT(usysu executableusetup_pyulistuglobal_optionsuloggerunotifyunameu wheel_diru build_optionsucall_subprocessu source_diruFalseuTrueuerror(uselfurequ base_argsu wheel_args((u"/tmp/pip-zej_zi-build/pip/wheel.pyu _build_ones  uWheelBuilder._build_onecCs5|jj|jƒ|jjjƒ}dd„|Dƒ}|sBdStjddjdd„|Dƒƒƒtjd7_gg}}x:|D]2}|j |ƒr±|j |ƒqŒ|j |ƒqŒWtjd8_|rtjdd jd d„|Dƒƒƒn|r1tjd d jd d„|DƒƒƒndS( u Build wheels.cSsg|]}|js|‘qS((uis_wheel(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu s u&WheelBuilder.build..Nu*Building wheels for collected packages: %su,cSsg|]}|j‘qS((uname(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu #s iuSuccessfully built %su cSsg|]}|j‘qS((uname(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu 0s uFailed to build %scSsg|]}|j‘qS((uname(u.0ureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyu 2s ( urequirement_setu prepare_filesufinderu requirementsuvaluesuloggerunotifyujoinuindentu _build_oneuappend(uselfureqsetubuildsetu build_successu build_failureureq((u"/tmp/pip-zej_zi-build/pip/wheel.pyubuilds&  *uWheelBuilder.buildN(u__name__u __module__u __qualname__u__doc__u__init__u _build_oneubuild(u __locals__((u"/tmp/pip-zej_zi-build/pip/wheel.pyu WheelBuilderös u WheelBuilder(iiiFT(;u__doc__u __future__uwith_statementu compileallucsvu functoolsuhashlibuosureushutilusysubase64uurlsafe_b64encodeu email.parseruParserupip.backwardcompatu ConfigParseruStringIOupip.exceptionsuInvalidWheelFilenameuUnsupportedWheelu pip.locationsudistutils_schemeupip.loguloggerupipu pep425tagsupip.utilucall_subprocessunormalize_pathumake_path_relativeu pip._vendoru pkg_resourcesupip._vendor.distlib.scriptsu ScriptMakeru wheel_extuVERSION_COMPATIBLEurehashuunicodeubinaryu NameErroru open_for_csvu fix_scriptucompileuVERBOSEu dist_info_reuroot_is_purelibuget_entrypointsuFalseuNoneuTrueumove_wheel_filesu_uniqueuuninstallation_pathsu wheel_versionucheck_compatibilityuobjectuWheelu WheelBuilder(((u"/tmp/pip-zej_zi-build/pip/wheel.pyusT              ì   2