
    7f                         d Z ddlZddlZddlmZ ddlmZmZ ddlm	Z	 d Z
 G d d	e          Z G d
 de          ZdS )zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).    N   )Command)DistutilsOptionErrorDistutilsPlatformError)get_platformc                      ddl m}  g }t          j        D ]3}|                    d|z   dt          j        |         d         f           4 | |          }|                    d           dS )zAPrint list of available formats (arguments to "--format" option).r   )FancyGetoptformats=N   z'List of available distribution formats:)fancy_getoptr	   bdistformat_commandsappend
print_help)r	   formatsformatpretty_printers       a/home/feoh/.local/pipx/shared/lib/python3.11/site-packages/setuptools/_distutils/command/bdist.pyshow_formatsr      s    ******G' V V
V+T53H3PQR3STUUUU [))NGHHHHH    c                       e Zd Zd ZdS )
ListCompatc                 >    t          j        dt          d           d S )Nz4format_commands is now a dict. append is deprecated.r   )
stacklevel)warningswarnDeprecationWarning)selfitems     r   r   zListCompat.append   s.    F	
 	
 	
 	
 	
 	
r   N)__name__
__module____qualname__r    r   r   r   r      s#        
 
 
 
 
r   r   c            
           e Zd Z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	dddZ
 edddddddd          ZeZd Zd Zd ZdS )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gztarzip)posixnt)r,   zRPM distribution)
bdist_dumbzgzip'ed tar file)r1   zbzip2'ed tar file)r1   zxz'ed tar file)r1   zcompressed tar file)r1   ztar file)r1   zZIP file)rpmr-   bztarxztarztartarr.   c                 h    d | _         d | _        d | _        d | _        d| _        d | _        d | _        d S )NF)
bdist_base	plat_namer   dist_dir
skip_buildgroupowner)r   s    r   initialize_optionszbdist.initialize_options\   s7    



r   c                    | j         :| j        rt                      | _         n|                     d          j         | _         | j        G|                     d          j        }t          j                            |d| j         z             | _        | 	                    d           | j
        I	 | j        t          j                 g| _
        n*# t          $ r t          dt          j                   w xY w| j        	d| _        d S d S )Nbuildzbdist.r   z9don't know how to create built distributions on platform dist)r9   r;   r   get_finalized_commandr8   
build_baseospathjoinensure_string_listr   default_formatnameKeyErrorr   r:   )r   rC   s     r   finalize_optionszbdist.finalize_optionse   s   >! O!-!%!;!;G!D!D!N
 ?"33G<<GJ gll:x$.7PQQDO	***< $ 3BG <=   ,-#%7- -   = "DMMM ! s   -C 'C2c                    g }| j         D ]J}	 |                    | j        |         d                    *# t          $ r t	          d| d          w xY wt          t          | j                             D ]}||         }|                     |          }|| j        vr| j         |         |_	        |dk    r| j
        |_
        | j        |_        |||dz   d          v rd|_        |                     |           d S )Nr   zinvalid format ''r1   r   T)r   r   r   rJ   r   rangelenreinitialize_commandno_format_optionr   r=   r<   	keep_temprun_command)r   commandsr   icmd_namesub_cmds         r   runz	bdist.run   s7   l 	I 	IFI 4V <Q ?@@@@ I I I*+Gf+G+G+GHHHI s4<(()) 	' 	'A{H//99Gt444!%a <'' $
 $
 8AEGG,,,$(!X&&&&	' 	's	   &4A)r    r!   r"   descriptionr   user_optionsboolean_optionsr   help_optionsrQ   rH   r   r   format_commandr>   rK   rX   r#   r   r   r   r   #   s       8K 	U+%+ + +	
 	N	

 	S	

	
)L6 $nO 
E|TL
 &  'e44N !j03415))" "  O %N  # # #8' ' ' ' 'r   r   )__doc__rD   r   corer   errorsr   r   utilr   r   dictr   r   r#   r   r   <module>rc      s    
 
			        A A A A A A A A      I I I
 
 
 
 
 
 
 
w' w' w' w' w'G w' w' w' w' w'r   