HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/wheel/cli/__pycache__/pack.cpython-37.pyc
B

O��g&�@s�ddlmZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZe�d�Zddd	d
d�dd
�Zddd�dd�ZdS)�)�annotationsN)�BytesGenerator)�BytesParser)�
WheelError)�	WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$�strz
str | None�None)�	directory�dest_dir�build_number�returnc	s��fdd�t���D�}t|�dkr4td�����n|sFtd�����|d}t�|��d�}tj��|d�}t	|d	��B}t
tjj
d
��|�}|�dg�}	|�d�}
|	s�td
�|���WdQRX|dk	r�|n|
}|dk	�r*|d=|r�||d<|d|7}||
k�r*t	|d��}t|dd��|�WdQRXt|	�}tj�||�d|�d��}t|d��&}
td|�d�ddd�|
���WdQRXtd�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)r	r
�2/tmp/pip-unpacked-wheel-f1gdtpe6/wheel/cli/pack.py�
<listcomp>szpack.<locals>.<listcomp>�z)Multiple .dist-info directories found in z#No .dist-info directories found in rZnameverZWHEEL�rb)�policy�TagZBuildzCNo tags present in {}/WHEEL; cannot determine target wheel filenameN�-�wb)�maxheaderlenz.whl�wzRepacking wheel as z...�T)�end�flush�OK)r�listdir�lenrrr�grouprr�openr�emailr�compat32�parse�get_all�get�formatr�flatten�compute_tagliner�printZwrite_files)r	r
rZdist_info_dirs�
dist_info_dirZname_versionZwheel_file_path�f�info�tagsZexisting_build_numberZtagline�
wheel_pathZwfr
)r	r�packs@



r6z	list[str])r4rcCsXtdd�|D��}tdd�|D��}tdd�|D��}d�d�|�d�|�d�|�g�S)zcCompute a tagline from a list of tags.

    :param tags: A list of tags
    :return: A tagline
    cSsh|]}|�d�d�qS)rr)�split)r�tagr
r
r�	<setcomp>Rsz"compute_tagline.<locals>.<setcomp>cSsh|]}|�d�d�qS)rr)r7)rr8r
r
rr9SscSsh|]}|�d�d�qS)r�)r7)rr8r
r
rr9Tsr�.)�sortedr)r4ZimplsZabivers�	platformsr
r
rr/Lsr/)�
__future__r�email.policyr(�os.pathr�re�email.generatorr�email.parserrZ	wheel.clirZwheel.wheelfiler�compilerr6r/r
r
r
r�<module>s
=