ó r2Wc@@sòddlmZddlmZddlmZddlZddlZddlm Z ddlm Z ddl m Z ddl mZmZmZmZmZdd lmZmZmZmZmZmZmZmZmZdd lmZdd lm Z m!Z!m"Z"m#Z#dd l$m%Z%dd l&m'Z'ddl(m)Z)ddl*m+Z+ej,e-ƒZ.de/fd„ƒYZ0de/fd„ƒYZ1d„Z2de1fd„ƒYZ3de1fd„ƒYZ4de1fd„ƒYZ5de/fd„ƒYZ6dS(i(tabsolute_import(t defaultdict(tchainN(t pkg_resources(trequests(t expanduser(t is_file_urlt is_dir_urlt is_vcs_urlt url_to_patht unpack_url( tInstallationErrortBestVersionAlreadyInstalledtDistributionNotFoundtPreviousBuildDirErrort HashErrort HashErrorst HashUnpinnedtDirectoryUrlHashUnsupportedtVcsHashUnsupported(tInstallRequirement(t display_pathtdist_in_usersitet ensure_dirtnormalize_path(t MissingHashes(t indent_log(tvcs(tWheelt RequirementscB@sGeZd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cC@sg|_i|_dS(N(t_keyst_dict(tself((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt__init__s cC@s|jS(N(R(R ((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pytkeys#scC@s!g|jD]}|j|^q S(N(RR(R tkey((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pytvalues&scC@s ||jkS(N(R(R titem((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt __contains__)scC@s3||jkr"|jj|ƒn||j|t _dependencies(R RLRMRNRORPRYR[RURQRZR\R]R^R_t wheel_cacheRa((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR!Žs8                        cC@sgg|jjƒD]}|js|^q}|jdd„ƒdjg|D]}t|jƒ^qKƒS(NR#cS@s |jjƒS(N(tnametlower(treq((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pytÈst (RRR$t comes_fromtsortR,tstrRf(R Rftreqs((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt__str__ÅscC@s}g|jjƒD] }|^q}|jdd„ƒdjg|D]}t|jƒ^qBƒ}d|jjt|ƒ|fS(NR#cS@s |jjƒS(N(RdRe(Rf((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRgÍss, s"<%s object; %d requirement(s): %s>( RRR$RjR,RkRft __class__R/tlen(R RfRltreqs_str((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR.Ës "+c C@sž|j}|jƒs2tjd|j|jƒgS|jr~|jjr~t|jjƒ}|j ƒs~t d|jƒ‚q~n|j |_ |j |_ |j |_ |j|_|sË|jj|ƒ|gSy|j|ƒ}Wntk r÷d}nX|dkr[|r[|j r[|j|jkr[|jj|jjk r[t d|||fƒ‚n|s¢||j|<|jƒ|kr–||j|jƒ4s(R>RRR$RT(R ((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pythas_requirements2scC@sa|jr]t|jƒ|_tjj|jƒr4tStjdƒtdt |jƒƒ‚nt S(Ns!Could not find download directorys0Could not find or access download directory '%s'( RNRtosR|texistsRŠRrtcriticalR RR}(R ((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt is_download7s  cC@slxU||jƒfD]A}||jkr3|j|S||jkr|j|j|SqWtd|ƒ‚dS(NsNo project with the name %r(ReRRRSRx(R R‹Rd((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRwDs  cC@sGx@|jjƒD]/}|jr%qn|jd|ƒ|jƒqWdS(Nt auto_confirm(RRR$Ryt uninstalltcommit_uninstall(R R“Rf((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR”Ls  c C@s|jrt|jƒn|j|jjƒ}|jpKtd„|Dƒƒ}|rl|jrltdƒ‚ng}t ƒ}xot ||ƒD]^}y,|j |j ||d|d|j ƒƒWq‹tk rè}||_|j|ƒq‹Xq‹W|rü|‚ndS(sY Prepare process. Create temp directories, download and/or unpack files. cs@s|]}|jVqdS(N(thas_hash_options(RRf((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pys _ss£--egg is not allowed with --require-hashes mode, since it delegates dependency resolution to setuptools and could thus result in installation of unhashed packages.RaRUN(R_RRTRRR$RatanyRYR RRtextendt _prepare_fileRURRfR'(R R5t root_reqsRatdiscovered_reqst hash_errorsRftexc((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt prepare_filesSs,      cC@sÍ|jƒ|jrÅd}|jrÁt}|jp7|js„y|j||jƒWq„tk rpd}t}q„t k r€q„Xn|sÁ|j o t |jƒ s²|j|_ nd|_qÁn|SdSdS(sCheck if req_to_install should be skipped. This will check if the req is installed, and whether we should upgrade or reinstall it, taking into account all the relevant user options. After calling this req_to_install will only have satisfied_by set to None if the req_to_install is to be upgraded/reinstalled etc. Any other value will be a dist recording the current thing installed that satisfies the requirement. Note that for vcs urls and the like we can't assess skipping in this routine - we simply identify that we need to pull the thing down, then later on it is pulled down and introspected to assess upgrade/ reinstalls etc. :return: A text reason for why it was skipped, or None. s$satisfied (use --upgrade to upgrade)s up-to-dateN(tcheck_if_existsRHROR}RQR:tfind_requirementR RŠR RZRtconflicts_withRJ(R R2R5t skip_reasontbest_installed((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt_check_skip_installedzs(       c@s›ˆjsˆjrgStˆ_ˆjr;tjdˆƒnʈjdksPt‚ˆj snˆj ˆ|ƒ}nˆjr¯|dk s™tdˆjfƒ‚tjd|ˆƒnVˆj rõˆj j dkrõt ˆj jƒ}tjdt|ƒƒntjdˆƒtƒ‡ˆjr‡|r1tdˆƒ‚nˆjˆjƒˆjˆj ƒtˆƒ}|jƒˆjrNˆjˆjƒqNnLjjrµ|r¦tjdƒntˆƒ}n™ˆjˆjƒtjjtjj ˆj!d ƒƒrt"d ˆˆj!fƒ‚nˆj#|ˆj$|ƒˆj s*t‚ˆj }|r˜t%|ƒrQt&ƒ‚n$t'|ƒrut(|ƒrut)ƒ‚nˆj* r˜ˆj+ r˜t,ƒ‚q˜nˆj-d | ƒ} |rÄ| rÄt.ƒ} ny€ˆj} t} ˆj j/r÷ˆj0r÷ˆj0} nˆj j/r| rt} qt1} nt2ˆj ˆj!| | d ˆj3d | ƒWnEt4j5k r‹} tj6dˆ| ƒtdˆ| ˆj fƒ‚nXtˆƒ}|jƒˆjrÖˆj j t7j8krÖˆjˆjƒqÖnˆj sìˆj9ƒnˆjrNˆj$sˆj r;ˆj:ot;ˆjƒ s/ˆjˆ_<ndˆ_qNtjdˆƒn|j=|ƒ} g‰‡‡‡fd†}ˆj>ˆj?ƒsˆj@ˆdƒn|sZˆjArËtjddj ˆjAƒƒntBtCˆjAƒtC| jAƒƒ}x!|D]}tjDd| |ƒqôWtBtC| jAƒtCˆjAƒ@ƒ}x$| jE|ƒD]}||ƒqCWnˆjFjGˆƒˆj r‘ˆj r‘ˆjHjGˆƒnWdQXˆS(sxPrepare a single requirements file. :return: A list of additional InstallRequirements to also install. s Obtaining %ssP_check_skip_installed returned None but req_to_install.satisfied_by is set to %rsRequirement already %s: %stfiles Processing %ss Collecting %ssoThe editable requirement %s cannot be installed when requiring hashes, because there is no single file to hash.s§Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.ssetup.pysípip can't proceed with requirements '%s' due to a pre-existing build directory (%s). This is likely due to a previous installation that failed. pip is being responsible and not assuming it can delete this. Please delete it and try again.ttrust_internetR\thashess4Could not install requirement %s because of error %ssDCould not install requirement %s because of HTTP error %s for URL %ss<Requirement already satisfied (use --upgrade to upgrade): %sc@sGtt|ƒˆdˆjdˆjƒ}ˆjˆj|ˆjƒƒdS(NR^Rc(RRkR^R`R˜R‰Rd(tsubreqtsub_install_req(t more_reqsR2R (s3/usr/lib/python2.7/site-packages/pip/req/req_set.pytadd_reqzs    s!Installing extra requirements: %rt,s"%s does not provide the extra '%s'N(IRytpreparedRŠR8RrtinfoRHRJtAssertionErrorRPR¤R:tschemeR turlRRR tensure_has_source_dirRMtupdate_editableR’R=R6tarchiveRNR‚RGRLRR|RR,R@Rt populate_linkRORRRRRt original_linkt is_pinnedRR§RR;R_R}R R\Rt HTTPErrorR‘Rt all_schemesRŸRZRR¡R4RŒRdR‰RzRR€RstrequiresRXR'RV(R R5R2RaRUR¢R|t abstract_distR:R§RNtautodelete_unpackedRR4R«tmissing_requestedtmissingtavailable_requestedR¨((RªR2R s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR™®sö                                                cC@s?tjdƒtƒ#x|jD]}|jƒq!WWdQXdS(sClean up files, remove builds.sCleaning up...N(RrR‚RRXtremove_temporary_source(R Rf((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt cleanup_filesªs  c@sOg‰tƒ‰‡‡‡‡fd†‰x!ˆjjƒD]}ˆ|ƒq7WˆS(säCreate the installation order. The installation order is topological - requirements are installed before the requiring thing. We break cycles at an arbitrary point, and make no other guarantees. c@sf|js|ˆkrdS|jr&dSˆj|ƒxˆj|D]}ˆ|ƒqAWˆj|ƒdS(N(RHRytaddRbR'(Rftdep(tordert ordered_reqstscheduleR (s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRƾs  (R€RRR$(R Rƒ((RÄRÅRÆR s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt _to_install±s   c O@s!|jƒ}|rDtjddjg|D]}|j^q(ƒƒntƒÅx½|D]µ}|jrštjd|jƒtƒ|jdtƒWdQXny|j ||||ŽWn*|jrÚ|j rÚ|j ƒn‚n X|jr|j r|j ƒn|j ƒqUWWdQX||_dS(sl Install everything in this set (after having downloaded and unpacked the packages) s!Installing collected packages: %ss, sFound existing installation: %sR“N(RÇRrR®R,RdRR¡R”RŠtinstalltinstall_succeededtrollback_uninstallR•RÀRW(R tinstall_optionstglobal_optionstargstkwargst to_installRft requirement((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRÈËs: )            N((R/R0R}RJRŠR!RmR.R‰RŒtpropertyRŽR’RwR”RžR¤R™RÁRÇRÈ(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRIŒs*  2   W    ' 7 ø  (7t __future__Rt collectionsRt itertoolsRtloggingRt pip._vendorRRt pip.compatRt pip.downloadRRRR R tpip.exceptionsR R R RRRRRRtpip.req.req_installRt pip.utilsRRRRtpip.utils.hashesRtpip.utils.loggingRtpip.vcsRt pip.wheelRt getLoggerR/RrtobjectRR1R=R<R9RGRI(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyts.  (@"