Your IP : 216.73.216.213


Current Path : /opt/alt/python38/lib/python3.8/site-packages/wheel/cli/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib/python3.8/site-packages/wheel/cli/__pycache__/pack.cpython-38.pyc

U

c�a$
�@s\ddlmZddlZddlZddlZddlmZddlm	Z	e�
d�Ze�
d�Zdd�Z
dS)	�)�print_functionN)�
WheelError)�	WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$sBuild: (\d\w*)$c	sB�fdd�t���D�}t|�dkr4td�����n|sFtd�����|d}t�|��d�}d}tj�	�|d	�}t
|��f}g}	|D]D}
|
�d
�r�|	�|
�
d�d���q�|
�d�r�|
�
d�d��}q�|	s�td
�|���W5QRX|dk	r�|n|}|dk	�r�|�r|d|7}||k�r�|�r0d|�d�nd}t
|d��H}|��}t�||�\}}
|
�sf||7}|�d�|��|�|�W5QRXtdd�|	D��}tdd�|	D��}tdd�|	D��}d�	d�	|�d�	|�d�	|�g�}tj�	|d�||��}t|d��,}td�|�dd�tj��|���W5QRXtd�dS)aBRepack 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)
    cs0g|](}tj�tj��|��rt�|�r|�qS�)�os�path�isdir�join�DIST_INFO_RE�match)�.0�fn��	directoryr�?/opt/alt/python38/lib/python3.8/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 {}rZnameverNZWHEELzTag: � zBuild: zCNo tags present in {}/WHEEL; cannot determine target wheel filename�-zBuild: %s
�ascii�zrb+cSsh|]}|�d�d�qS)rr��split�r�tagrrr�	<setcomp>Fszpack.<locals>.<setcomp>cSsh|]}|�d�d�qS)rrrrrrrrGscSsh|]}|�d�d�qS)r�rrrrrrHs�.z	{}-{}.whl�wzRepacking wheel as {}...�)�endZOK)r�listdir�lenr�formatr
r�grouprr	�open�
startswith�appendr�rstrip�encode�read�BUILD_NUM_RE�subn�seek�truncate�write�sortedr�print�sys�stdout�flushZwrite_files)rZdest_dirZbuild_numberZdist_info_dirsZ
dist_info_dirZname_versionZexisting_build_numberZwheel_file_path�fZtags�line�replacementZwheel_file_contentZnum_replacedZimplsZabivers�	platformsZtaglineZ
wheel_pathZwfrrr�packs\



�

�
"
r9)�
__future__r�os.pathr�rer2Z	wheel.clirZwheel.wheelfiler�compiler
r+r9rrrr�<module>s