Your IP : 3.138.137.244


Current Path : /opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/wheel.cpython-37.pyc

B

��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�x�t�|�D]�\}}}tj�||�}x6|D].}tj�||�}tj�|||�}t�||�q*WxXttt|���D]D\}	}
tj�||
�}tj�|||
�}tj�	|�snt�||�||	=qnWqWx.tj|dd�D]\}}}|r�t
�t�|�q�WdS)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-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/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)�WheelcCsTttj�|��}|dkr$td|��||_x$|����D]\}}t|||�q8WdS)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>Isz&Wheel.is_compatible.<locals>.<genexpr>c3s|]}|�krdVqdS)TNr)r8r9)�supported_tagsrr r:JsF)�setr�nextr6)r*r)r;r �
is_compatibleFszWheel.is_compatiblecCs,tj|j|j|jdkrdnt�d���dS)N�any)�project_name�versionr5z.egg)�
pkg_resources�Distributionr@rAr5r�egg_name)r*rrr rDLszWheel.egg_namecCsJx<|��D]0}t�|�}|�d�r
t|��t|j��r
|Sq
Wtd��dS)Nz
.dist-infoz.unsupported wheel format. .dist-info not found)�namelist�	posixpath�dirname�endswithr�
startswithr@r%)r*�zf�memberrGrrr �
get_dist_infoRs

zWheel.get_dist_infoc	Cs(t�|j��}|�||�WdQRXdS)z"Install wheel as an egg directory.N)�zipfile�ZipFiler&�_install_as_egg)r*�destination_eggdirrJrrr �install_as_egg\szWheel.install_as_eggcCs\d|j|jf}|�|�}d|}tj�|d�}|�||||�|�||�|�||�dS)Nz%s-%sz%s.datazEGG-INFO)	r@rArLr	rr
�_convert_metadata�_move_data_entries�_fix_namespace_packages)r*rPrJZ
dist_basename�	dist_info�	dist_data�egg_inforrr rOas
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��Wdt�|
�XdS)Nc	s<��t��|��� }|���d�}tj���|�SQRXdS)Nzutf-8)	�openrFr
�read�decode�email�parser�Parser�parsestr)�name�fp�value)rUrJrr �get_metadatamsz-Wheel._convert_metadata.<locals>.get_metadataZWHEELz
Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)�metadatacSsd|_t|�S)N)�marker�str)�reqrrr �raw_req�sz(Wheel._convert_metadata.<locals>.raw_reqc	s2i|]*}t�fdd�t���|f��D��|�qS)c3s|]}|�kr|VqdS)Nr)r8rf)�install_requiresrr r:�sz5Wheel._convert_metadata.<locals>.<dictcomp>.<genexpr>)�sorted�map�requires)r8�extra)�distrhrgrr �
<dictcomp>�sz+Wheel._convert_metadata.<locals>.<dictcomp>�METADATAzPKG-INFO)rh�extras_require)�attrsrWzrequires.txt)r�getr%r	�mkdir�
extractallrr
rBrC�
from_location�PathMetadatarrirjrk�extras�rename�
setuptools�dictr�_global_log�	threshold�
set_threshold�WARNr�get_command_obj)rJrPrUrWrb�wheel_metadata�
wheel_versionZwheel_v1rpZ
setup_distZ
log_thresholdr)rmrUrhrgrJr rRksB 



zWheel._convert_metadatacs�tj�|���tj��d�}tj�|�r�tj�|dd�}t�|�xRt�|�D]D}|�d�rrt�tj�||��qNt�tj�||�tj�||��qNWt�	|�x.t
tjj�fdd�dD��D]}t||�q�Wtj���r�t�	��dS)z,Move data entries to their correct location.�scriptszEGG-INFOz.pycc3s|]}tj��|�VqdS)N)r	rr
)r8r)rVrr r:�sz+Wheel._move_data_entries.<locals>.<genexpr>)�data�headers�purelib�platlibN)r	rr
rrs�listdirrH�unlinkrxr�filterr!)rPrVZdist_data_scriptsZegg_info_scripts�entryrr)rVr rS�s&





zWheel._move_data_entriesc
Cs�tj�|d�}tj�|�r�t|��}|����}WdQRXxt|D]l}tjj|f|�d���}tj�|d�}tj�|�s�t�|�tj�|�s@t|d��}|�t	�WdQRXq@WdS)Nznamespace_packages.txtr/z__init__.py�w)
r	rr
rrXrYr3rs�write�NAMESPACE_PACKAGE_INIT)rWrPZnamespace_packagesr`�modZmod_dirZmod_initrrr rT�s


zWheel._fix_namespace_packagesN)�__name__�
__module__�__qualname__r.r6r>rDrLrQrO�staticmethodrRrSrTrrrr r"4s

@r")�__doc__�distutils.utilr�	distutilsrr[r0r	rF�rerMrBryrZ setuptools.extern.packaging.tagsrZ!setuptools.extern.packaging.utilsrZsetuptools.command.egg_infor�compile�VERBOSEr+r#r�r!r"rrrr �<module>s(


?>