
    ?wg/              	           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m	Z	 ddl
mZ d Z G d	 d
eeeeef   f         Z G d de      Zy)zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).    N)ClassVar   )Command)DistutilsOptionErrorDistutilsPlatformError)get_platformc                      ddl m}  t        j                  D cg c]  }d|z   dt        j                  |   d   f  }} | |      }|j	                  d       yc c}w )zAPrint list of available formats (arguments to "--format" option).r   )FancyGetoptformats=N   z'List of available distribution formats:)fancy_getoptr
   bdistformat_commands
print_help)r
   formatformatspretty_printers       Z/var/www/horilla/myenv/lib/python3.12/site-packages/setuptools/_distutils/command/bdist.pyshow_formatsr      sf    * ++ 
f	dE$9$9&$A!$DEG  !)NGHs   #Ac                       e Zd Zd Zy)
ListCompatc                 <    t        j                  dt        d       y )Nz4format_commands is now a dict. append is deprecated.r   )
stacklevel)warningswarnDeprecationWarning)selfitems     r   appendzListCompat.append   s    F	
    N)__name__
__module____qualname__r    r    r   r   r      s    
r    r   c            
           e Zd ZU dZdddd e        dfddd	d
dgZdgZdddefgZdZ	e
eedf      ed<   dddZ edddddddd      ZeZd Zd Zd  Zy)!r   z$create a built (binary) distribution)zbdist-base=bz4temporary directory for creating built distributionsz
plat-name=pz8platform name to embed in generated filenames [default: ])r   Nz/formats for distribution (comma-separated list))z	dist-dir=dz=directory to put final built distributions in [default: dist])
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]r*   zhelp-formatsNz$lists available distribution formats)	bdist_rpm.no_format_optiongztarzip)posixnt)r-   zRPM distribution)
bdist_dumbzgzip'ed tar file)r3   zbzip2'ed tar file)r3   zxz'ed tar file)r3   zcompressed tar file)r3   ztar file)r3   zZIP file)rpmr/   bztarxztarztartarr0   c                 f    d | _         d | _        d | _        d | _        d| _        d | _        d | _        y )NF)
bdist_base	plat_namer   dist_dir
skip_buildgroupowner)r   s    r   initialize_optionszbdist.initialize_options^   s3    

r    c                 B   | j                   <| j                  rt               | _         n | j                  d      j                   | _         | j                  M| j                  d      j
                  }t        j                  j                  |d| j                   z         | _        | j                  d       | j                  $	 | j                  t        j                     g| _
        | j                  d| _        y y # t        $ r t        dt        j                         w xY w)Nbuildzbdist.r   z9don't know how to create built distributions on platform dist)r;   r=   r   get_finalized_commandr:   
build_baseospathjoinensure_string_listr   default_formatnameKeyErrorr   r<   )r   rE   s     r   finalize_optionszbdist.finalize_optionsg   s    >>!!-!%!;!;G!D!N!N
 ??"33G<GGJ ggll:x$..7PQDO	*<< $ 3 3BGG <= == "DM !  ,##%77)- s    #C8 8&Dc                    g }| j                   D ]$  }	 |j                  | j                  |   d          & t        t        | j                               D ]  }||   }| j                  |      }|| j                  vr| j                   |   |_	        |dk(  r"| j                  |_
        | j                  |_        |||dz   d  v rd|_        | j                  |        y # t        $ r t	        d| d      w xY w)Nr   zinvalid format ''r3   r   T)r   r   r   rL   r   rangelenreinitialize_commandr.   r   r?   r>   	keep_temprun_command)r   commandsr   icmd_namesub_cmds         r   runz	bdist.run   s   ll 	IFI 4 4V <Q ?@	I s4<<() 	'A{H//9Gt444!%a <' $

 $

 8AEG,,$(!X&	'	  I*-=fXQ+GHHIs   !CC4)r!   r"   r#   descriptionr   user_optionsboolean_optionsr   help_optionsr.   r   tuplestr__annotations__rJ   r   r   format_commandr@   rM   rY   r$   r    r   r   r   %   s    8K 	U%(+	
 	N	

 	S	

	
)L6 $nO 
E|TL
 3AhuS#X/@  'e4N !03415))" O %N#8'r    r   )__doc__rF   r   typingr   corer   errorsr   r   utilr   r   dictr_   r^   r   r   r$   r    r   <module>rh      sP   
 
    A 	I
c5c?*+ 
w'G w'r    