HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/wheel/_commands/__pycache__/pack.cpython-310.pyc
o

;j�@snddlmZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
e�d�Zddd�Zddd�ZdS)�)�annotationsN)�BytesGenerator)�BytesParser�)�
WheelError�	WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$�	directory�str�dest_dir�build_number�
str | None�return�Nonecs��fdd�t���D�}t|�dkrtd�����|s"td�����|d}t�|��d�}tj��|d�}t	|d	��'}t
tjj
d
��|�}|�dg�}	|�d�}
|	s[td
|�d���Wd�n1sewY|durp|n|
}|dur�|d=|r�||d<|d|7}||
kr�t	|d��}t|dd��|�Wd�n1s�wYt|	�}tj�||�d|�d��}t|d��}
td|�d�ddd�|
���Wd�n1s�wYtd�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�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/wheel/_commands/pack.py�
<listcomp>s���zpack.<locals>.<listcomp>�z)Multiple .dist-info directories found in z#No .dist-info directories found in rZnameverZWHEEL�rb)�policyZTagZBuildzNo tags present in z./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�getr�flatten�compute_tagliner�printZwrite_files)rr
rZdist_info_dirsZ
dist_info_dirZname_versionZwheel_file_path�f�info�tagsZexisting_build_numberZtagline�
wheel_pathZwfrrr�packsJ

�

�����r6r4�	list[str]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
    cS�h|]	}|�d�d�qS)rr��split�r�tagrrr�	<setcomp>Q�z"compute_tagline.<locals>.<setcomp>cSr8)rrr9r;rrrr=Rr>cSr8)rrr9r;rrrr=Sr>r�.)�sortedr)r4ZimplsZabiversZ	platformsrrrr0Ks"r0)rr	r
r	rrr
r)r4r7r
r	)�
__future__r�email.policyr*Zos.pathr�re�email.generatorr�email.parserrZ	wheelfilerr�compilerr6r0rrrr�<module>s

=