
    lc7                        d dl mZ d dlZd dlZd dlmZ d dlmZ  ej	        d          Z
 ej	        d          ZddZdS )    )annotationsN)
WheelError)	WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$s   Build: (\d\w*)$	directorystrdest_dirbuild_number
str | Nonec                .     fdt          j                   D             }t          |          dk    rt          d            |st          d            |d         }t                              |                              d          }d}t           j                             |d          }t          |          5 }g }	|D ]}
|

                    d	          rA|	                    |
                    d
          d                                                    X|

                    d          r-|
                    d
          d                                         }|	s"t          d                    |                    	 ddd           n# 1 swxY w Y   ||n|}||r|d|z   z  }||k    r|rd|z                      d          nd}t          |d          5 }|                                }t"                              ||          \  }}|s||z  }|                    d           |                                 |                    |           ddd           n# 1 swxY w Y   t-          d |	D                       }t-          d |	D                       }t-          d |	D                       }d                    d                    |          d                    |          d                    |          g          }t           j                            || d| d          }t/          |d          5 }t1          d| ddd           |                                ddd           n# 1 swxY w Y   t1          d           dS )aB  Repack a previously unpacked wheel directory into a new wheel file.

    The .dist-info/WHEEL file must contain one or more tags so that the target
    wheel file name can be determined.

    :param directory: The unpacked wheel directory
    :param dest_dir: Destination directory (defaults to the current directory)
    c                    g | ][}t           j                            t           j                            |                    ?t                              |          Y|\S  )ospathisdirjoinDIST_INFO_REmatch).0fnr   s     .lib/python3.11/site-packages/wheel/cli/pack.py
<listcomp>zpack.<locals>.<listcomp>   sf       7==i4455 ;G:L:LR:P:P
         z)Multiple .dist-info directories found in z#No .dist-info directories found in r   nameverNWHEELzTag:  zBuild: zCNo tags present in {}/WHEEL; cannot determine target wheel filename-zBuild: %s
asciir   zrb+c                D    h | ]}|                     d           d         S )r   r   splitr   tags     r   	<setcomp>zpack.<locals>.<setcomp>O   s'    666#CIIcNN1%666r   c                D    h | ]}|                     d           d         S )r   r   r    r"   s     r   r$   zpack.<locals>.<setcomp>P   s'    888CciinnQ'888r   c                D    h | ]}|                     d           d         S )r      r    r"   s     r   r$   zpack.<locals>.<setcomp>Q   s'    :::c		#q):::r   .z.whlwzRepacking wheel as z... T)endflushOK)r   listdirlenr   r   r   groupr   r   open
startswithappendr!   rstripformatencodereadBUILD_NUM_REsubnseektruncatewritesortedr   printwrite_files)r   r   r	   dist_info_dirsdist_info_dirname_versionexisting_build_numberwheel_file_pathftagslinereplacementwheel_file_contentnum_replacedimplsabivers	platformstagline
wheel_pathwfs   `                   r   packrQ      s      *Y''  N
 >Q LPYPPQQQ LJyJJKKK #1%M%%m44::9EEL !gll9mWEEO	o		 ! 	D 	DDw'' DDJJsOOA.55778888++ D(,

3(:(A(A(C(C% 	!6-00  	               $0V<<AVL , 	/C,..L00 	,  </77@@@ 
 ou-- 
,%&VVXX"3?3D3D!34 40"L $ 6&+5&q			

*+++
, 
, 
, 
, 
, 
, 
, 
, 
, 
, 
, 
, 
, 
, 
, 6666677E88488899G::T:::;;Ihh'):):CHHY<O<OPQQG h<(G(G'(G(G(GHHJ	:s	#	# "r3J3334HHHH
y!!!" " " " " " " " " " " " " " " 
$KKKKKs8   CFFF"A8I&&I*-I*,M;;M?M?)r   r   r   r   r	   r
   )
__future__r   os.pathr   re	wheel.clir   wheel.wheelfiler   compiler   r8   rQ   r   r   r   <module>rX      s    " " " " " "  				             % % % % % %rzSTTrz-..M M M M M Mr   