£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
U
    Qab                     @   s   d dl mZ d dlmZ d dlmZmZ d dlZd dlZd dl	Z	d dl
mZ d dlZd dlmZ d dlmZ d dlZeZG dd	 d	ejeZG d
d dZdS )    )convert_path)log)DistutilsErrorDistutilsOptionErrorN)six)easy_install)
namespacesc                   @   sv   e Zd ZdZdZejddg Zejdg ZdZdd Z	d	d
 Z
dd Zedd Zdd Zdd Zdd Zdd ZdS )developzSet up package for developmentz%install package in 'development mode')	uninstalluzUninstall this source package)z	egg-path=Nz-Set the path to be used in the .egg-link filer
   Fc                 C   s2   | j rd| _|   |   n|   |   d S )NT)r
   Zmulti_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_optionsself r   >/usr/lib/python3.8/site-packages/setuptools/command/develop.pyrun    s    
zdevelop.runc                 C   s&   d | _ d | _t|  d | _d| _d S )N.)r
   egg_pathr   initialize_options
setup_pathZalways_copy_fromr   r   r   r   r   )   s
    
zdevelop.initialize_optionsc                 C   s  |  d}|jr,d}|j|jf}t|| |jg| _t|  |   | 	  | j
td |jd }tj| j|| _|j| _| jd krtj|j| _t| j}ttj| j| j}||krtd| tj|t|tj|j|jd| _| | j| j| j| _d S )Negg_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 Zproject_name)get_finalized_commandZbroken_egg_infor   r   Zegg_nameargsr   finalize_optionsZexpand_basedirsZexpand_dirsZpackage_indexscanglobospathjoininstall_diregg_linkegg_baser   abspathpkg_resourcesnormalize_pathr   ZDistributionPathMetadatadist_resolve_setup_pathr   )r   Zeitemplater   Zegg_link_fntargetr   r   r   r   r   0   sF    




zdevelop.finalize_optionsc                 C   sn   |  tjdd}|tjkr0d|dd  }ttj	|||}|ttjkrjt
d|ttj|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   seprstripcurdircountr%   r&   r   r    r   )r#   r!   r   Zpath_to_setupZresolvedr   r   r   r)   Z   s    

zdevelop._resolve_setup_pathc              	   C   sH  t jrt| jddr| jddd | d | d}t|j	}| jd|d | d | jddd | d | d}|| _
|| j_t||j| j_n"| d | jdd	d | d |   tjr| tj d t_|   td
| j| j | js0t| jd}|| j
d | j  W 5 Q R X | d | j| j  d S )NZuse_2to3FZbuild_pyr   )Zinplacer   )r#   Z	build_extr-   zCreating %s (link to %s)w
)r   ZPY3getattrdistributionZreinitialize_commandZrun_commandr   r%   r&   Z	build_libr   r(   locationr'   r   Z	_providerZinstall_site_py
setuptoolsZbootstrap_install_fromr   Zinstall_namespacesr   infor"   r#   dry_runopenwriter   Zprocess_distributionZno_deps)r   Zbpy_cmdZ
build_pathZei_cmdfr   r   r   r   n   s:    




 


 zdevelop.install_for_developmentc                 C   s   t j| jrztd| j| j t| j}dd |D }|  || j	g| j	| j
gfkrhtd| d S | jszt | j | js| | j | jjrtd d S )NzRemoving %s (link to %s)c                 S   s   g | ]}|  qS r   )r0   ).0liner   r   r   
<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"   r   r9   r#   r;   closer   r   warnr:   unlinkZ
update_pthr(   r6   scripts)r   Zegg_link_filecontentsr   r   r   r      s     

zdevelop.uninstall_linkc              
   C   s   || j k	rt| |S | | | jjp*g D ]N}tjt	|}tj
|}t|}| }W 5 Q R X | |||| q,d S N)r(   r   install_egg_scriptsinstall_wrapper_scriptsr6   rE   r   r   r$   r   basenameior;   readZinstall_script)r   r(   Zscript_nameZscript_pathZstrmZscript_textr   r   r   rH      s    

zdevelop.install_egg_scriptsc                 C   s   t |}t| |S rG   )VersionlessRequirementr   rI   r   r(   r   r   r   rI      s    zdevelop.install_wrapper_scriptsN)__name__
__module____qualname____doc__descriptionr   Zuser_optionsZboolean_optionsZcommand_consumes_argumentsr   r   r   staticmethodr)   r   r   rH   rI   r   r   r   r   r	      s"   	*
0r	   c                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	rM   a  
    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'
    c                 C   s
   || _ d S rG   )_VersionlessRequirement__distrN   r   r   r   __init__   s    zVersionlessRequirement.__init__c                 C   s   t | j|S rG   )r5   rU   )r   namer   r   r   __getattr__   s    z"VersionlessRequirement.__getattr__c                 C   s   | j S rG   r   r   r   r   r   as_requirement   s    z%VersionlessRequirement.as_requirementN)rO   rP   rQ   rR   rV   rX   rY   r   r   r   r   rM      s   rM   )Zdistutils.utilr   Z	distutilsr   Zdistutils.errorsr   r   r   r   rK   Zsetuptools.externr   r%   Zsetuptools.command.easy_installr   r8   r   typeZ__metaclass__ZDevelopInstallerr	   rM   r   r   r   r   <module>   s    6