ó þ¾v]c@sÛddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl Z ddl mZddlmZddlZeZdejefd „ƒYZd d d „ƒYZdS( iÿÿÿÿ(t convert_path(tlog(tDistutilsErrortDistutilsOptionErrorN(tsix(t easy_install(t namespacestdevelopcBs‹eZdZdZejddgZejdgZeZ d„Z d„Z d „Z e d „ƒZd „Zd „Zd „Zd„ZRS(sSet up package for developments%install package in 'development mode't uninstalltusUninstall this source packages egg-path=s-Set the path to be used in the .egg-link filecCsA|jr)t|_|jƒ|jƒn |jƒ|jƒdS(N(RtTruet multi_versiontuninstall_linktuninstall_namespacestinstall_for_developmenttwarn_deprecated_options(tself((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pytrun s      cCs5d|_d|_tj|ƒd|_d|_dS(Nt.(tNoneRtegg_pathRtinitialize_optionst setup_pathtalways_copy_from(R((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyR)s     cCs|jdƒ}|jrCd}|j|jf}t||ƒ‚n|jg|_tj|ƒ|jƒ|j ƒ|j j t j dƒƒ|jd}t jj|j|ƒ|_|j|_|jdkrêt jj|jƒ|_ntj|jƒ}tjt jj|j|jƒƒ}||kr?td|ƒ‚ntj|tj|t jj|jƒƒd|jƒ|_|j|j|j|jƒ|_dS(Ntegg_infos-Please rename %r to %r before using 'develop's*.eggs .egg-linksA--egg-path must be a relative path from the install directory to t project_name(tget_finalized_commandtbroken_egg_infoRRtegg_nametargsRtfinalize_optionstexpand_basedirst expand_dirst package_indextscantglobtostpathtjoint install_dirtegg_linktegg_baseRRtabspatht pkg_resourcestnormalize_pathRt Distributiont PathMetadatatdistt_resolve_setup_pathR(RteittemplateRt egg_link_fnttargetR((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyR0s<        !cCs¥|jtjdƒjdƒ}|tjkrGd|jdƒd}ntjtjj |||ƒƒ}|tjtjƒkr¡t d|tjtjƒƒ‚n|S(sµ Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. t/s../isGCan't get a consistent path to setup script from installation directory( treplaceR$tseptrstriptcurdirtcountR+R,R%R&R(R)R'Rt path_to_setuptresolved((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyR0ZscCsÀtjrát|jdtƒrá|jdddƒ|jdƒ|jdƒ}tj |j ƒ}|jdd|ƒ|jdƒ|jdddƒ|jdƒ|jdƒ}||_ ||j _ tj||jƒ|j _n-|jdƒ|jdddƒ|jdƒ|jƒtjr=|jtjƒdt_n|jƒtjd |j|jƒ|js¢t|jd ƒ"}|j|j d |jƒWdQXn|jd|j |j ƒdS( Ntuse_2to3tbuild_pytinplaceiRR)t build_extisCreating %s (link to %s)tws (!RtPY3tgetattrt distributiontFalsetreinitialize_commandt run_commandRR+R,t build_libRR/tlocationR.Rt _providertinstall_site_pyt setuptoolstbootstrap_install_fromRRtinstall_namespacesRtinfoR(R)tdry_runtopentwriteRtprocess_distributiontno_deps(Rtbpy_cmdt build_pathtei_cmdtf((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyRns6            $cCsùtjj|jƒr½tjd|j|jƒt|jƒ}g|D]}|jƒ^qD}|j ƒ||j g|j |j gfkržtj d|ƒdS|j s½tj|jƒq½n|j sÙ|j|jƒn|jjrõtj dƒndS(NsRemoving %s (link to %s)s$Link points to %s: uninstall aborteds5Note: you must uninstall or replace scripts manually!(R$R%texistsR(RROR)RQR8tcloseRRtwarnRPtunlinkt update_pthR/RDtscripts(Rt egg_link_filetlinetcontents((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyR žs     cCs±||jk rtj||ƒS|j|ƒx~|jjp>gD]j}tjjt |ƒƒ}tjj |ƒ}t j |ƒ}|j ƒ}WdQX|j||||ƒq?WdS(N(R/Rtinstall_egg_scriptstinstall_wrapper_scriptsRDR^R$R%R*RtbasenametioRQtreadtinstall_script(RR/t script_namet script_pathtstrmt script_text((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyRb°s cCst|ƒ}tj||ƒS(N(tVersionlessRequirementRRc(RR/((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyRcÂs (RR sUninstall this source packageN(s egg-path=Ns-Set the path to be used in the .egg-link file(t__name__t __module__t__doc__t descriptionRt user_optionsRtboolean_optionsREtcommand_consumes_argumentsRRRt staticmethodR0RR RbRc(((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyRs   * 0  RlcBs)eZdZd„Zd„Zd„ZRS(s© Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dS(N(t_VersionlessRequirement__dist(RR/((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyt__init__ÖscCst|j|ƒS(N(RCRu(Rtname((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyt __getattr__ÙscCs|jS(N(R(R((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pytas_requirementÜs(RmRnRoRvRxRy(((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyRlÇs   ((tdistutils.utilRt distutilsRtdistutils.errorsRRR$R#Retsetuptools.externRR+tsetuptools.command.easy_installRRLRttypet __metaclass__tDevelopInstallerRRl(((s@/tmp/pip-install-vZZv26/setuptools/setuptools/command/develop.pyts     µ