ó •abc@@sddlmZddlmZddlmZddlZddlZddlm Z ddlm Z ddl m Z ddl mZmZmZmZmZdd lmZmZmZmZmZmZmZmZmZmZdd lmZdd l m!Z!m"Z"m#Z#m$Z$dd l%m&Z&dd l'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ej/e0ƒZ1de2fd„ƒYZ3de2fd„ƒYZ4d„Z5de4fd„ƒYZ6de4fd„ƒYZ7de4fd„ƒYZ8de2fd„ƒYZ9dS(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 HashUnpinnedtDirectoryUrlHashUnsupportedtVcsHashUnsupportedtUnsupportedPythonVersion(tInstallRequirement(t display_pathtdist_in_usersitet ensure_dirtnormalize_path(t MissingHashes(t indent_log(tcheck_dist_requires_python(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(R R!(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|cB@seZd„Zd„ZRS(cC@sttj|jjƒƒdS(Ni(tlistRtfind_distributionsR4t source_dir(R"R7((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR6ls cC@sdS(N((R"((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR8ps(R1R2R6R8(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR>js R;cB@seZd„Zd„ZRS(cC@s;|jjƒ}|jdƒr7|j|jdƒƒn|S(Nsdependency_links.txt(R4tget_distt has_metadatatadd_dependency_linkstget_metadata_lines(R"R7R6((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR6ws cC@s|jjƒ|jjƒdS(N(R4t run_egg_infotassert_source_matches_version(R"((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR8€s (R1R2R6R8(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR;us t InstalledcB@seZd„Zd„ZRS(cC@s |jjS(N(R4t satisfied_by(R"R7((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR6‡scC@sdS(N((R"((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR8Šs(R1R2R6R8(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRI…s tRequirementSetcB@sãeZeeeeeeeeeeeeeeed„Zd„Zd„Zeed„Zd„Z e d„ƒZ e d„ƒZ d„Z ed„Zd „Zd „Zd „Zeed „Zd „Zd„Zfd„ZRS(cC@s| dkrtdƒ‚n||_||_||_||_||_||_| |_t ƒ|_ i|_ g|_ | |_ ||_g|_g|_g|_||_| |_||_| |_| |_||_|rðt|ƒ}n||_||_||_ttƒ|_dS(s3Create a RequirementSet. :param wheel_download_dir: Where still-packed .whl files should be written to. If None they are written to the download_dir parameter. Separate to download_dir to permit only keeping wheel archives for pip wheel. :param download_dir: Where still packed archives should be written to. If None they are not saved, and are deleted immediately after unpacking. :param wheel_cache: The pip wheel cache, for passing to InstallRequirement. s?RequirementSet() missing 1 required keyword argument: 'session'N(tNonet TypeErrort build_dirtsrc_dirt download_dirtupgradetupgrade_strategytignore_installedtforce_reinstallRt requirementstrequirement_aliasestunnamed_requirementstignore_dependenciestignore_requires_pythontsuccessfully_downloadedtsuccessfully_installedtreqs_to_cleanuptas_eggt use_user_sitet target_dirtsessiont pycompiletisolatedRtwheel_download_dirt _wheel_cachetrequire_hashesRR@t _dependencies(R"RNRORPRQRRRSR]R_RXRTR^R`RaRbRct wheel_cacheReRY((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR#s<                          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Ítt (RUR&t comes_fromtsortR.tstrRj(R"Rjtreqs((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(RhRi(Rj((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRkÒRls, s"<%s object; %d requirement(s): %s>( RUR&RoR.RpRjt __class__R1tlen(R"RjRqtreqs_str((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR0Ðs "+c C@s°|j}|j|ƒs5tjd|j|jƒgS|jr|jjrt|jjƒ}|j ƒst d|jƒ‚qn|j |_ |j |_ |j |_ |j|_|dk|_|sÝ|jj|ƒ|gSy|j|ƒ}Wntk r d}nX|dkrm|rm|j rm|j|jkrm|jj|jjk rmt d|||fƒ‚n|s´||j|<|jƒ|kr¨||j|jƒ>s(R@RUR&RW(R"((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pythas_requirements<scC@sa|jr]t|jƒ|_tjj|jƒr4tStjdƒtdt |jƒƒ‚nt S(Ns!Could not find download directorys0Could not find or access download directory '%s'( RPRtosR‚texistsR‘RwtcriticalR RRƒ(R"((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt is_downloadAs  cC@slxU||jƒfD]A}||jkr3|j|S||jkr|j|j|SqWtd|ƒ‚dS(NsNo project with the name %r(RiRURVR~(R"R’Rh((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR}Ns  cC@sGx@|jjƒD]/}|jr%qn|jd|ƒ|jƒqWdS(Nt auto_confirm(RUR&Rt uninstalltcommit_uninstall(R"RšRj((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyR›Vs  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(R”Rj((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pys iss£--egg is not allowed with --require-hashes mode, since it delegates dependency resolution to setuptools and could thus result in installation of unhashed packages.ReRXN(RcRRWRUR&RetanyR]R RRtextendt _prepare_fileRXRRjR)(R"R7t root_reqsRetdiscovered_reqst hash_errorsRjtexc((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt prepare_files]s,      cC@s.|jo-|jdkp-|jdko-|jS(Nteagersonly-if-needed(RQRRR|(R"Rj((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt_is_upgrade_allowed„s cC@s÷|jƒ|jrï|j|ƒ}t}|r¾|jp=|jsy|j||ƒWqtk rmt}qt k r}qXn|s¾|j ot |jƒ s¯|j|_ nd|_q¾n|rÍd}n|jdkråd}nd}|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. salready up-to-datesonly-if-neededs%not upgraded as not directly requiredsalready satisfiedN(tcheck_if_existsRJR§RƒRTR<tfind_requirementR R‘R R^Rtconflicts_withRLRR(R"R4R7tupgrade_allowedtbest_installedt skip_reason((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyt_check_skip_installed‹s2        c @s¼ˆjsˆjrgStˆ_ˆjr;tjdˆƒn“ˆjsYˆjˆ|ƒ}nˆjrxtjd|ˆƒnVˆj r¾ˆj j dkr¾t ˆj j ƒ}tjdt |ƒƒntjdˆƒtƒßˆjrZ|rútdˆƒ‚nˆjˆjƒˆjˆj ƒtˆƒ}|jƒˆjrMˆjˆjƒnˆjƒn¾ˆjrˆ|rytjdƒntˆƒ}nˆjˆjƒtjjtjjˆj dƒƒrØt!d ˆˆj fƒ‚nˆj"|ˆj#ˆƒ|ƒˆj }|rbt$|ƒrt%ƒ‚n$t&|ƒr?t'|ƒr?t(ƒ‚nˆj) rbˆj* rbt+ƒ‚qbnˆj,d | ƒ} |rŽ| rŽt-ƒ} ny€ˆj} t} ˆj j.rÁˆj/rÁˆj/} nˆj j.rå| rÜt} qåt0} nt1ˆj ˆj | | d ˆj2d | ƒWnEt3j4k rU} tj5d ˆ| ƒtdˆ| ˆj fƒ‚nXtˆƒ}|jƒˆjr ˆj j t6j7kr ˆjˆjƒq nˆjs¶ˆjƒnˆjrˆj8sшjrˆj9oçt:ˆjƒ sùˆjˆ_;ndˆ_qtjdˆƒn|j=|ƒ} yt>| ƒWn@t?k rw}ˆj@rgtjA|jBdƒqxˆjCƒ‚nXg‰‡‡‡fd†}ˆjDˆjEƒs¸ˆjFˆdƒn|s{ˆjGrætjddjˆjGƒƒntHtIˆjGƒtI| jGƒƒ}x!|D]}tjAd| |ƒqWtHtI| jGƒtIˆjGƒ@ƒ}x*| jJ|ƒD]}||d|ƒq^WnˆjKjLˆƒˆj r²ˆj r²ˆjMjLˆƒnWdQXˆS(sxPrepare a single requirements file. :return: A list of additional InstallRequirements to also install. s Obtaining %ssRequirement %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): %sic@sMtt|ƒˆdˆjdˆjƒ}ˆjˆj|ˆjd|ƒƒdS(NRbRgR‹(RRpRbRdRŸRRh(tsubreqR‹tsub_install_req(t more_reqsR4R"(s3/usr/lib/python2.7/site-packages/pip/req/req_set.pytadd_req£s     s!Installing extra requirements: %rt,s"%s does not provide the extra '%s'R‹N(NRtpreparedR‘R:RwtinfoRSR®RJR<tschemeR turlRRR tensure_has_source_dirROtupdate_editableR™R?R8tarchiveRPR¨RˆRIRNR–R‚R—R.RBRt populate_linkR§RRRRRt original_linkt is_pinnedRR±RR=RcRƒR R`Rt HTTPErrorR˜Rt all_schemesRQR^RRªRLR6RRRYRxtargstremove_temporary_sourceR“RhRR€R…R†trequiresR\R)RZ(R"R7R4ReRXR­R‚t abstract_distR<R±RPtautodelete_unpackedR¤R6teRµtmissing_requestedtmissingtavailable_requestedR²((R´R4R"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(RwRˆRR\RÄ(R"Rj((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(RJRtaddRfR)(Rjtdep(tordert ordered_reqstscheduleR"(s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRÑès  (R†RUR&(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ÒRwR¸R.RhRRªR›R‘tinstalltinstall_succeededtrollback_uninstallRœRÄR[(R"tinstall_optionstglobal_optionsRÃtkwargst to_installRjt requirement((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRÓõs: )            (R1R2RƒRLR‘R#RrR0RR“tpropertyR•R™R}R›R¥R§R®R RÌRÒRÓ(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyRKŽs2    4   [    '  C ÿ  (:t __future__Rt collectionsRt itertoolsRtloggingR–t pip._vendorRRt pip.compatRt pip.downloadRRRR R tpip.exceptionsR R R RRRRRRRtpip.req.req_installRt pip.utilsRRRRtpip.utils.hashesRtpip.utils.loggingRtpip.utils.packagingRtpip.vcsRt pip.wheelRt getLoggerR1RwtobjectRR3R?R>R;RIRK(((s3/usr/lib/python2.7/site-packages/pip/req/req_set.pyts0  (F"