Viewing File: /opt/alt/python35/lib/python3.5/site-packages/setuptools/command/__pycache__/develop.cpython-35.pyc



\X@sddlmZddlmZddlmZmZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZddlmZddlmZddlZGd	d
d
ejeZGdddeZdS)
)convert_path)log)DistutilsErrorDistutilsOptionErrorN)six)DistributionPathMetadatanormalize_path)easy_install)
namespacesc@seZdZdZdZejddgZejdgZd	Zd
dZ	dd
Z
ddZeddZ
ddZddZddZddZdS)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 fileFcCsA|jr)d|_|j|jn
|j|jdS)NT)r
Z
multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_options)selfr/develop.pyruns		


zdevelop.runcCs5d|_d|_tj|d|_d|_dS)N.)r
egg_pathr
initialize_options
setup_pathZalways_copy_from)rrrrr's
		
	zdevelop.initialize_optionscCs|jd}|jr@d}|j|jf}t|||jg|_tj||j|j	|j
jtjd|jd}t
jj|j||_|j|_|jdkrt
jj|j|_t|j}tt
jj|j|j}||kr0td|t|t|t
jj|jd|j|_|j|j|j|j|_dS)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)get_finalized_commandZbroken_egg_inforrZegg_nameargsr
finalize_optionsZexpand_basedirsZexpand_dirsZ
package_indexscanglobospathjoininstall_diregg_linkegg_baserabspathr	rrrdist_resolve_setup_pathr)reitemplaterZegg_link_fntargetrrrrr .s<	




zdevelop.finalize_optionscCs|jtjdjd}|tjkrDd|jdd}ttjj|||}|ttjkrt	d|ttj|S)z
        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.
        /z../zGCan't get a consistent path to setup script from installation directory)
replacer#seprstripcurdircountr	r$r%r)r(r&rZ
path_to_setupZresolvedrrrr+Xszdevelop._resolve_setup_pathcCstjrt|jddr|jddd|jd|jd}t|j}|jdd||jd|jddd|jd|jd}||_	||j
_t||j
|j
_n-|jd|jddd	|jd|jtjr4|jtjdt_|jtjd
|j|j|jst|jd"}|j|j	d|jWdQRX|jd|j
|jdS)
NZuse_2to3FZbuild_pyZinplacerrr(Z	build_extr0zCreating %s (link to %s)w
)rZPY3getattrdistributionZreinitialize_commandZrun_commandrr	Z	build_librr*locationrrZ	_providerZinstall_site_py
setuptoolsZbootstrap_install_fromr
Zinstall_namespacesrinfor'r(dry_runopenwriterZprocess_distributionZno_deps)rZbpy_cmdZ
build_pathZei_cmdfrrrris4


	


		
	"zdevelop.install_for_developmentcCstjj|jrtjd|j|jt|j}dd|D}|j||j	g|j	|j
gfkrtjd|dS|jstj
|j|js|j|j|jjrtjddS)NzRemoving %s (link to %s)cSsg|]}|jqSr)r3).0linerrr
<listcomp>s	z*develop.uninstall_link.<locals>.<listcomp>z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r#r$existsr'rr<r(r>closerrwarnr=unlinkZ
update_pthr*r9scripts)rZ
egg_link_filecontentsrrrrs
		zdevelop.uninstall_linkc
Cs||jk	rtj||S|j|x|jjp>gD]k}tjjt	|}tjj
|}tj|}|j
}WdQRX|j||||q?WdS)N)r*r
install_egg_scriptsinstall_wrapper_scriptsr9rHr#r$r)rbasenameior>readZinstall_script)rr*Zscript_nameZscript_pathZstrmZscript_textrrrrJs
zdevelop.install_egg_scriptscCst|}tj||S)N)VersionlessRequirementr
rK)rr*rrrrKszdevelop.install_wrapper_scripts)r
rr)rNr)__name__
__module____qualname____doc__descriptionr
Zuser_optionsZboolean_optionsZcommand_consumes_argumentsrrr staticmethodr+rrrJrKrrrrrs
	*/rc@s:eZdZdZddZddZddZdS)	rOaz
    Adapt a pkg_resources.Distribution to simply return the project
    name as the 'requirement' so that scripts will work across
    multiple versions.

    >>> 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)_VersionlessRequirement__dist)rr*rrr__init__szVersionlessRequirement.__init__cCst|j|S)N)r8rV)rnamerrr__getattr__sz"VersionlessRequirement.__getattr__cCs|jS)N)r)rrrras_requirementsz%VersionlessRequirement.as_requirementN)rPrQrRrSrWrYrZrrrrrOsrO)Zdistutils.utilrZ	distutilsrZdistutils.errorsrrr#r"rMZsetuptools.externrZ
pkg_resourcesrrr	Zsetuptools.command.easy_installr
r;rZDevelopInstallerrobjectrOrrrr<module>s
Back to Directory File Manager