File: //usr/lib/python3/dist-packages/wheel/cli/__pycache__/pack.cpython-310.pyc
o
c�a$
� @ s\ d dl mZ d dlZd dlZd dlZd dlmZ d dlm Z e�
d�Ze�
d�Zdd� Z
dS ) � )�print_functionN)�
WheelError)� WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$s Build: (\d\w*)$c st � fdd�t �� �D �}t|�dkrtd�� ���|s"td�� ���|d }t�|��d�}d}t j� � |d �}t
|��8}g } |D ]"}
|
�d
�rU| �|
�
d�d �� � qA|
�d�rc|
�
d�d �� }qA| smtd
�|���W d � n1 sww Y |dur�|n|}|dur�|r�|d| 7 }||kr�|r�d| �d�nd}t
|d��(}|�� }t�||�\}}
|
s�||7 }|�d� |�� |�|� W d � n1 s�w Y tdd� | D ��}tdd� | D ��}tdd� | D ��}d� d� |�d� |�d� |�g�}t j� |d�||��}t|d��}td�|�dd� tj�� |�� � W d � n 1 �s/w Y td� dS )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 s0 g | ]}t j�t j�� |��rt�|�r|�qS � )�os�path�isdir�join�DIST_INFO_RE�match)�.0�fn�� directoryr �0/usr/lib/python3/dist-packages/wheel/cli/pack.py�
<listcomp> s
�
�zpack.<locals>.<listcomp>� z+Multiple .dist-info directories found in {}z%No .dist-info directories found in {}r �nameverN�WHEELzTag: � zBuild: zCNo tags present in {}/WHEEL; cannot determine target wheel filename�-zBuild: %s
�ascii� zrb+c S � h | ] }|� d �d �qS )r r ��split�r �tagr r r � <setcomp>F � zpack.<locals>.<setcomp>c S r )r r r r r r r r G r c S r )r � r r r r r r H r �.z {}-{}.whl�wzRepacking wheel as {}...� )�end�OK)r �listdir�lenr �formatr
r �groupr r �open�
startswith�appendr �rstrip�encode�read�BUILD_NUM_RE�subn�seek�truncate�write�sortedr �print�sys�stdout�flush�write_files)r �dest_dir�build_number�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�wfr r r �pack sf
����
�
�"
�rN )�
__future__r �os.pathr �rer7 � wheel.clir �wheel.wheelfiler �compiler
r0 rN r r r r �<module> s