ó â\e[c @@s¿dZddlmZddlZddlZddlZddlZddlZddlZ ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZmZdd l m!Z!m"Z"m#Z#dd l$m%Z%m&Z&ddl'm(Z(ddl)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5e3réddl6m7Z7m8Z8m9Z9ndZ:ddfZ;ej<e=ƒZ>dd>d„Z?d„Z@d„ZAe jBde jCƒZDd„ZEd„ZFd„ZGeHeIeIeJeIeHeIeJd„ZKd „ZLd!„ZMd"eNfd#„ƒYZOd$eNfd%„ƒYZPdS(&sH Support for installing and building the "wheel" binary package format. i(tabsolute_importN(turlsafe_b64encode(tParser(t pkg_resources(t ScriptMaker(tcanonicalize_name(tStringIO(t pep425tags(t path_to_urlt unpack_url(tInstallationErrortInvalidWheelFilenametUnsupportedWheel(tPIP_DELETE_MARKER_FILENAMEtdistutils_scheme(t indent_log(tcall_subprocesstcaptured_stdoutt ensure_dirt read_chunks(tSETUPTOOLS_SHIM(t TempDirectory(tMYPY_CHECK_RUNNING(t open_spinner(tDicttListtOptionals.whliicC@s–tjƒ}d}t|dƒA}x7t|d|ƒD]#}|t|ƒ7}|j|ƒq7WWdQXdt|jƒƒjdƒj dƒ}||fS(s5Return (hash, length) for path using hashlib.sha256()itrbtsizeNssha256=tlatin1t=( thashlibtsha256topenRtlentupdateRtdigesttdecodetrstrip(tpatht blocksizethtlengthtftblockR$((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytrehash5s cC@sItjddkr"i}d}nidd6}d}t||||S(Niitbttnewline(tsyst version_infoR!(tnametmodetnltbin((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt open_for_csvCs   cC@sÁtjj|ƒr½t|dƒd}|jƒ}|jdƒsCtStjj tj ƒƒ}d|tj j dƒ}|j ƒ}WdQXt|dƒ!}|j |ƒ|j |ƒWdQXtSdS(sLReplace #!python with #!/path/to/python Return True if file was changed.Rs#!pythons#!tasciiNtwb(tosR'tisfileR!treadlinet startswithtFalseR1t executabletencodetgetfilesystemencodingtlineseptreadtwritetTrue(R'tscriptt firstlinetexenametrest((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt fix_scriptMs  sX^(?P(?P.+?)(-(?P.+?))?) \.dist-info$cC@s·|jddƒ}xžtj|ƒD]}tj|ƒ}|r"|jdƒ|kr"ttjj||dƒƒ:}x0|D](}|j ƒj ƒ}|dkrzt SqzWWdQXq"q"Wt S(sP Return True if the extracted wheel in wheeldir should go into purelib. t-t_R3tWHEELsroot-is-purelib: trueN( treplaceR:tlistdirt dist_info_retmatchtgroupR!R'tjointlowerR&RER>(R3twheeldirt name_foldedtitemRQtwheeltline((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytroot_is_purelibcs!  c@stjj|ƒsiifSt|ƒN}tƒ}x.|D]&}|j|jƒƒ|jdƒq;W|jdƒWdQXtj j |ƒ}|j diƒ}|j diƒ}d„‰t ‡fd†|j ƒDƒƒ}t ‡fd†|j ƒDƒƒ}||fS(Ns itconsole_scriptst gui_scriptscS@st|ƒjddƒjdƒS(sRget the string representation of EntryPoint, remove space and split on '='t R/R(tstrRNtsplit(ts((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt _split_ep‡sc3@s|]}ˆ|ƒVqdS(N((t.0tv(Ra(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pys sc3@s|]}ˆ|ƒVqdS(N((RbRc(Ra(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pys Žs(R:R'texistsR!RRDtstriptseekRt EntryPointt parse_maptgettdicttvalues(tfilenametfptdataRYt entry_pointstconsoletgui((Ras2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytget_entrypointsss    ""c @så|s dStjtƒ}xC|D];}tjj|ƒ}tjj|ƒ}||j|ƒq Wgtj j ddƒj tj ƒD]$}tjj |ƒjtjƒ^q‰ˆjtjj tjjtjƒƒƒ‡fd†|jƒDƒ}|sùdSg}x|jƒD]\}}t|ƒ}t|ƒdkrLdj|dƒ}n(djdj|d ƒd |d ƒ}|jd j||ƒƒq Wd } t|ƒdkrÂ|j| jd ƒƒn|j| jdƒƒdj|ƒS(sžDetermine if any scripts are not on PATH and format a warning. Returns a warning message if one or more scripts are not on PATH, otherwise None. tPATHR/c@s7i|]-\}}tjj|ƒˆkr||“qS((R:R'tnormcase(Rbt parent_dirtscripts(t not_warn_dirs(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pys ¬s is script {} isisscripts {} ares, iÿÿÿÿs and s.The {} installed in '{}' which is not on PATH.seConsider adding {} to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.sthis directorysthese directoriess N(tNonet collectionst defaultdicttsetR:R'tdirnametbasenametaddtenvironRiR_tpathsepRtR&tseptappendR1R?titemstsortedR"tformatRS( Rvtgrouped_by_dirtdestfileRut script_nametitwarn_fort msg_linest start_textt last_line_fmt((Rws2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt!message_about_scripts_not_on_PATH’s8 I( "c -@s|s3t|d|d|d|d|d| ƒ}nt|ˆ ƒrO|d‰n |d‰g‰g‰ˆ jtjjƒtjj} i‰tƒ‰g} |rtƒ@} tj ƒ+tj dƒt j | d t d t ƒWd QXWd QXtj| jƒƒnd „‰t‡‡‡‡‡ fd †‰ d d ‡‡‡ ‡ fd†}|| ˆt ƒˆsktdˆ ƒ‚tjjˆddƒ}t|ƒ\‰‰‡‡fd†}x¢ˆD]š}d }d }x…tjtjjˆ |ƒƒD]e}d }|dkrt}|}ntjjˆ ||ƒ} ||}|| |td|d|ƒqàWq¯Wtd |dƒ‰t ˆ_dhˆ_t ˆ_‡‡ fd†}|ˆ_dˆ_ˆjdd ƒ}|rªdtjkrìd|}| j ˆj!|ƒƒntjj"ddƒdkr7dt#j$d |f}| j ˆj!|ƒƒndt#j$d |f}| j ˆj!|ƒƒgˆD]}t%j&d |ƒrk|^qk}x|D] }ˆ|=q–Wnˆjd!d ƒ}|rgdtjkrôd"|}| j ˆj!|ƒƒnd#t#j$d |f}| j ˆj!|ƒƒgˆD]}t%j&d$|ƒr(|^q(}x|D] }ˆ|=qSWnt'ˆƒdkræˆj(gˆj)ƒD]}d%|^qŒƒ}| j |ƒ| ræt*|ƒ}|d k rãtj+|ƒqãqænt'ˆƒdkr8| j ˆj(gˆj)ƒD]}d%|^qit d&6ƒƒntjjˆdd'ƒ} tjjˆdd(ƒ}!t,|!d)ƒ}"|"j-d*ƒWd QXt.j/|!| ƒ| j0| ƒtjjˆdd+ƒ}#tjjˆdd,ƒ}$t1|#d-ƒ}%t1|$d.ƒÿ}&t2j3|%ƒ}'t2j4|&ƒ}(xj|'D]b})ˆj|)d|)dƒ|)d<|)dˆkr|t5|)dƒ\|)d<|)d/ˆj|ƒndS(s6Map archive RECORD paths to installation RECORD paths.N(R~(tsrcfileR‡tmodifiedtoldpathtnewpath(tchangedt installedtlib_dirRRU(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytrecord_installedös  c@s­t|ƒxœtj|ƒD]‹\}}}|t|ƒjtjjƒ}tjj||ƒ} |rŽ|jtjjdƒdj dƒrŽqnxÅ|D]½} tjj||| ƒ} |rç|dkrç| j dƒrçˆj | ƒq•q•|r•| j dƒr•t | ƒj t ˆj ƒƒr•ˆ sBtd| ddjˆƒƒ‚ˆj | ƒq•q•WxL|D]D} |r{|| ƒr{q]ntjj|| ƒ} tjj||| ƒ}t| ƒtjj|ƒrÔtj|ƒntj| |ƒtj| ƒ}ttdƒr!tj||j|jfƒntj| tjƒrvtj| ƒ}|jtjBtjBtjB}tj||ƒnt}|r‘||ƒ}nˆ| ||ƒq]WqWdS( Niis.dataR/s .dist-infos!Multiple .dist-info directories: s, tutime( RR:twalkR"tlstripR'RRSR_tendswithR‚RR=R3tAssertionErrorRdtunlinktshutiltcopyfiletstatthasattrR¦tst_atimetst_mtimetaccesstX_OKtst_modetS_IXUSRtS_IXGRPtS_IXOTHtchmodR>(tsourcetdesttis_basetfixertfiltertdirtsubdirstfilestbasedirtdestdirR`t destsubdirR+RžR‡tstt permissionsR¢(t data_dirstinfo_dirR¥treq(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytclobberþsN + !      s!%s .dist-info directory not foundisentry_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(RTR©(R3t matchname(RpRq(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytis_entrypoint_wrapperLs   RvR¼R½R/c@s^|jdkr(td|ˆfƒ‚nˆji|jd6|jjdƒdd6|jd6S(Ns­Invalid script entry point: %s for req: %s - A callable suffix is required. Cf https://packaging.python.org/en/latest/distributing.html#console-scripts for more information.tmodulet.it import_nametfunc(tsuffixRxR tscript_templateR“R_(tentry(tmakerRÈ(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt_get_script_textzs  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 = %sRqt INSTALLERs INSTALLER.pipR9spip tRECORDs RECORD.piptrsw+i(7RRZR&R:R'RR{Rtwarningstcatch_warningstfilterwarningst compileallt compile_dirREtloggertdebugtgetvalueR>RxRªRSRrRORJRRÉtvariantstset_modeRÔRÑtpopRtextendtmakeRiR1tversiontreRQR"t make_multipleRƒRŽtwarnR!RDR¬tmoveR‚R7tcsvtreadertwriterR-twriterow(-R3RÈRURRR‘t pycompiletschemeR’R“twarn_script_locationR¹t generatedtstdoutRÉtep_fileRËtdatadirR¼R½tsubdirRºRÔt pip_scripttspectktpip_epteasy_install_scriptteasy_install_eptkvtgenerated_console_scriptstmsgt installerttemp_installertinstaller_filetrecordt temp_recordt record_int record_outRïRðtrowR+R$R*(( R¢RpRÆRqRÇR£R¤RÓRR¥RÈRUs2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytmove_wheel_filesÏsÐ       % F %   $    # +  + &      ! # *cC@s™y€gtjd|ƒD] }|^qd}|jdƒ}tƒj|ƒ}|djƒ}ttt |j dƒƒƒ}|SWnt k r”t SXdS(s† Return the Wheel-Version of an extracted wheel, if possible. Otherwise, return False if we couldn't parse / extract it. iRMs Wheel-VersionRÍN( Rt find_on_pathRxt get_metadataRtparsestrRettupletmaptintR_t ExceptionR>(t source_dirtdtdistt wheel_dataRé((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt wheel_versions) cC@s|std|ƒ‚n|dtdkrXtd|djtt|ƒƒfƒ‚n1|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(R tVERSION_COMPATIBLERSRR^Rátwarning(RéR3((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytcheck_compatibilitys % tWheelcB@sDeZdZejdejƒZd„Zdd„Z dd„Z RS(s A wheel files^(?P(?P.+?)-(?P.*?)) ((-(?P\d[^-]*?))?-(?P.+?)-(?P.+?)-(?P.+?) \.whl|\.dist-info)$c@sóˆjj|ƒ}|s+td|ƒ‚n|ˆ_|jdƒjddƒˆ_|jdƒjddƒˆ_|jdƒˆ_|jdƒj dƒˆ_ |jd ƒj dƒˆ_ |jd ƒj dƒˆ_ ‡fd †ˆj Dƒˆ_ d S( sX :raises InvalidWheelFilename: when the filename is invalid for a wheel s!%s is not a valid wheel filename.R3RLRKtvertbuildtpyverRÍtabitplatc@s?h|]5}ˆjD]%}ˆjD]}|||f’q qqS((tabistplats(Rbtxtytz(tself(s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pys Us N(t wheel_file_reRQR RlRRRNR3Rét build_tagR_t pyversionsR!R"t file_tags(R&Rlt wheel_info((R&s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt__init__@s cC@s`|dkrtjƒ}ng|jD]!}||kr%|j|ƒ^q%}|r\t|ƒ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(RxRt get_supportedR*tindextmin(R&ttagstctindexes((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytsupport_index_minYs 1cC@s7|dkrtjƒ}ntt|ƒj|jƒƒS(s'Is this wheel supported on this system?N(RxRR-tboolR{t intersectionR*(R&R0((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt supportedes N( t__name__t __module__t__doc__RêtcompiletVERBOSER'R,RxR3R6(((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyR4s   t WheelBuildercB@sbeZdZdded„Zdd„Zdd„Zd„Zdd„Z d„Z ed„Z RS( s#Build wheels from a RequirementSet.cC@sR||_||_||_|j|_|p0g|_|p?g|_||_dS(N(tfindertpreparert wheel_cachetwheel_download_dirt _wheel_dirt build_optionstglobal_optionstno_clean(R&R=R>R?RBRCRD((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyR,os    c C@s*|j|j||d|ƒSWdQXdS(siBuild one wheel. :return: The filename of the built wheel, or None if the build failed. t python_tagN(t build_envt_build_one_inside_env(R&RÈt output_dirRE((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt _build_one{s c C@sÄtddƒ¯}|j||jd|ƒr©yetj|jƒd}tjj||ƒ}tjtjj|j|ƒ|ƒtj d|ƒ|SWq©t k r¥q©Xn|j |ƒdSWdQXdS(NtkindRXREisStored in directory: %s( Rt_WheelBuilder__build_oneR'R:RORSR¬RíRátinfoRt _clean_oneRx(R&RÈRHREttemp_dirt wheel_namet wheel_path((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyRG…s  cC@s'tjddt|jgt|jƒS(Ns-us-c(R1R?Rtsetup_pytlistRC(R&RÈ((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt_base_setup_args–s  c C@sÝ|j|ƒ}d|jf}t|ƒ¬}tjd|ƒ|dd|g|j}|dk rw|d|g7}ny't|d|jdt d|ƒt SWn2t k rÒ|j d ƒtj d |jƒt SXWdQXdS( Ns#Running setup.py bdist_wheel for %ssDestination directory: %st bdist_wheels-ds --python-tagtcwdt show_stdouttspinnerterrorsFailed building wheel for %s(RSR3RRáRâRBRxRt setup_py_dirR>RERtfinishRX(R&RÈttempdREt base_argst spin_messageRWt wheel_args((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyt __build_one s    cC@s|j|ƒ}tjd|jƒ|ddg}y!t|d|jdtƒtSWn%tk rztj d|jƒtSXdS(NsRunning setup.py clean for %stcleans--allRURVs Failed cleaning build dir for %s( RSRáRLR3RRR>RERRX(R&RÈR\t clean_args((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyRMµs c C@sýddlm}|jp(|o(|jj}|s7t‚g}x=|D]5}|jrYqDn|jr|sytj d|j ƒqyqD|r“|j r“qD|r¦|j r¦qD|rØ|j rØ|j j rØ|j|tfƒqDt}|rf|j } | jƒ\} } |j| d | ƒd kr#t}nd|j|jjt|j ƒƒkrftj d|j ƒqDqfn|j||fƒqDW|s‡tStj ddjg|D]\}} |j ^qƒƒ|j} tƒ­gg}}x˜|D]\}}d }|r~tj}|r| j|j ƒ}n| j|j ƒ}yt|ƒWq‡t k rz}tj!d|j |ƒ|j|ƒqãq‡Xn |j}|j"||d |ƒ}|rf|j|ƒ|rs|j rõt#j$j%t#j$j|j t&ƒƒ rõtd ƒ‚n|j'ƒ|j(|j)j*ƒ|_ |j+t,|ƒƒ|_ |j jsAt‚t-|j |j d td |ƒqsqã|j|ƒqãWWd QX|rµtj d djg|D]}|j ^q™ƒƒn|rítj ddjg|D]}|j ^qуƒnt.|ƒdkS(sÙBuild wheels. :param unpack: If True, replace the sdist we built from with the newly built wheel, in preparation for installation. :return: True if all the wheels built correctly. i(R.s(Skipping %s, due to already being wheel.tbinarysCSkipping bdist_wheel for %s, due to binaries being disabled for it.s*Building wheels for collected packages: %ss, s Building wheel for %s failed: %sREsbad source dir - missing markertsessionNsSuccessfully built %sR]sFailed to build %s(/t pip._internalR.RAR?t cache_dirRªt constrainttis_wheelRáRLR3teditableRtlinkt is_artifactR‚RER>tsplitexttegg_info_matchesRxtfmt_ctl_formatsR=tformat_controlRRSRRtimplementation_tagtget_ephem_path_for_linktget_path_for_linkRtOSErrorRRIR:R'RdR tremove_temporary_sourcetbuild_locationR>t build_dirtLinkRR R"(R&t requirementsRct autobuildingR.tbuilding_is_possibletbuildsetRÈt ephem_cacheRitbasetextRLt_cachet build_successt build_failuretephemRERHtet wheel_file((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyRÁs¦           ,               ))N( R7R8R9RxR>R,RIRGRSRKRMR(((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pyR<ls   (QR9t __future__RRyRßRîRtloggingtos.pathR:RêR¬R®R1RÜtbase64Rt email.parserRt pip._vendorRtpip._vendor.distlib.scriptsRtpip._vendor.packaging.utilsRtpip._vendor.sixRRdRtpip._internal.downloadRR tpip._internal.exceptionsR R R tpip._internal.locationsR Rtpip._internal.utils.loggingRtpip._internal.utils.miscRRRRt$pip._internal.utils.setuptools_buildRtpip._internal.utils.temp_dirRtpip._internal.utils.typingRtpip._internal.utils.uiRttypingRRRt wheel_extRt getLoggerR7RáR-R7RJR:R;RPRZRrRŽR>RxRER RRtobjectRR<(((s2/tmp/pip-install-0xiv62/pip/pip/_internal/wheel.pytsb           "     =   ÿ4  8