AlkantarClanX12

Your IP : 3.16.82.182


Current Path : /opt/alt/python38/lib/python3.8/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib/python3.8/site-packages/setuptools/__pycache__/wheel.cpython-38.pyc

U

�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�t
�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�AssertionError�rmdir)�src_dirZdst_dir�dirpath�dirnames�	filenames�subdir�f�src�dst�n�d�r��/builddir/build/BUILDROOT/alt-python38-setuptools-58.3.0-2.el8.x86_64/opt/alt/python38/lib/python3.8/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�|��}|dkr$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)�interpreterr4r5��.0�trrr �	<genexpr>Hsz&Wheel.is_compatible.<locals>.<genexpr>c3s|]}|�krdVqdS)TNrr:��supported_tagsrr r=JsF)�setr�nextr7r6rr>r �
is_compatibleFs�zWheel.is_compatiblecCs,tj|j|j|jdkrdnt�d���dS)N�any)�project_name�versionr5z.egg)�
pkg_resources�DistributionrDrEr5r�egg_namer6rrr rHLs��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_infoc	Cs(t�|j��}|�||�W5QRXdS)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_inforrr rSas
zWheel._install_as_eggc	sL��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��W5t�|
�XdS)Nc
sH��t��|���,}|���d�}tj���|�W5QR�SQRXdS)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|�Sr8)�marker�str)�reqrrr �raw_req�sz(Wheel._convert_metadata.<locals>.raw_reqc
s2i|]*}|t�fdd�t���|f��D���qS)c3s|]}|�kr|VqdSr8r)r;rk)�install_requiresrr r=�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)rrrZrmrlrNr rWksT��


������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��|�VqdSr8)r	rr
)r;r�r[rr r=�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�r rX�s.�

�
�zWheel._move_data_entriesc
Cs�tj�|d�}tj�|�r�t|��}|����}W5QRX|D]l}tjj|f|�d���}tj�|d�}tj�|�s~t�|�tj�|�s>t|d��}|�t	�W5QRXq>dS)Nznamespace_packages.txtr/z__init__.py�w)
r	rr
rr]r^r3rx�write�NAMESPACE_PACKAGE_INIT)r\rT�namespace_packagesre�modZmod_dirZmod_initrrr rY�s�

zWheel._fix_namespace_packagesN)�__name__�
__module__�__qualname__r.r7rBrHrPrUrS�staticmethodrWrXrYrrrr r"4s


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