AlkantarClanX12

Your IP : 18.218.2.191


Current Path : /opt/alt/python310/lib/python3.10/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/setuptools/__pycache__/wheel.cpython-310.pyc

o

~�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]Q\}}}tj�||�}|D]}tj�||�}tj�|||�}t�||�qttt|���D]"\}	}
tj�||
�}tj�|||
�}tj�	|�sUt�||�||	=q3qtj|dd�D]\}}}|rgJ�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-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/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�|��}|durtd|��||_|����D]
\}}t|||�qdS)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>Hs�
�z&Wheel.is_compatible.<locals>.<genexpr>c3s�|]	}|�vrdVqdS)TNrr9��supported_tagsrrr<Js�F)�setr�nextr6r5rr=r�
is_compatibleFs�zWheel.is_compatiblecCs,tj|j|j|jdkr
dnt�d���dS)N�any)�project_name�versionr4z.egg)�
pkg_resources�DistributionrCrDr4r�egg_namer5rrrrGLs��zWheel.egg_namecCsF|��D]}t�|�}|�d�rt|��t|j��r|Sqtd��)Nz
.dist-infoz.unsupported wheel format. .dist-info not found)�namelist�	posixpath�dirname�endswithr�
startswithrCr$)r)�zf�memberrJrrr�
get_dist_infoRs

���zWheel.get_dist_infocCs>t�|j��}|�||�Wd�dS1swYdS)z"Install wheel as an egg directory.N)�zipfile�ZipFiler%�_install_as_egg)r)�destination_eggdirrMrrr�install_as_egg\s"�zWheel.install_as_eggcCs\d|j|jf}|�|�}d|}tj�|d�}|�||||�|�||�|�||�dS)Nz%s-%sz%s.data�EGG-INFO)	rCrDrOr	rr
�_convert_metadata�_move_data_entries�_fix_namespace_packages)r)rSrMZ
dist_basename�	dist_info�	dist_data�egg_inforrrrRas
zWheel._install_as_eggc	sT��fdd�}|d�}t|�d��}td�|kotd�kn}|s*td|��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�zt|	�d�dtj�|d��Wt�|
�dSt�|
�w)NcsT��t��|���}|���d�}tj���|�Wd�S1s#wYdS)Nzutf-8)	�openrIr
�read�decode�email�parser�Parser�parsestr)�name�fp�value)rYrMrr�get_metadatams$�z-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:rj)�install_requiresrrr<�s���z5Wheel._convert_metadata.<locals>.<dictcomp>.<genexpr>)�sorted�map�requires)r:�extra)�distrlrkrr�
<dictcomp>�s���z+Wheel._convert_metadata.<locals>.<dictcomp>�METADATAzPKG-INFO)rl�extras_require)�attrsr[zrequires.txt)r�getr$r	�mkdir�
extractallrr
rErF�
from_location�PathMetadatarrmrnro�extras�rename�
setuptools�dictr�_global_log�	threshold�
set_threshold�WARNr�get_command_obj)rMrSrYr[rf�wheel_metadata�
wheel_versionZwheel_v1rtZ
setup_distZ
log_thresholdr)rqrYrlrkrMrrVksR��


������zWheel._convert_metadatacs�tj�|���tj��d�}tj�|�rNtj�|dd�}t�|�t�|�D]"}|�d�r8t�tj�||��q&t�tj�||�tj�||��q&t�	|�t
tjj�fdd�dD��D]}t||�q\tj���rqt�	��dSdS)z,Move data entries to their correct location.�scriptsrUz.pycc3s�|]
}tj��|�VqdSr7)r	rr
)r:r�rZrrr<�s
��
�z+Wheel._move_data_entries.<locals>.<genexpr>)�data�headers�purelib�platlibN)r	rr
rrw�listdirrK�unlinkr|r�filterr )rSrZZdist_data_scriptsZegg_info_scripts�entryrrr�rrW�s,�

�
��zWheel._move_data_entriesc	Cs�tj�|d�}tj�|�rkt|��}|����}Wd�n1s"wY|D]C}tjj|g|�d��R�}tj�|d�}tj�|�sJt�|�tj�|�sjt|d��
}|�t	�Wd�n1sewYq)dSdS)Nznamespace_packages.txtr.z__init__.py�w)
r	rr
rr\r]r2rw�write�NAMESPACE_PACKAGE_INIT)r[rSZnamespace_packagesrd�modZmod_dirZmod_initrrrrX�s&�
�
���zWheel._fix_namespace_packagesN)�__name__�
__module__�__qualname__r-r6rArGrOrTrR�staticmethodrVrWrXrrrrr!4s


?
r!)�__doc__�distutils.utilr�	distutilsrr_r/r	rI�rerPrEr}rZ setuptools.extern.packaging.tagsrZ!setuptools.extern.packaging.utilsrZsetuptools.command.egg_infor�compile�VERBOSEr*r"r�r r!rrrr�<module>s2���