o
    Ëý°jÁ
  ã                   @   sd   d 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G dd„ deƒZ	dd„ Z
d	d
„ Zdd„ ZdS )z†distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.é    )ÚCommand)ÚlogÚdir_utilNc                   @   sF   e Zd ZdZdZdgZdd„ Zedd„ ƒZdd	„ Z	d
d„ Z
dd„ ZdS )Úinstall_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=Údzdirectory to install toc                 C   s
   d | _ d S ©N)Úinstall_dir©Úself© r   ú¡/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_egg_info.pyÚinitialize_options   s   
z#install_egg_info.initialize_optionsc                 C   s8   dt t| j ¡ ƒƒt t| j ¡ ƒƒgtjdd… ¢R  S )z_
        Allow basename to be overridden by child class.
        Ref pypa/distutils#2.
        z%s-%s-py%d.%d.egg-infoNé   )Úto_filenameÚ	safe_nameÚdistributionÚget_nameÚsafe_versionÚget_versionÚsysÚversion_infor	   r   r   r   Úbasename   s   þýzinstall_egg_info.basenamec                 C   s.   |   dd¡ tj | j| j¡| _| jg| _d S )NÚinstall_lib)r   r   )Úset_undefined_optionsÚosÚpathÚjoinr   r   ÚtargetÚoutputsr	   r   r   r   Úfinalize_options"   s   z!install_egg_info.finalize_optionsc                 C   sÖ   | j }tj |¡rtj |¡stj|| jd� n'tj |¡r+|  	tj
| j fd| ¡ ntj | j¡s?|  	tj| jfd| j ¡ t d|¡ | jsit|ddd��}| jj |¡ W d   ƒ d S 1 sbw   Y  d S d S )N)Údry_runz	Removing z	Creating z
Writing %sÚwzUTF-8)Úencoding)r   r   r   ÚisdirÚislinkr   Úremove_treer    ÚexistsÚexecuteÚunlinkr   Úmakedirsr   ÚinfoÚopenr   ÚmetadataÚwrite_pkg_file)r
   r   Úfr   r   r   Úrun'   s   ÿ"ÿÿzinstall_egg_info.runc                 C   s   | j S r   )r   r	   r   r   r   Úget_outputs5   s   zinstall_egg_info.get_outputsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚuser_optionsr   Úpropertyr   r   r/   r0   r   r   r   r   r      s    ÿ
r   c                 C   s   t  dd| ¡S )z�Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    ú[^A-Za-z0-9.]+ú-)ÚreÚsub©Únamer   r   r   r   =   s   r   c                 C   s   |   dd¡} t dd| ¡S )zÌConvert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    ú Ú.r8   r9   )Úreplacer:   r;   )Úversionr   r   r   r   E   s   r   c                 C   s   |   dd¡S )z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r9   Ú_)r@   r<   r   r   r   r   O   s   r   )r4   Údistutils.cmdr   Ú	distutilsr   r   r   r   r:   r   r   r   r   r   r   r   r   Ú<module>   s    2
