MRe/@sddlmZddlmZmZddlmZmZmZddl m Z ddl m Z m Z ddlZddlZddlZddlZGdddeZdS) ) easy_install) convert_path subst_vars) Distribution PathMetadatanormalize_path)log)DistutilsErrorDistutilsOptionErrorNc@seZdZdZdZejddgZejdgZd Zd d Z d d Z ddZ ddZ ddZ ddZdS)developzSet up package for developmentz%install package in 'development mode' uninstalluUninstall this source package egg-path=N-Set the path to be used in the .egg-link fileFcCs7|jrd|_|jn |j|jdS)NT)r Z multi_versionuninstall_linkinstall_for_developmentZwarn_deprecated_options)selfr5/tmp/pip-l4uy7dan-build/setuptools/command/develop.pyruns     z develop.runcCs5d|_d|_tj|d|_d|_dS)N.)r egg_pathrinitialize_options setup_pathZalways_copy_from)rrrrrs     zdevelop.initialize_optionscCs|jd}|jr7td|j|jfn|jg|_tj||j|j |j j t j dt jj|j|jd|_|j|_|jdkrt jj|j|_nt|j}tt jj|j|j|kr!td|nt|t|t jj|jd|j|_|jjt jd}|t jkrd|jdd }n||_tt jj|j|j|}|tt jkrtd |tt jndS) Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to project_name/z../zGCan't get a consistent path to setup script from installation directory)get_finalized_commandZbroken_egg_infor regg_nameargsrfinalize_optionsexpand_basedirs expand_dirsZ package_indexscanglobospathjoin install_diregg_linkegg_baserabspathrr rrdistreplacesepcurdircountr)reitargetprrrr"'s@    " '  $zdevelop.finalize_optionscCstjdkrt|jddr|jddd|jd|jd}t|j}|jdd||jd|jd dd|jd |jd}||_ ||j _ t ||j |j _n-|jd|jd dd |jd |jtjr=|jtjdt_ntjd |j|j|jst|jd }|j|j d |j|jn|jd|j |j dS)NZuse_2to3Fbuild_pyZinplacerrr, build_extrzCreating %s (link to %s)w )r6)sys version_infogetattr distributionreinitialize_command run_commandrr build_librr.locationrr _providerZinstall_site_py setuptoolsZbootstrap_install_fromrrinfor+r,dry_runopenwritercloseZprocess_distributionno_deps)rZbpy_cmdZ build_pathZei_cmdfrrrrVs4$            zdevelop.install_for_developmentcCstjj|jrtjd|j|jt|j}dd|D}|j||j g|j |j gfkrtj d|dS|j stj |jqn|j s|j|jn|jjrtj dndS)NzRemoving %s (link to %s)cSsg|]}|jqSr)rstrip).0linerrr s z*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r'r(existsr+rrEr,rGrIrrwarnrFunlinkZ update_pthr.r>scripts)rZ egg_link_filecontentsrrrrs $   zdevelop.uninstall_linkcCs||jk rtj||S|j|x|jjp>gD]k}tjjt |}tjj |}t |d}|j }|j |j||||q?WdS)NrU)r.rinstall_egg_scriptsZinstall_wrapper_scriptsr>rSr'r(r-rbasenamerGreadrIZinstall_script)rr. script_nameZ script_pathrK script_textrrrrVs   zdevelop.install_egg_scripts)z uninstallr r)rNr)__name__ __module__ __qualname____doc__ descriptionr user_optionsboolean_optionsZcommand_consumes_argumentsrrr"rrrVrrrrr s    / . r )Zsetuptools.command.easy_installrdistutils.utilrr pkg_resourcesrrr distutilsrdistutils.errorsr r r'r;rDr&r rrrrs 0