a
    ñ»j³  ã                   @   s„   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ d
dlmZ G dd„ deƒZdd„ ZdS )zD
Create a dist_info directory
As defined in the wheel specification
é    N)Úcontextmanager)Úlog)ÚCommand)ÚPath)Úcasté   )Ú_normalizationé   )Úegg_infoc                   @   sX   e Zd ZdZdZg d¢ZddgZddiZdd„ Zd	d
„ Z	e
eedœdd„ƒZdd„ ZdS )Ú	dist_infoz‡
    This command is private and reserved for internal use of setuptools,
    users should rely on ``setuptools.build_meta`` APIs.
    z@DO NOT CALL DIRECTLY, INTERNAL ONLY: create .dist-info directory))zoutput-dir=ÚozYdirectory inside of which the .dist-info will becreated [default: top of the source tree])útag-dateÚdz0Add date stamp (e.g. 20050528) to version number)z
tag-build=Úbz-Specify explicit tag to add to version number)úno-dateÚDz"Don't include date stamp [default])úkeep-egg-infoNz,*TRANSITIONAL* will be removed in the futurer   r   r   c                 C   s(   d | _ d | _d | _d | _d | _d| _d S )NF)Ú
output_dirÚnameÚdist_info_dirÚtag_dateÚ	tag_buildÚkeep_egg_info)Úself© r   úBE:\soccer\ml_env\Lib\site-packages\setuptools/command/dist_info.pyÚinitialize_options*   s    zdist_info.initialize_optionsc                 C   sÆ   | j }|jptj}t| jp|ƒ| _tt|  d¡ƒ}t	| jƒ|_
| jrN| j|_n|j| _| jrf| j|_n|j| _| ¡  || _t | ¡ ¡}t | ¡ ¡}|› d|› �| _tj | j| j› d�¡| _d S )Nr
   ú-z
.dist-info)ÚdistributionZsrc_rootÚosÚcurdirr   r   r   Úegg_info_clsÚreinitialize_commandÚstrZegg_baser   r   Úfinalize_optionsr
   r   Z
safer_nameÚget_nameZsafer_best_effort_versionÚget_versionr   ÚpathÚjoinr   )r   ÚdistZproject_dirr
   r   Úversionr   r   r   r$   2   s"    

zdist_info.finalize_options)Údir_pathÚrequires_bkpc              
   c   sv   |rl|› d�}t |dd� tj||ddd� z"d V  W t |dd� t ||¡ qrt |dd� t ||¡ 0 nd V  d S )Nz.__bkp__T)Úignore_errors)Údirs_exist_okÚsymlinks)Ú_rmÚshutilÚcopytreeÚmove)r   r+   r,   Zbkp_namer   r   r   Ú_maybe_bkp_dirL   s    
ÿzdist_info._maybe_bkp_dirc                 C   sš   | j jddd� | j ¡  | jj}tj |¡s6J dƒ‚t d 	tj 
| j¡¡¡ |  d¡}|  || j¡� | || j¡ W d   ƒ n1 sŒ0    Y  d S )NT)ÚparentsÚexist_okz&.egg-info dir should have been createdzcreating '{}'Úbdist_wheel)r   Úmkdirr
   Úrunr   r'   Úisdirr   ÚinfoÚformatÚabspathr   Úget_finalized_commandr4   r   Zegg2dist)r   Zegg_info_dirr7   r   r   r   r9   Z   s    

zdist_info.runN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚuser_optionsÚboolean_optionsÚnegative_optr   r$   r   r#   Úboolr4   r9   r   r   r   r   r      s   r   c                 K   s"   t j | ¡rtj| fi |¤Ž d S )N)r   r'   r:   r1   Úrmtree)Údir_nameÚoptsr   r   r   r0   h   s    r0   )rB   r   r1   Ú
contextlibr   Ú	distutilsr   Údistutils.corer   Úpathlibr   Útypingr   Ú r   r
   r!   r   r0   r   r   r   r   Ú<module>   s   V