o
     zqf                     @   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                   @   sZ   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
dedef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   [/root/parts/websockify/install/lib/python3.10/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r'| j|_n|j| _| jr3| j|_n|j| _|  || _t| }t| }| d| | _tj| j| j d| _d S )Nr
   -z
.dist-info)distributionsrc_rootoscurdirr   r   r   egg_info_clsreinitialize_commandstregg_baser   r   finalize_optionsr
   r   
safer_nameget_namesafer_best_effort_versionget_versionr   pathjoinr   )r   distproject_dirr
   r   versionr   r   r   r&   2   s"   

zdist_info.finalize_optionsdir_pathrequires_bkpc              
   c   sx    |r7| d}t |dd tj||ddd zd V  W t |dd t|| d S t |dd t|| w d V  d S )Nz.__bkp__T)ignore_errors)dirs_exist_oksymlinks)_rmshutilcopytreemove)r   r0   r1   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|sJ dtd	tj
| j | d}| || j ||| j W d    d S 1 sGw   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_commandr:   r   egg2dist)r   egg_info_dirr=   r   r   r   r?   Z   s   

"zdist_info.runN)__name__
__module____qualname____doc__descriptionuser_optionsboolean_optionsnegative_optr   r&   r   r$   boolr:   r?   r   r   r   r   r      s    r   c                 K   s&   t j| rtj| fi | d S d S )N)r    r+   r@   r6   rmtree)dir_nameoptsr   r   r   r5   h   s   r5   )rJ   r    r6   
contextlibr   	distutilsr   distutils.corer   pathlibr   typingr    r   r
   r"   r   r5   r   r   r   r   <module>   s    V