
    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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dS )zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).    N)ClassVar   )Command)DistutilsOptionErrorDistutilsPlatformError)get_platformc                  ~    ddl m}  d t          j        D             } | |          }|                    d           dS )zAPrint list of available formats (arguments to "--format" option).r   )FancyGetoptc                 J    g | ] }d |z   dt           j        |         d         f!S )formats=N   )bdistformat_commands).0formats     c/home/jrussi/.local/pipx/shared/lib/python3.11/site-packages/setuptools/_distutils/command/bdist.py
<listcomp>z show_formats.<locals>.<listcomp>   sA        
f	dE$9&$A!$DE      z'List of available distribution formats:N)fancy_getoptr
   r   r   
print_help)r
   formatspretty_printers      r   show_formatsr      sa    ****** +  G ![))NGHHHHHr   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   appendzListCompat.append   s.    F	
 	
 	
 	
 	
 	
r   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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.no_format_optiongztarzip)posixnt)r0   zRPM distribution)
bdist_dumbzgzip'ed tar file)r6   zbzip2'ed tar file)r6   zxz'ed tar file)r6   zcompressed tar file)r6   ztar file)r6   zZIP file)rpmr2   bztarxztarztartarr3   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)r>   r@   r   get_finalized_commandr=   
build_baseospathjoinensure_string_listr   default_formatnameKeyErrorr   r?   )r!   rH   s     r   finalize_optionszbdist.finalize_optionsg   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 ''r6   r   T)r   r#   r   rO   r   rangelenreinitialize_commandr1   r   rB   rA   	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_optionsr1   r   tuplestr__annotations__rM   r   r   format_commandrC   rP   r\   r'   r   r   r   r   %   s         8K 	U+%+ + +	
 	N	

 	S	

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