9Tc@@s|ddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZddlmZmZddlmZddlmZdd lmZddlZdd lmZmZdd l m!Z!m"Z"m#Z#m$Z$dd l%m&Z&m'Z'm(Z(dd l)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;ddl<m=Z=ddl>m?Z?ddl@mAZAddlBmCZCddlmDZDmEZEmFZFddlGmHZHejIeJZKdeLfdYZMdZNdZOdZPeQdZRdS(i(tabsolute_importN(t change_root(t sysconfig(t FeedParser(t pkg_resourcestsix(t interpret(t configparser(tparse(t native_strtWINDOWS(tis_urlt url_to_patht path_to_urltis_archive_file(tInstallationErrortUninstallationErrortUnsupportedWheel(tbin_pytrunning_under_virtualenvtPIP_DELETE_MARKER_FILENAMEtbin_user( t display_pathtrmtreetask_path_existst backup_dirtis_installable_dirtdist_in_usersitetdist_in_site_packagest egg_link_pathtmake_path_relativetcall_subprocesstread_text_filetFakeFilet_make_build_dir(tRemovedInPip8Warning(t indent_log(tUninstallPathSet(tvcs(tmove_wheel_filestWheelt wheel_ext(tVersiontInstallRequirementc B@seZd"ed"eed"ed"ed Zed"d"edZed"edZdZ e dZ dZ dZ dZe dZe d Ze d Zd Zd Zd ZdZdZejdZe dZdZedZedZdZdZdZ dZ!dZ"d#d"dZ#dZ$d$dZ%dZ&dZ'e dZ(d"d Z)d!Z*RS(%c C@sd|_t|tjr<tjj|}|j|_n||_||_||_ ||_ |dkrui}n||_ ||_ ||_| |_d|_d|_d|_d|_||_d|_d|_t|_d|_| |_| |_dS(N((textrast isinstanceRt string_typesRt RequirementRtreqt comes_fromt source_dirteditabletNoneteditable_optionsturltas_eggtmarkerst_egg_info_patht satisfied_bytconflicts_witht_temp_build_dirtupdatetinstall_succeededt uninstalledtFalset use_user_sitet target_dirt pycompiletisolated( tselfR0R1R2R3R6R7R=R5RCR8RD((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt__init__1s2                     c C@st||\}}}}|jdr9t|} nd} |||d| dtd|d|d|} |dk r|| _n| S(Nsfile:R2R3R6R5RD(tparse_editablet startswithR R4tTrueR,( tclst editable_reqR1t default_vcsRDtnameR6textras_overrideR5R2tres((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt from_editableZs   c C@s[ddlm}d}t|r+d}nd}||krs|j|d\}}|j}|syd}qynd}|j}d}tjjtjj |} d} t|r||} ntjj | r1tjj |ks|j dr1t | std|n|t|} nFt| rwtjj| sbtjd|n|t|} n| r6| j}| jd krtjd |rttjjtjj | j}n| jtkr*t| j} | jstd | jnd | j| jf}q<| j }n|}|||d |d|d|S(sCreates an InstallRequirement from a name, which might be a requirement, directory containing 'setup.py', filename, or URL. i(tLinks; t;it.s;Directory %r is not installable. File 'setup.py' not found.sARequirement %r looks like a filename, but the file does not existtfiles\.\./s-%s is not a supported wheel on this platform.s%s==%sR6R8RDN(!t pip.indexRQR4R tsplittstriptostpathtnormpathtabspathtisdirtsepRHRRR RtisfiletloggertwarningR6tschemetretsearchtextR)R(tfilenamet supportedRRMtversiont egg_fragment( RJRMR1RDRQR6t marker_sepR8R0RYtlinktwheel((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt from_lineosZ       !     !*  cC@s|jr8t|j}|jrA|d|j7}qAn |j}|jdk rm|dt|jj7}n|jrt|jt j r|j}n|jj }|r|d|7}qn|S(Ns from %ss in %ss (from %s)( R0tstrR6R:R4RtlocationR1R-RR.t from_path(REtsR1((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt__str__s     cC@s |jjS(N(R0t specifier(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRrscC@sy|jdkrdSt|j}|jrut|jtjrL|j}n|jj}|ru|d|7}qun|S(Ns->(R0R4RmR1R-RR.Ro(RERpR1((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRos  cC@s|jdk r|jS|jdkrJtjdd|_||_|jS|jre|jj}n |j}t j j |st |nt j j ||S(Ns-buildspip-(R<R4R0ttempfiletmkdtempt_ideal_build_dirR3RMtlowerRXRYtexistsR"tjoin(REt build_dirRM((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytbuild_locations    cC@s3|jdk rdS|jdk s(t|js7t|j}|j}|`|jrj|jj}n |j}t j j ||}t j j |st jd|t|nt j j |rtdt|nt jd|t|t|tj||||_||_d|_dS(skIf the build location was a temporary directory, this will move it to a new more permanent locationNsCreating directory %ss<A package already exists in %s; please remove it to continues,Moving package %s from %s to new location %s(R2R4R0tAssertionErrorR<RuR3RMRvRXRYRxRwR_tdebugR"RRtshutiltmoveR9(REt old_locationt new_build_dirRMt new_location((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytcorrect_build_locations2       cC@s#|jdkrdSt|jjS(N(R0R4R t project_name(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRM scC@s,|jdkrdStj|jjjS(N(R0R4t urllib_parsetquoteRRv(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyturl_namescC@syddl}Wntk r/tdnXd}|jrsd|jkrstjj|j|jd|}ntjj|j|}tj rt |tj r|j t j}n|S(NisBsetuptools must be installed to install from a source distributionssetup.pyt subdirectory(t setuptoolst ImportErrorRR5RXRYRxR2RtPY2R-t text_typetencodetsystgetfilesystemencoding(RERt setup_filetsetup_py((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRs    cC@sw|jst|jr4tjd|j|jntjd|j|jt|jdkrtj j tj j |jd rt tj j |jdn|j }|jdt|j}|jdt|j}tjd|g}|jr|d g7}n|d g}|jr3g}nFtj j |jd }tj j|smtj|nd d g}|j}|jrd |jkrtj j ||jd }nt||d|d|jdtdtjddWdQX|jssttj|j dt!r%d}nd}tj"j#dj |j d||j dg|_|j$ndS(Ns2Running setup.py (path:%s) egg_info for package %ss7Running setup.py (path:%s) egg_info for package from %st distributeRsdistribute.egg-infot __SETUP_PY__t __PKG_NAME__s-cs --no-user-cfgtegg_infos pip-egg-infos --egg-baseRtcwdt filter_stdoutt show_stdoutt command_levelt command_descspython setup.py egg_infoR*s==s===ttName(%R2R{RMR_R|RR6R$RXRYR\RxRt _run_setup_pytreplacetreprRt executableRDR3RwtmakedirsR5Rt_filter_installR@tloggingtDEBUGR0R-Rt parse_versiontpkg_infoR*R/RR(REtscripttbase_cmdt egg_info_cmdtegg_base_optiont egg_info_dirRtop((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt run_egg_info1sb                    s __file__ = __SETUP_PY__ from setuptools.command import egg_info import pkg_resources import os import tokenize def replacement_run(self): self.mkpath(self.egg_info) installer = self.distribution.fetch_build_egg for ep in pkg_resources.iter_entry_points('egg_info.writers'): # require=False is the change we're making: writer = ep.load(require=False) if writer: writer(self, ep.name, os.path.join(self.egg_info,ep.name)) self.find_sources() egg_info.egg_info.run = replacement_run exec(compile( getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec' )) cC@sy|jdk r5|jj|s%dS|jj|S|jsDt|j|}tjj |sidSt |}|S(N( R:R4t has_metadatat get_metadataR2R{t egg_info_pathRXRYRwR (RERetdata((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt egg_info_datas c C@s<|jdkr&|jr$|j}ntjj|jd}tj|}|jrg}xtj|D] \}}}x-t j D]"}||kr|j |qqWxt |D]}tjj tjj||dds tjj tjj||ddr|j |q|dks2|dkr|j |qqW|jg|D]}tjj||^qSqjWg|D]}|jdr|^q}n|std ||fn|std ||ft|d kr|jd d ntjj||d |_ntjj|j|S(Ns pip-egg-infotbintpythontScriptss Python.exettestttestss .egg-infos$No files/directories in %s (from %s)itkeycS@s8|jtjjtjjr3|jtjjp6dS(Ni(tcountRXRYR]taltsep(tx((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytsi(R9R4R3R2RXRYRxtlistdirtwalkR&tdirnamestremovetlistRwtextendtendswithRR{tlentsort( RERetbaset filenamestroottdirstfilestdirtf((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRsB        *+   cC@s]t}|jd}|s@tjdt|jdn|j|pOd|jS(NsPKG-INFOsNo PKG-INFO file found in %sR(RRR_R`RRtfeedtclose(REtpR((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRs s \[(.*?)\]cC@sAtjj|j}tj}|j|}|r=|jSdS(N(RR/RRMt WorkingSettfindRg(RER0t working_settdist((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytinstalled_versions  cC@sj|jst|jd}||jkrGtjd||jntjdt|j||dS(NRgs'Requested %s, but installing version %ss;Source in %s has version %s, which satisfies requirement %s( R2R{RR0R_R`RR|R(RERg((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytassert_source_matches_versions  cC@s|js tjd|jdS|js/t|js>t|jjdrTdSd|jksvtd|j|jsdS|jjdd\}}t j |}|r||j}|r|j |jq |j |jnds td|j|fdS(Ns>Cannot update repository at %s; repository location is unknownsfile:t+s bad url: %riis+Unexpected version control type (in %s): %s( R6R_R|R2R3R{RHR=RVR&t get_backendtobtaintexport(RERtvc_typeR6tbackendt vcs_backend((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytupdate_editables,  "  cC@sG|js%td|jfn|jp4|j}t|}t|}|jojtj j |j}t |j dd}|r0t|d%}tj j|jj}WdQX||jkstd||j|jf|j|tj jtj j|d} |j| |jnV|r|jjdr|j|j|jdrx|jdjD]7} tj jtj j|j| } |j| q}Wq|jd r|jd r|jd } ng} xg|jd jD]} | r | | kr | ^q D]M}tj j|j|} |j| |j| d |j| d q,Wqn|rtjd j|jt |j|n|jjdr+|j|jtj j!|jd}tj jtj j|jd} |j| d|n[|rp|jjdrpx@t"j#j$|D]} |j| qVWnt%j&d||j|jdr!|j'dr!xz|j(dD]f}t)|rt*}nt+}|jtj j||t,r|jtj j||dqqWn|jdr-t-j.}|j/t0|j1d|j2dr-x|j3dD]\}}t)|rt*}nt+}|jtj j||t,rw|jtj j||d|jtj j||d|jtj j||dqwqwWq-n|j4|||_5dS(s Uninstall the distribution currently satisfying this requirement. Prompts before removing or modifying files unless ``auto_confirm`` is True. Refuses to delete or modify files outside of ``sys.prefix`` - thus uninstallation within a virtual environment can only modify that virtual environment, even if the virtualenv is linked to global site-packages. s.Cannot uninstall requirement %s, not installedRYtrNs;Egg-link %s does not match installed location of %s (at %s)seasy-install.pths .egg-infosinstalled-files.txts top_level.txtsnamespace_packages.txts.pys.pycsUninstalling a distutils installed project ({0}) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.s.eggis./s .dist-infos)Not sure how to uninstall: %s - Check: %stscriptss.batsentry_points.txttconsole_scriptss.exes .exe.manifests -script.py(6tcheck_if_existsRRMR:R;R%RRRXRYRwtgetattrt _providerR4topentnormcasetreadlineRWRnR{taddRxtdirnametadd_pthRRRt splitlinesRZtwarningstwarntformatR#RVtpipRktuninstallation_pathsR_R|tmetadata_isdirtmetadata_listdirRRRR RtSafeConfigParsertreadfpR!tget_metadata_linest has_sectiontitemsRR?(REt auto_confirmRtpaths_to_removetdevelop_egg_linktegg_info_existstdistutils_egg_infotfht link_pointerteasy_install_pthtinstalled_fileRYt namespacesRt top_level_pkgteasy_install_eggRtbin_dirtconfigRMtvalue((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt uninstalls   $    "      *   ' cC@s0|jr|jjntjd|jdS(Ns'Can't rollback %s, nothing uninstalled.(R?trollbackR_terrorR(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytrollback_uninstalls cC@s0|jr|jjntjd|jdS(Ns%Can't commit %s, nothing uninstalled.(R?tcommitR_RR(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytcommit_uninstalls cC@s|jstt}d|j|jdf}tjj||}tjj|rt dt |d}|dkrt }q|dkrt j dt |tj|q|dkrt|}t j dt |t |tj||qn|rtj|dtjd t}tjjtjj|j}xtj|D]\} } } d | kr| jd nxl| D]d} tjj| | } |j| |} tj|jd | d }d|_|j|dqWxb| D]Z}|tkrqntjj| |}|j||} |j||jd | qWq[W|jt jdt |ndS(Ns %s-%s.zipRgs/The file %s exists. (i)gnore, (w)ipe, (b)ackup titwtbs Deleting %ssBacking up %s to %st allowZip64s pip-egg-infot/iiRsSaved %s(R R R i( R2R{RIRMRRXRYRxRwRRR@R_R`RRR}R~tzipfiletZipFilet ZIP_DEFLATEDRR[Rt_clean_zip_nametZipInfot external_attrtwritestrRtwriteRtinfo(RERytcreate_archivet archive_namet archive_pathtresponset dest_filetzipRtdirpathRRRRMtzipdirRe((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytarchivesT        !     # cC@s_|j|tjjs/td||f|t|d}|jtjjd}|S(Ns$name %r doesn't start with prefix %riR(RHRXRYR]R{RR(RERMtprefix((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRs cC@s$|jdk rt|jStSdS(N(R8R4tmarkers_interpretRI(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt match_markerss c @s|jr|j||dS|jrttjj|j}tjj||j|j |jdt |_ dS|j rt |dg}ntjdd}tjj|d}ztjg}|jd|jd|j|t |dd |g7}|js |d g7}ndk r?|d g7}n|jrX|d g7}n |d g7}trdtj}|dtjjtjdd|g7}ntjd|jt +t!||d|jd|j"dt#WdQXtjj$|stj%d|dSt |_ |jr.dSfd} t&|]} xS| D]7} tjj'| } | j(drS| | } PqSqSWtj)d|dSWdQXg}t&|e} x[| D]S} | j*}tjj+|r|tjj,7}n|jt-| || qWWdQXtjj| d}t&|d!} | j.dj|dWdQXWdtjj$|rtj/|nt0|XdS(NRs --no-user-cfgs-recordspip-sinstall-record.txts-csimport setuptools, tokenize;__file__=%r;exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))tinstalls--records#--single-version-externally-manageds--roots --compiles --no-compileRs--install-headerstincludetsitesRunning setup.py install for %sRRRsRecord file %s not foundc@s4dkstjj| r#|St|SdS(N(R4RXRYtisabsR(RY(R(s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt prepend_root+ss .egg-infos;Could not find .egg-info directory in install record for %ssinstalled-files.txtR s (1R3tinstall_editabletis_wheelRRkt wheel_versionR2tcheck_compatibilityRMR'RIR>RDRRsRtRXRYRxRRtappendRR7R4RCRRtget_python_versionR"R_RR$RRR@RwR|RRRR`RWR\R]RRRR(REtinstall_optionstglobal_optionsRRgt temp_locationtrecord_filenamet install_argst py_ver_strR)Rtlinet directoryRt new_linesRetinst_files_path((Rs9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyR%s                         $cC@s|jrPtjjtjj|jtrPtjd|jt|jnd|_|j rtjj|j rt|j nd|_ dS(sVRemove the source files from this requirement, if they are marked for deletionsRemoving source in %sN( R2RXRYRwRxRR_R|RR4R<(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytremove_temporary_sourceRs c C@stjd|j|jr2t|dg}nt|j}|jr|d|jkr|tj j ||jd}nt t j dd|jgt|ddgt|d|d |jd tWdQXt|_dS( NsRunning setup.py develop for %ss --no-user-cfgRs-csimport setuptools, tokenize; __file__=%r; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))tdevelops --no-depsRRR(R_RRMRDRR$R2R5RXRYRxRRRRRR@RIR>(RER0R1R((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyR*^s     7 c C@swtj}xaddddddddd d d d d g D]2}| s\tj||jr7tj}Pq7q7W||fS(Ns ^running .*s ^writing .*s ^creating .*s^[Cc]opying .*s ^reading .*s4^removing .*\.egg-info' \(and everything under it\)$s^byte-compiling s ^SyntaxError:s^SyntaxWarning:s^\s*Skipping implicit fixer: s;^\s*(warning: )?no previously-included (files|directories) s+^\s*warning: no files found matching \'.*\'s7^warning: manifest_maker: standard file '-c' not found$(RtINFORbRcRWR(RER6tleveltregex((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyR{s&   cC@s|jdkrtSyJ|jjdkrG|jrG|jjdkrGtStj|j|_Wntj k rttStj k rtj|jj}|j rt |r||_qt rt|rtd|j|jfqq||_nXtS(sFind an installed distribution that satisfies or conflicts with this requirement, and set self.satisfied_by or self.conflicts_with appropriately.RRsVWill not install to the user site because it will lack sys.path precedence to %s in %sN(R0R4R@RR;RIRtget_distributionR:tDistributionNotFoundtVersionConflictRARRRRRn(REt existing_dist((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRs.       cC@s|jod|jkS(Ns.whl(R6(RE((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyR+scC@sDt|j|j|d|jd|jd|d|jd|jdS(NtuserthomeRRCRD(R'RMR0RARBRCRD(REtwheeldirR((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyR's   cC@sz|jd}tjj|}tj||}tjjtjj|d}tjtjj|d|d|S(sAReturn a pkg_resources.Distribution built from self.egg_info_pathRiRtmetadata( RRXRYRRt PathMetadatatsplitexttbasenamet Distribution(RERtbase_dirRFt dist_name((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytget_dists"N(((+t__name__t __module__R4R@RIRFt classmethodRPRlRqtpropertyRrRoRzRRMRRRRRRRRbtcompilet_requirements_section_reRRRRRR R!RR$R%R:R*RRR+R'RM(((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyR+/sN 'G    ] 6      .  h   ' cC@s.tjd|}|r*|jd}n|S(s2 Strip req postfix ( -dev, 0.2, etc ) s^(.*?)(?:-dev|-\d.*)$i(RbRctgroup(R0tmatch((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt_strip_postfixscC@s|g|jdddjdD]}|r |^q }d}|dd kr[|d }n|d d krx|d}n|S(Nt#iiRittagstbranchesttagtbranchiittrunk(RXRYstagsbranch(RVR4(R6RtpartsR0((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt_build_req_from_urls8  cC@s{tjd}|j|}|rwt}xC|D];}|\}}||kretd|n|||[^&=]+)=(?P[^&=]+)s%s option already definedN(RbRRtfindalltdictt ExceptionR4(R0tregexptmatchedtrettoptionRMR((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyt_build_editable_optionss    cC@st|}d}tjd|}|rE|jd}|jd}n|}tjj|rtjjtjj|dst d|nt |}n|j j dr|rd|t jjd|jifSd|difSnx;tD]3}|j j d|rd ||f}PqqWd |kre|rR|d |}qet d |n|jd dd j }tj|sd |djgtjD]}|jd^qd} t | nyt|} Wn)tk r} t d|| fnX| s&d| krNt|} | sXt d|qXn | d} t| } | |d| fS(sParses an editable requirement into: - a requirement name - an URL - extras - editable options Accepted requirements: svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir .[some_extra] s^(.+)(\[[^\]]+\])$iissetup.pys;Directory %r is not installable. File 'setup.py' not found.sfile:t__placeholder__s%s:s%s+%sRsb%s should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+isFor --editable=%s only s, s+URLs is currently supporteds*--editable=%s error in editable options:%steggs@--editable=%s is not the right format; it must have #egg=PackageN(R4RbRURTRXRYR\RwRxRR RvRHRR/RR,R&RVRtbackendsRMRfRaR^RV(RKRLR6R,tmt url_no_extrastversion_controlRRt error_messagetoptionstexcR0tpackage((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pyRGsd !      1   (St __future__RRRXRbR}RRsRRtdistutils.utilRt distutilsRt email.parserRt pip._vendorRRtpip._vendor.distlib.markersRR#tpip._vendor.six.movesRtpip._vendor.six.moves.urllibRRt pip.wheelRt pip.compatR R t pip.downloadR R R Rtpip.exceptionsRRRt pip.locationsRRRRt pip.utilsRRRRRRRRRRR R!R"tpip.utils.deprecationR#tpip.utils.loggingR$tpip.req.req_uninstallR%tpip.vcsR&R'R(R)tpip._vendor.packaging.versionR*t getLoggerRNR_tobjectR+RVR^RfR4RG(((s9/usr/lib/python2.7/vendor-packages/pip/req/req_install.pytsH         ""X