
    i                        d dl mZ d dlZd dlZd dlZd dlmZ d dl	m
Z
 ddlmZmZ  ej        d          ZddZddZdS )    )annotationsN)BytesGenerator)BytesParser   )
WheelError	WheelFilez6^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$	directorystrdest_dirbuild_number
str | NonereturnNonec                     fdt          j                   D             }t          |          dk    rt          d            |st          d            |d         }t                              |                              d          }t           j                             |d          }t          |d          5 }t          t          j        j        	                              |          }|                    d
g           }	|                    d          }
|	st          d| d          	 ddd           n# 1 swxY w Y   ||n|
}|d|d= |r||d<   |d|z   z  }||
k    rLt          |d          5 }t#          |d                              |           ddd           n# 1 swxY w Y   t'          |	          }t           j                            || d| d          }t)          |d          5 }t+          d| ddd           |                                ddd           n# 1 swxY w Y   t+          d           dS )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                    g | ][}t           j                            t           j                            |                    ?t                              |          Y|\S  )ospathisdirjoinDIST_INFO_REmatch).0fnr	   s     ^   C:\Users\student\Desktop\ПрогаАДМБД3\myenv\Lib\site-packages\wheel/_commands/pack.py
<listcomp>zpack.<locals>.<listcomp>   sf       7==i4455 ;G:L:LR:P:P
         z)Multiple .dist-info directories found in z#No .dist-info directories found in r   nameverWHEELrb)policyTagBuildzNo tags present in z./WHEEL; cannot determine target wheel filenameN-wb)maxheaderlenz.whlwzRepacking wheel as z... T)endflushOK)r   listdirlenr   r   r   groupr   r   openr   emailr"   compat32parseget_allgetr   flattencompute_tagliner   printwrite_files)r	   r   r   dist_info_dirsdist_info_dirname_versionwheel_file_pathfinfotagsexisting_build_numbertagline
wheel_pathwfs   `             r   packrE      s`      *Y''  N
 >QPYPPQQQ LJyJJKKK #1%M%%m44::9EEL gll9mWEEO	ot	$	$ 	%,"7888>>qAA,,ub11 $ 1 1 	"m " " "  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 $0#;<<AVLM 	/(DMC,..L000ot,, @qq11199$???@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ d##G h<(G(G'(G(G(GHHJ	:s	#	# "r3J3334HHHH
y!!!" " " " " " " " " " " " " " " 
$KKKKKs7   A3EEE<%F--F14F1=,H55H9<H9r@   	list[str]c                :   t          d | D                       }t          d | D                       }t          d | D                       }d                    d                    |          d                    |          d                    |          g          S )zcCompute a tagline from a list of tags.

    :param tags: A list of tags
    :return: A tagline
    c                D    h | ]}|                     d           d         S )r%   r   splitr   tags     r   	<setcomp>z"compute_tagline.<locals>.<setcomp>Q   s'    666#CIIcNN1%666r   c                D    h | ]}|                     d           d         S )r%   r   rI   rK   s     r   rM   z"compute_tagline.<locals>.<setcomp>R   s'    888CciinnQ'888r   c                D    h | ]}|                     d           d         S )r%   r   rI   rK   s     r   rM   z"compute_tagline.<locals>.<setcomp>S   s'    :::c		#q):::r   r%   .)sortedr   )r@   implsabivers	platformss       r   r7   r7   K   s     6666677E88488899G::T:::;;I88SXXe__chhw&7&7)9L9LMNNNr   )r	   r
   r   r
   r   r   r   r   )r@   rF   r   r
   )
__future__r   email.policyr1   os.pathr   reemail.generatorr   email.parserr   	wheelfiler   r   compiler   rE   r7   r   r   r   <module>r]      s    " " " " " "      				 * * * * * * $ $ $ $ $ $ - - - - - - - -rzSTT: : : :z	O 	O 	O 	O 	O 	Or   