
    eXf                         d Z ddlZddlZddl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edefdZdedefdZd Zd ZdS )zD
Create a dist_info directory
As defined in the wheel specification
    N)contextmanager)cleandoc)Path)Command)log)	packaging)SetuptoolsDeprecationWarningc                   \    e 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dS )	dist_infozcreate a .dist-info directory))z	egg-base=ezjdirectory containing .egg-info directories (default: top of the source tree) DEPRECATED: use --output-dir.)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                 h    d | _         d | _        d | _        d | _        d | _        d | _        d| _        d S )NF)egg_base
output_dirnamedist_info_dirtag_date	tag_buildkeep_egg_info)selfs    U/var/www/html/Qu*py/bism/lib/python3.11/site-packages/setuptools/command/dist_info.pyinitialize_optionszdist_info.initialize_options(   s;    	!"    c                    | j         r/d}t          j        |t                     | j         p| j        | _        | j        }|j        pt          j        }t          | j        p|          | _        | 
                    d          }t          | j                  |_         | j        r| j        |_        n|j        | _        | j        r| j        |_        n|j        | _        |                                 || _        t!          |                                          }t%          |                                          }| d| | _        t          j                            | j        | j         d          | _        d S )NzA--egg-base is deprecated for dist_info command. Use --output-dir.egg_info-z
.dist-info)r   warningswarnr	   r   distributionsrc_rootoscurdirr   reinitialize_commandstrr   r   finalize_optionsr!   _safeget_name_versionget_versionr   pathjoinr   )r   msgdistproject_dirr!   r   versions          r   r+   zdist_info.finalize_options1   sN   = 	?UCM#;<<<"m>tDO m0ryt=+>>,,Z8800= 	. $H$-DM> 	0!%H%/DN!!### T]]__%%4++--..''g''	W\\$/di;S;S;STTr   dir_pathrequires_bkpc              #     K   |r| d}t          |d           t          ||dd           	 d V  t          |d           t          j        ||           d S # t          |d           t          j        ||           w xY wd V  d S )Nz.__bkp__T)ignore_errors)dirs_exist_oksymlinks)_rm_copyshutilmove)r   r6   r7   bkp_names       r   _maybe_bkp_dirzdist_info._maybe_bkp_dirP   s       
	",,,H----(HD4HHHH0HD1111Hh///// HD1111Hh////EEEEEs   A (Bc                 4   | j                             dd           | j                                         | j        j        }t          j                            |          s
J d            t          j        d	                    t          j        
                    | j                                       |                     d          }|                     || j                  5  |                    || j                   d d d            d S # 1 swxY w Y   d S )NT)parentsexist_okz&.egg-info dir should have been createdzcreating '{}'bdist_wheel)r   mkdirr!   runr'   r0   isdirr   infoformatabspathr   get_finalized_commandrA   r   egg2dist)r   egg_info_dirrE   s      r   rG   zdist_info.run^   sL   dT:::}-w}}\**TT,TTTT''8J(K(KLLMMM00??   t/ABB 	C 	C  t/ABBB	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	Cs   $DDDN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optr   r+   r   r*   boolrA   rG    r   r   r   r      s        1K
 
 
L "?3Oz*L# # #U U U> s $    ^C C C C Cr   r   	componentreturnc                 .    t          j        dd|           S )zAEscape a component used to form a wheel name according to PEP 491z	[^\w\d.]+_)resub)rX   s    r   r,   r,   l   s    6,Y///r   r5   c                 |   |                      dd          }	 t          t          j                            |                                         dd          S # t          j        j        $ rO d| d| d}t          j        t          |                     t          |          
                    d          cY S w xY w)z0Convert an arbitrary string to a version string. .r"   r[   zInvalid version: zk.
        !!


        ###################
        # Invalid version #
        ###################
        z is not valid according to PEP 440.

        Please make sure specify a valid version for your package.
        Also note that future releases of setuptools may halt the build process
        if an invalid version is given.
        

!!
        )replacer*   r   r5   VersionInvalidVersionr#   r$   r   r,   strip)r5   vr2   s      r   r.   r.   q   s    S!!A#9$,,Q//0088cBBB+ # # #
G 
 

 

 
 
 	hsmm$$$Qxx~~c"""""#s   ?A A B;:B;c                 l    t           j                            |           rt          j        | fi | d S d S )N)r'   r0   rH   r>   rmtree)dir_nameoptss     r   r<   r<      s@    	w}}X (h''$'''''( (r   c                 x    t           j        dk     r|                    dd            t          j        | |fi | d S )N)      r:   )sysversion_infopopr>   copytree)srcdstri   s      r   r=   r=      sD    
&  $'''
OC%%%%%%%r   )__doc__r'   r\   r>   rm   r#   
contextlibr   inspectr   pathlibr   distutils.corer   	distutilsr   setuptools.externr   setuptools._deprecation_warningr	   r   r*   r,   r.   r<   r=   rW   r   r   <module>r{      sc   
 
			 				  



  % % % % % %             " " " " " "       ' ' ' ' ' ' H H H H H HTC TC TC TC TC TC TC TCn0S 0S 0 0 0 0
#c #c # # # #*( ( (
& & & & &r   