ó •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ʈ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ƒˆjr„ˆjˆjƒnˆjƒn͈jr¿|r°tjdƒntˆƒ}nŸˆjˆjƒtjj tjj!ˆj"d ƒƒrt#d ˆˆj"fƒ‚nˆj$|ˆj%ˆƒ|ƒˆj s:t‚ˆj }|r¨t&|ƒrat'ƒ‚n$t(|ƒr…t)|ƒr…t*ƒ‚nˆj+ r¨ˆj, r¨t-ƒ‚q¨nˆj.d | ƒ} |rÔ| rÔt/ƒ} ny€ˆj} t} ˆj j0rˆj1rˆj1} nˆj j0r+| r"t} q+t2} nt3ˆj ˆj"| | d ˆj4d | ƒWnEt5j6k r›} tj7dˆ| ƒtdˆ| ˆj fƒ‚nXtˆƒ}|jƒˆjræˆj j t8j9kræˆjˆjƒqænˆj süˆjƒnˆjr^ˆj:sˆj rKˆj;o-t<ˆjƒ s?ˆjˆ_=ndˆ_q^tjdˆƒn|j>|ƒ} yt?| ƒWn@t@k r½}ˆjAr­tjB|jCdƒq¾ˆjDƒ‚nXg‰‡‡‡fd†}ˆjEˆjFƒsþˆjGˆdƒn|sÁˆjHr,tjddj!ˆjHƒƒntItJˆjHƒtJ| jHƒƒ}x!|D]}tjBd| |ƒqUWtItJ| jHƒtJˆjHƒ@ƒ}x*| jK|ƒD]}||d|ƒq¤WnˆjLjMˆƒˆj røˆj røˆjNjMˆƒ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 %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(ORtpreparedR‘R:RwtinfoRJRLtAssertionErrorRSR®R<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ªR6RRRYRxtargstremove_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"