Your IP : 216.73.216.60
o
��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 sf � 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�||�d s�||7 }|�� |�|� 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 �A/opt/alt/python310/lib/python3.10/site-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 ZnameverNZWHEELzTag: � 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>C � zpack.<locals>.<setcomp>c S r )r r r r r r r r D r c S r )r � r r r r r r E r �.z {}-{}.whl�wzRepacking wheel as {}...� )�endZOK)r �listdir�lenr �formatr
r �groupr r �open�
startswith�appendr �rstrip�encode�read�BUILD_NUM_RE�subn�truncate�write�sortedr �print�sys�stdout�flushZwrite_files)r Zdest_dirZbuild_numberZdist_info_dirsZ
dist_info_dirZname_versionZexisting_build_numberZwheel_file_path�fZtags�lineZreplacementZwheel_file_contentZimplsZabiversZ platformsZtaglineZ
wheel_pathZwfr r r �pack s^
����
� "
�r8 )Z
__future__r Zos.pathr �rer3 Z wheel.clir Zwheel.wheelfiler �compiler
r- r8 r r r r �<module> s