
    |g                         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e      Zd Zy)zD
Create a dist_info directory
As defined in the wheel specification
    N)contextmanager)Path)cast   )_normalization   )egg_info)log)Commandc                   X    e Zd ZdZdZg dZddgZddiZd Zd Z	e
d	ed
efd       Zd Zy)	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                 X    d | _         d | _        d | _        d | _        d | _        d| _        y )NF)
output_dirnamedist_info_dirtag_date	tag_buildkeep_egg_info)selfs    Y/var/www/html/pythonbot/venv/lib/python3.12/site-packages/setuptools/command/dist_info.pyinitialize_optionszdist_info.initialize_options+   s.    	!"    c                    | j                   }|j                  xs t        j                  }t	        | j
                  xs |      | _        t        t        | j                  d            }t        | j
                        |_
        | j                  r| j                  |_        n|j                  | _        | j                  r| j                  |_        n|j                  | _        |j                          || _        t        j                   |j#                               }t        j$                  |j'                               }| d| | _        t        j*                  j-                  | j
                  | j(                   d      | _        y )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   versions         r   r*   zdist_info.finalize_options3   s     mm0ryyt=+>d&?&?
&KL0== $H$--DM>>!%H%//DN!!# ((9 ::4;K;K;MNfAgY'	WW\\$//dii[
;STr   dir_pathrequires_bkpc              #     K   |rT| d}t        |d       t        j                  ||dd       	 d  t        |d       t        j                  ||       y d  y # t        |d       t        j                  ||       w xY ww)Nz.__bkp__T)ignore_errors)dirs_exist_oksymlinks)_rmshutilcopytreemove)r   r4   r5   bkp_names       r   _maybe_bkp_dirzdist_info._maybe_bkp_dirM   so     "8,H-OOHhdTR0HD1Hh/ HD1Hh/s   .BA )B%BBc                 <   | j                   j                  dd       | j                  j                          | j                  j                  }t        j
                  j                  |      sJ d       t        j                  dj                  t        j
                  j                  | j                                     | j                  d      }| j                  || j                        5  |j                  || j                         d d d        y # 1 sw Y   y xY w)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_dirrC   s      r   rE   zdist_info.run[   s    dT:}}--ww}}\*T,TT*''8J8J(KLM00?   t/A/AB 	C  t/A/AB	C 	C 	Cs   ,DDN)__name__
__module____qualname____doc__descriptionuser_optionsboolean_optionsnegative_optr   r*   r   r(   boolr?   rE    r   r   r   r      s_    
 UKL "?3Oz*L#U4 s $  Cr   r   c                 p    t         j                  j                  |       rt        j                  | fi | y y )N)r$   r/   rF   r;   rmtree)dir_nameoptss     r   r:   r:   i   s(    	ww}}Xh'$' r   )rP   r$   r;   
contextlibr   pathlibr   typingr    r   r	   r&   	distutilsr
   distutils.corer   r   r:   rV   r   r   <module>ra      s=   
 
  %    .  "SC SCl(r   