Your IP : 3.135.209.20


Current Path : /usr/lib/python3.6/site-packages/setuptools/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/setuptools/__pycache__/wheel.cpython-36.opt-1.pyc

3

9��fb�@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddlm
ZddlmZdd	lmZejd
ej�jZdZdd
�ZGdd�de�ZdS)zWheels support.�)�get_platformN)�Distribution�PathMetadata�
parse_version)�canonicalize_name)�PY3)r)�
pep425tags)�write_requirementsz�^(?P<project_name>.+?)-(?P<version>\d.*?)
    ((-(?P<build>\d.*?))?-(?P<py_version>.+?)-(?P<abi>.+?)-(?P<platform>.+?)
    )\.whl$z�try:
    __import__('pkg_resources').declare_namespace(__name__)
except ImportError:
    __path__ = __import__('pkgutil').extend_path(__path__, __name__)
cCs�x�tj|�D]�\}}}tjj||�}x6|D].}tjj||�}tjj|||�}tj||�q*WxXttt|���D]D\}	}
tjj||
�}tjj|||
�}tjj	|�sntj||�||	=qnWqWx&tj|dd�D]\}}}tj
|�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�rmdir)Zsrc_dirZdst_dir�dirpathZdirnames�	filenames�subdir�f�src�dst�n�d�r�/usr/lib/python3.6/wheel.py�unpack!s
r c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�WheelcCsTttjj|��}|dkr$td|��||_x$|j�j�D]\}}t|||�q8WdS)Nzinvalid wheel name: %r)	�
WHEEL_NAMErr
�basename�
ValueError�filename�	groupdict�items�setattr)�selfr%�match�k�vrrr�__init__9szWheel.__init__cCs&tj|jjd�|jjd�|jjd��S)z>List tags (py_version, abi, platform) supported by this wheel.�.)�	itertools�product�
py_version�split�abi�platform)r)rrr�tagsAs
z
Wheel.tagscs$tj��t�fdd�|j�D�d�S)z5Is the wheel is compatible with the current platform?c3s|]}|�krdVqdS)TNr)�.0�t)�supported_tagsrr�	<genexpr>Jsz&Wheel.is_compatible.<locals>.<genexpr>F)rZ
get_supported�nextr5)r)r)r8r�
is_compatibleGszWheel.is_compatiblecCs*t|j|j|jdkrdnt�d�j�dS)N�any)�project_name�versionr4z.egg)rr=r>r4r�egg_name)r)rrrr?LszWheel.egg_namecCsJx<|j�D]0}tj|�}|jd�r
t|�jt|j��r
|Sq
Wtd��dS)Nz
.dist-infoz.unsupported wheel format. .dist-info not found)Znamelist�	posixpath�dirname�endswithr�
startswithr=r$)r)�zf�memberrArrr�
get_dist_infoRs

zWheel.get_dist_infocstj|j�����d|j|jf}|j���d|���fdd�}|d�}|d�}t|jd��}td�|koxtd	�kns�td
|��t	j
|��j|�t	jj
|���tj|�t|��d��dd
��ttt��j��������fdd��jD�}t	jj
|d�}t	j�|�t	jt	jj
|d�t	jj
|d��tt�|d�d�}	t|	jd�dt	jj
|d��t	jj
|���t	jj
�d�}
t	jj|
��rt	jj
|dd�}t	j
|�xVt	j|
�D]H}|jd��r�t	jt	jj
|
|��n t	jt	jj
|
|�t	jj
||���q�Wt	j|
�x0t t	jj�fdd�d#D��D]}
t!|
|��q$Wt	jj���rPt	j��t	jj
|d�}t	jj|��rt"|��}|j#�j$�}WdQRXxr|D]j}t	jj
|f|j$d ���}t	jj
|d!�}t	jj|��r�t	jj|��r�t"|d"��}|j%t&�WdQRX�q�WWdQRXdS)$z"Install wheel as an egg directory.z%s-%sz%s.datac	sH�jtj�|���,}tr&|j�jd�n|j�}tjj�j	|�SQRXdS)Nzutf-8)
�openr@rr�read�decode�email�parserZParserZparsestr)�name�fp�value)�	dist_inforDrr�get_metadatabsz*Wheel.install_as_egg.<locals>.get_metadataZWHEELZMETADATAz
Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)ZmetadatacSsd|_t|�S)N)Zmarker�str)�reqrrr�raw_reqxsz%Wheel.install_as_egg.<locals>.raw_reqc	s6i|].}tt�fdd�t��j|f��D���|�qS)c3s|]}|�kr|VqdS)Nr)r6rR)�install_requiresrrr9~sz2Wheel.install_as_egg.<locals>.<dictcomp>.<genexpr>)r�sorted�map�requires)r6Zextra)�distrTrSrr�
<dictcomp>|sz(Wheel.install_as_egg.<locals>.<dictcomp>zEGG-INFOzPKG-INFO)rT�extras_require)Zattrs�egg_infoNzrequires.txt�scriptsz.pycc3s|]}tjj�|�VqdS)N)rr
r)r6r)�	dist_datarrr9�sz'Wheel.install_as_egg.<locals>.<genexpr>�data�headers�purelib�platlibznamespace_packages.txtr.z__init__.py�w)r^r_r`ra)'�zipfileZZipFiler%r=r>rFr�getr$r�mkdirZ
extractallr
rrZ
from_locationrrrUrVrWZextras�rename�SetuptoolsDistribution�dictr	Zget_command_objr�listdirrB�unlinkr�filterr rGrHr2�write�NAMESPACE_PACKAGE_INIT)r)Zdestination_eggdirZ
dist_basenamerPZwheel_metadataZ
dist_metadataZ
wheel_versionrZr[Z
setup_distZdist_data_scriptsZegg_info_scripts�entryrZnamespace_packagesrM�modZmod_dirZmod_initr)rXr]rOrTrSrDr�install_as_egg\sr
 










zWheel.install_as_eggN)	�__name__�
__module__�__qualname__r-r5r;r?rFrprrrrr!7s
r!)�__doc__Zdistutils.utilrrJr/rr@�rercZ
pkg_resourcesrrrZ!setuptools.extern.packaging.utilsrZsetuptools.extern.sixrZ
setuptoolsrgrZsetuptools.command.egg_infor	�compile�VERBOSEr*r"rmr �objectr!rrrr�<module>s&


?>