Your IP : 18.117.254.177


Current Path : /opt/alt/python39/lib/python3.9/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib/python3.9/site-packages/setuptools/__pycache__/wheel.cpython-39.pyc

a

(�Re` �@s�dZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlm
Z
ddlmZddlmZddlmZe	�d	e	j�jZd
Zdd�ZGd
d�d�ZdS)zWheels support.�)�get_platform)�logN)�
parse_version)�sys_tags)�canonicalize_name)�write_requirementsz�^(?P<project_name>.+?)-(?P<version>\d.*?)
    ((-(?P<build>\d.*?))?-(?P<py_version>.+?)-(?P<abi>.+?)-(?P<platform>.+?)
    )\.whl$z8__import__('pkg_resources').declare_namespace(__name__)
cCs�t�|�D]�\}}}tj�||�}|D].}tj�||�}tj�|||�}t�||�q&ttt|���D]D\}	}
tj�||
�}tj�|||
�}tj�	|�sft�||�||	=qfq
tj|dd�D]\}}}|r�J�t�
|�q�dS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)�topdownN)�os�walk�path�relpath�join�renames�reversed�list�	enumerate�exists�rmdir)�src_dirZdst_dir�dirpath�dirnames�	filenames�subdir�f�src�dst�n�d�r��/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/wheel.py�unpacks
r c@sheZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
dd��Ze
dd��Ze
dd��Z
dS)�WheelcCsPttj�|��}|dur$td|��||_|����D]\}}t|||�q6dS)Nzinvalid wheel name: %r)	�
WHEEL_NAMEr	r�basename�
ValueError�filename�	groupdict�items�setattr)�selfr%�match�k�vrrr�__init__6szWheel.__init__cCs&t�|j�d�|j�d�|j�d��S)z>List tags (py_version, abi, platform) supported by this wheel.�.)�	itertools�product�
py_version�split�abi�platform�r)rrr�tags>s



�z
Wheel.tagscs0tdd�t�D���t�fdd�|��D�d�S)z5Is the wheel is compatible with the current platform?css|]}|j|j|jfVqdS�N)�interpreterr3r4��.0�trrr�	<genexpr>Hsz&Wheel.is_compatible.<locals>.<genexpr>c3s|]}|�vrdVqdS)TNrr9��supported_tagsrrr<J�F)�setr�nextr6r5rr=r�
is_compatibleFs�zWheel.is_compatiblecCs,tj|j|j|jdkrdnt�d���dS)N�any)�project_name�versionr4z.egg)�
pkg_resources�DistributionrDrEr4r�egg_namer5rrrrHLs��zWheel.egg_namecCsJ|��D]4}t�|�}|�d�rt|��t|j��r|Sqtd��dS)Nz
.dist-infoz.unsupported wheel format. .dist-info not found)�namelist�	posixpath�dirname�endswithr�
startswithrDr$)r)�zf�memberrKrrr�
get_dist_infoRs

��
zWheel.get_dist_infocCs<t�|j��}|�||�Wd�n1s.0YdS)z"Install wheel as an egg directory.N)�zipfile�ZipFiler%�_install_as_egg)r)�destination_eggdirrNrrr�install_as_egg\szWheel.install_as_eggcCs\d|j|jf}|�|�}d|}tj�|d�}|�||||�|�||�|�||�dS)Nz%s-%sz%s.data�EGG-INFO)	rDrErPr	rr
�_convert_metadata�_move_data_entries�_fix_namespace_packages)r)rTrNZ
dist_basename�	dist_info�	dist_data�egg_inforrrrSas
zWheel._install_as_eggc	sV��fdd�}|d�}t|�d��}td�|ko>td�kn}|sTtd|��t�|���|�tj�|���tj	j
|�t�|��d��d	d
��tt
t�����������fdd��jD�}t��|�t�tj�|d
�tj�|d��tj	t�|d�d�}	tjj}
t�tj�z*t|	�d�dtj�|d��Wt�|
�nt�|
�0dS)NcsT��t��|���.}|���d�}tj���|�Wd�S1sF0YdS)Nzutf-8)	�openrJr
�read�decode�email�parser�Parser�parsestr)�name�fp�value)rZrNrr�get_metadatamsz-Wheel._convert_metadata.<locals>.get_metadataZWHEELz
Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)�metadatacSsd|_t|�Sr7)�marker�str)�reqrrr�raw_req�sz(Wheel._convert_metadata.<locals>.raw_reqc
s2i|]*}|t�fdd�t���|f��D���qS)c3s|]}|�vr|VqdSr7r)r:rk)�install_requiresrrr<�s�z5Wheel._convert_metadata.<locals>.<dictcomp>.<genexpr>)�sorted�map�requires)r:�extra)�distrmrlrr�
<dictcomp>�s��z+Wheel._convert_metadata.<locals>.<dictcomp>�METADATAzPKG-INFO)rm�extras_require)�attrsr\zrequires.txt)r�getr$r	�mkdir�
extractallrr
rFrG�
from_location�PathMetadatarrnrorp�extras�rename�
setuptools�dictr�_global_log�	threshold�
set_threshold�WARNr�get_command_obj)rNrTrZr\rg�wheel_metadata�
wheel_versionZwheel_v1ruZ
setup_distZ
log_thresholdr)rrrZrmrlrNrrWksR��


������zWheel._convert_metadatacs�tj�|���tj��d�}tj�|�r�tj�|dd�}t�|�t�|�D]D}|�d�rpt�tj�||��qLt�tj�||�tj�||��qLt�	|�t
tjj�fdd�dD��D]}t||�q�tj���r�t�	��dS)z,Move data entries to their correct location.�scriptsrVz.pycc3s|]}tj��|�VqdSr7)r	rr
)r:r�r[rrr<�s�z+Wheel._move_data_entries.<locals>.<genexpr>)�data�headers�purelib�platlibN)r	rr
rrx�listdirrL�unlinkr}r�filterr )rTr[Zdist_data_scriptsZegg_info_scripts�entryrrr�rrX�s*�

�
�zWheel._move_data_entriesc	Cs�tj�|d�}tj�|�r�t|��}|����}Wd�n1sD0Y|D]�}tjj|g|�d��R�}tj�|d�}tj�|�s�t�|�tj�|�sRt|d��}|�t	�Wd�qR1s�0YqRdS)Nznamespace_packages.txtr.z__init__.py�w)
r	rr
rr]r^r2rx�write�NAMESPACE_PACKAGE_INIT)r\rTZnamespace_packagesre�modZmod_dirZmod_initrrrrY�s�
*
zWheel._fix_namespace_packagesN)�__name__�
__module__�__qualname__r-r6rBrHrPrUrS�staticmethodrWrXrYrrrrr!4s


?
r!)�__doc__�distutils.utilr�	distutilsrr`r/r	rJ�rerQrFr~rZ setuptools.extern.packaging.tagsrZ!setuptools.extern.packaging.utilsrZsetuptools.command.egg_infor�compile�VERBOSEr*r"r�r r!rrrr�<module>s,��

?>