ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     3
Pf~                 @   s$  d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z	ddlZddlZddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZmZ dd	lmZmZm Z  dd
l!m"Z"m#Z# ddlm$Z$ ddl%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 dZ9d9Z:ej;e<Z=G dd de>Z?dd Z@dd ZAd;ddZBd d! ZCd"d# ZDejEd$ejFZGd%d& ZHd'd( ZId<d+d,ZJd-d. ZKeKd/d0 ZLd1d2 ZMd3d4 ZNG d5d6 d6e>ZOG d7d8 d8e>ZPdS )=zH
Support for installing and building the "wheel" binary package format.
    )absolute_importN)urlsafe_b64encode)Parser)StringIO)
expanduser)path_to_url
unpack_url)InstallationErrorInvalidWheelFilenameUnsupportedWheel)distutils_schemePIP_DELETE_MARKER_FILENAME)
pep425tags)call_subprocess
ensure_dircaptured_stdoutrmtreeread_chunks)open_spinner)
indent_log)SETUPTOOLS_SHIM)ScriptMaker)pkg_resources)canonicalize_name)configparserz.whl   c               @   s    e Zd ZdZdd Zdd ZdS )
WheelCachez&A cache of wheels for future installs.c             C   s   |rt |nd| _|| _dS )zCreate a wheel cache.

        :param cache_dir: The root of the cache.
        :param format_control: A pip.index.FormatControl object to limit
            binaries being read from the cache.
        N)r   
_cache_dir_format_control)self	cache_dirformat_control r"   /usr/lib/python3.6/wheel.py__init__8   s    zWheelCache.__init__c             C   s   t | j|| j|S )N)cached_wheelr   r   )r   linkpackage_namer"   r"   r#   r%   B   s    zWheelCache.cached_wheelN)__name__
__module____qualname____doc__r$   r%   r"   r"   r"   r#   r   5   s   
r   c             C   s   |j g}|jdk	r4|jdk	r4|jdj|j|jg dj|}tj|j j }|dd |dd |dd |dd g}t	j
j| df| S )a  
    Return a directory to store cached wheels in for link.

    Because there are M wheels for any one sdist, we provide a directory
    to cache them in, and then consult that directory when looking up
    cache hits.

    We only insert things into the cache if they have plausible version
    numbers, so that we don't contaminate the cache with things that were not
    unique. E.g. ./package might have dozens of installs done for it and build
    a version of 0.0...and if we built and cached a wheel, we'd end up using
    the same wheel even if the source has been edited.

    :param cache_dir: The cache_dir being used by pip.
    :param link: The link of the sdist for which this will cache wheels.
    N=#         Zwheels)Zurl_without_fragmentZ	hash_namehashappendjoinhashlibZsha224encodeZ	hexdigestospath)r    r&   Z	key_partsZkey_urlZhashedpartsr"   r"   r#   _cache_for_linkG   s    
,r9   c             C   s,  | s|S |s|S |j r|S |js$|S |s,|S t|}tjj||}d|krN|S t| |}ytj|}W n: t	k
r } z|j
t
jt
jfkr|S  W Y d d }~X nX g }	xL|D ]D}
yt|
}W n tk
r   wY nX |j sq|	j|j |
f qW |	 s|S |	j  tjj||	d d }tjjt|S )Nbinaryr   r   )is_wheelis_artifactr   pipindexfmt_ctl_formatsr9   r6   listdirOSErrorerrnoENOENTENOTDIRWheelr
   	supportedr2   support_index_minsortr7   r3   Linkr   )r    r&   r!   r'   Zcanonical_nameZformatsrootZwheel_nameseZ
candidates
wheel_namewheelr7   r"   r"   r#   r%   p   sF    

r%   sha256   c             C   st   t j|}d}t| d2}x*t||dD ]}|t|7 }|j| q(W W dQ R X dt|j jdj	d }||fS )z6Return (hash, length) for path using hashlib.new(algo)r   rb)sizeNzsha256=latin1r,   )
r4   newopenr   lenupdater   digestdecoderstrip)r7   ZalgoZ	blocksizehZlengthfblockrW   r"   r"   r#   rehash   s    

r]   c             C   s6   t jd dk ri }d}nddi}d}t| || f|S )Nr      bnewline )sysversion_inforT   )namemodenlbinr"   r"   r#   open_for_csv   s    rh   c             C   s   t jj| rt| dH}|j }|jds.dS tjjtj	 }d| t j
jd }|j }W dQ R X t| d}|j| |j| W dQ R X dS dS )	zLReplace #!python with #!/path/to/python
    Return True if file was changed.rP   s   #!pythonFs   #!asciiNwbT)r6   r7   isfilerT   readline
startswithrb   
executabler5   getfilesystemencodinglinesepreadwrite)r7   Zscript	firstlineZexenamerestr"   r"   r#   
fix_script   s    

ru   zZ^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
                                \.dist-info$c             C   s   | j dd}xttj|D ]f}tj|}|r|jd|krttjj||d,}x$|D ]}|j	 j
 }|dkrTdS qTW W dQ R X qW dS )	zP
    Return True if the extracted wheel in wheeldir should go into purelib.
    -_rd   WHEELzroot-is-purelib: trueTNF)replacer6   r@   dist_info_rematchgrouprT   r7   r3   lowerrY   )rd   wheeldirZname_foldeditemr{   rM   liner"   r"   r#   root_is_purelib   s    

r   c          
   C   s   t jj| si i fS t| <}t }x$|D ]}|j|j  |jd q*W |jd W d Q R X tj	 }dd |_
|j| i }i }|jdrt|jd}|jdrt|jd}||fS )N
r   c             S   s   | S )Nr"   )Zoptionr"   r"   r#   <lambda>   s    z!get_entrypoints.<locals>.<lambda>Zconsole_scriptsZgui_scripts)r6   r7   existsrT   r   rr   stripseekr   ZRawConfigParserZoptionxformZreadfpZhas_sectiondictitems)filenamefpdatar   Zcpconsoleguir"   r"   r#   get_entrypoints   s$    





r   FTc       +   )      s*  |st | |||||	d}t| r,|d n|d g g jtjjtjj }i t  g }|rt 4}tj	   tj
d tj|ddd W dQ R X W dQ R X tj|j  dd	 d3 fdd		d4	
fdd	}||d std
 tjjd d}t|\fdd}xvD ]n}d}d}x^tjtjj|D ]F}d}|dkrpt}|}tjj||}|| }|||d
||d qVW q4W td|d d_td5_d_
fdd}|_d_jdd}|rdtjkrd| }|jj| tjjdddkrTdt j!dd |f }|jj| dt j!dd  |f }|jj| d!d" D }x|D ]}|= qW jd#d}|rdtjkrd$| }|jj| d%t j!dd  |f }|jj| d&d" D }x|D ]}|= qW t"dkrJ|jj#d'd" j$ D  t"dkr||jj#d(d" j$ D d)di tjjd d*}tjjd d+}t%|d,}|j&d- W dQ R X t'j(|| |j)| tjjd d.} tjjd d/}!t*| d0}"t*|!d1}#t+j,|"}$t+j-|#}%xV|$D ]N}&j|&d |&d |&d< |&d  krpt.|&d \|&d< |&d2< |%j/|& q.W x`|D ]X}'t.|'\}(})|'}*|
r|*j0|
rtjjtjtjj1|*|
}*|%j/|*|(|)f qW x"D ]}'|%j/|' ddf qW W dQ R X W dQ R X t'j(|!|  dS )6zInstall a wheel)userhomerJ   isolatedprefixpurelibplatlibignoreT)forcequietNc             S   s   t jj| |jt jjdS )N/)r6   r7   relpathry   sep)srcpr"   r"   r#   normpath  s    z"move_wheel_files.<locals>.normpathFc                s.   | }|}||< |r* j | dS )z6Map archive RECORD paths to installation RECORD paths.N)add)srcfiledestfileZmodifiedZoldpathnewpath)changed	installedlib_dirr   r~   r"   r#   record_installed  s
    

z*move_wheel_files.<locals>.record_installedc                s  t | xtj| D ]\}}}|t| d  jtjj}tjj||}	|rj|jtjjdd j	drjqx|D ]}
tjj|||
}|r|dkr|j	dr j
|
 qpqp|rp|
j	drpt|
jtjrp std| d dj j
| qpW x|D ]}|r||rqtjj||}tjj|||}t |	 tj|| tj|}ttdrptj||j|jf tj|tjrtj|}|jtjB tjB tjB }tj|| d	}|r||}||| qW qW d S )
Nr   r   z.datara   z
.dist-infoz!Multiple .dist-info directories: z, utimeF)r   r6   walkrU   lstripr7   r   r3   splitendswithr2   r   rm   rd   AssertionErrorshutilZcopyfilestathasattrr   st_atimest_mtimeaccessX_OKst_modeS_IXUSRS_IXGRPS_IXOTHchmod)sourcedestZis_basefixerfilterdirZsubdirsfilesZbasedirZdestdirsZ
destsubdirr[   r   r   stZpermissionsr   )	data_dirsinfo_dirr   reqr"   r#   clobber  sJ    






z!move_wheel_files.<locals>.clobberz!%s .dist-info directory not foundr   zentry_points.txtc                sh   | j  jdr| d d }n<| j  jdr8| d d }n | j  jdrT| d d }n| }| kpf|kS )	Nz.exer/   z
-script.py
   z.pyair   )r}   r   )rd   Z	matchname)r   r   r"   r#   is_entrypoint_wrappera  s    z/move_wheel_files.<locals>.is_entrypoint_wrapperscripts)r   r   ra   c                s<   | j d krtd| f  j| j| j jdd | j d S )NzInvalid script entry point: %s for req: %s - A callable suffix is required. Cf https://packaging.python.org/en/latest/distributing.html#console-scripts for more information..r   )moduleZimport_namefunc)suffixr	   script_templater   r   )entry)makerr   r"   r#   _get_script_text  s    
z*move_wheel_files.<locals>._get_script_textz# -*- coding: utf-8 -*-
import re
import sys

from %(module)s import %(import_name)s

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
r=   ZENSUREPIP_OPTIONSzpip = Z
altinstallz
pip%s = %sr   r^   c             S   s   g | ]}t jd |r|qS )zpip(\d(\.\d)?)?$)rer{   ).0kr"   r"   r#   
<listcomp>  s    z$move_wheel_files.<locals>.<listcomp>Zeasy_installzeasy_install = zeasy_install-%s = %sc             S   s   g | ]}t jd |r|qS )zeasy_install(-\d\.\d)?$)r   r{   )r   r   r"   r"   r#   r     s    c             S   s   g | ]}d | qS )z%s = %sr"   )r   kvr"   r"   r#   r     s    c             S   s   g | ]}d | qS )z%s = %sr"   )r   r   r"   r"   r#   r     s    r   Z	INSTALLERzINSTALLER.piprj   s   pip
RECORDz
RECORD.piprzw+r.   )F)NN)ra   )2r   r   rY   r6   r7   r   setr   warningscatch_warningsfilterwarnings
compileallcompile_dirloggerdebuggetvaluer   r3   r   r@   ru   r   r   ZvariantsZset_moder   r   popenvironextendZmakegetrb   versionrU   Zmake_multipler   rT   rr   r   mover2   rh   csvreaderwriterr]   Zwriterowrm   r   )+rd   r   r~   r   r   rJ   Z	pycompileschemer   r   Zstrip_file_prefixr   Z	generatedstdoutr   Zep_filer   Zdatadirr   r   Zsubdirr   r   Z
pip_scriptspecZpip_epr   Zeasy_install_scriptZeasy_install_epZ	installerZtemp_installerZinstaller_filerecordZtemp_recordZ	record_inZ
record_outr   r   rowr[   rZ   lZ
final_pathr"   )r   r   r   r   r   r   r   r   r   r   r   r~   r#   move_wheel_files   s    




$;



#









.r   c                s   t j  fdd}|S )Nc              ?   s6   t  }x* | |D ]}||kr|j| |V  qW d S )N)r   r   )argskwseenr   )fnr"   r#   unique  s
    
z_unique.<locals>.unique)	functoolswraps)r   r   r"   )r   r#   _unique  s    r   c             c   s   ddl m} tj|| jd}xd|D ]\}tjj| j|d }|V  |j	dr&tjj
|\}}|dd }tjj||d }|V  q&W dS )	a  
    Yield all the uninstallation paths for dist based on RECORD-without-.pyc

    Yield paths to all the files in RECORD. For each .py file in RECORD, add
    the .pyc in the same directory.

    UninstallPathSet.add() takes care of the __pycache__ .pyc.
    r   )FakeFiler   z.pyNr^   z.pyc)	pip.utilsr   r   r   Zget_metadata_linesr6   r7   r3   locationr   r   )distr   r   r   r7   Zdnr   baser"   r"   r#   uninstallation_paths"  s    


r   c             C   sd   yTdd t jd| D d }|jd}t j|}|d j }ttt|j	d}|S    dS dS )	z
    Return the Wheel-Version of an extracted wheel, if possible.

    Otherwise, return False if we couldn't parse / extract it.
    c             S   s   g | ]}|qS r"   r"   )r   dr"   r"   r#   r   ?  s    z!wheel_version.<locals>.<listcomp>Nr   rx   zWheel-Versionr   F)
r   Zfind_on_pathZget_metadatar   Zparsestrr   tuplemapintr   )
source_dirr   Z
wheel_datar   r"   r"   r#   wheel_version8  s    
r  c             C   sb   | st d| | d td kr>t d|djtt| f n | tkr^tjddjtt|  dS )a  
    Raises errors or warns if called with an incompatible Wheel-Version.

    Pip should refuse to install a Wheel-Version that's a major series
    ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
    installing a version only minor version ahead (e.g 1.2 > 1.1).

    version: a 2-tuple representing a Wheel-Version (Major, Minor)
    name: name of wheel or package to raise exception about

    :raises UnsupportedWheel: when an incompatible Wheel-Version is given
    z(%s is in an unsupported or invalid wheelr   zB%s's Wheel-Version (%s) is not compatible with this version of pipr   z*Installing from a newer Wheel-Version (%s)N)r   VERSION_COMPATIBLEr3   r  strr   warning)r   rd   r"   r"   r#   check_compatibilityK  s    
r  c               @   s:   e Zd ZdZejdejZdd Zd
ddZ	ddd	Z
dS )rE   zA wheel filez^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))
        ((-(?P<build>\d.*?))?-(?P<pyver>.+?)-(?P<abi>.+?)-(?P<plat>.+?)
        \.whl|\.dist-info)$c                s    j j|}|std| | _|jdjdd _|jdjdd _|jdjd _	|jdjd _
|jd	jd _t fd
d j	D  _dS )zX
        :raises InvalidWheelFilename: when the filename is invalid for a wheel
        z!%s is not a valid wheel filename.rd   rw   rv   ZverZpyverr   abiZplatc             3   s0   | ](} j D ]} jD ]}|||fV  qqqd S )N)abisplats)r   xyz)r   r"   r#   	<genexpr>  s    z!Wheel.__init__.<locals>.<genexpr>N)wheel_file_rer{   r
   r   r|   ry   rd   r   r   Z
pyversionsr
  r  r   	file_tags)r   r   Z
wheel_infor"   )r   r#   r$   t  s    
zWheel.__init__Nc                s2    dkrt j  fdd| jD }|r.t|S dS )a"  
        Return the lowest index that one of the wheel's file_tag combinations
        achieves in the supported_tags list e.g. if there are 8 supported tags,
        and one of the file tags is first in the list, then return 0.  Returns
        None is the wheel is not supported.
        Nc                s   g | ]}| kr j |qS r"   )r>   )r   c)tagsr"   r#   r     s    z+Wheel.support_index_min.<locals>.<listcomp>)r   supported_tagsr  min)r   r  Zindexesr"   )r  r#   rG     s    zWheel.support_index_minc             C   s"   |dkrt j}tt|j| jS )z'Is this wheel supported on this system?N)r   r  boolr   intersectionr  )r   r  r"   r"   r#   rF     s    zWheel.supported)N)N)r(   r)   r*   r+   r   compileVERBOSEr  r$   rG   rF   r"   r"   r"   r#   rE   h  s   
rE   c               @   sH   e Zd ZdZdddZdddZdd Zdd	d
Zdd ZdddZ	dS )WheelBuilderz#Build wheels from a RequirementSet.Nc             C   s6   || _ || _|jj| _|j| _|p$g | _|p.g | _d S )N)	requirement_setfinderZ_wheel_cacher   _cache_rootZwheel_download_dir
_wheel_dirbuild_optionsglobal_options)r   r  r  r  r   r"   r"   r#   r$     s    

zWheelBuilder.__init__c             C   s   t jd}zn| j|||drlyBtj|d }tjj||}tjtjj||| t	j
d| |S    Y nX | j| dS t| X dS )ziBuild one wheel.

        :return: The filename of the built wheel, or None if the build failed.
        z
pip-wheel-)
python_tagr   zStored in directory: %sN)tempfileZmkdtemp_WheelBuilder__build_oner6   r@   r7   r3   r   r   r   info
_clean_oner   )r   r   
output_dirr!  tempdrL   Z
wheel_pathr"   r"   r#   
_build_one  s    

zWheelBuilder._build_onec             C   s   t jddt|j gt| j S )Nz-uz-c)rb   rn   r   Zsetup_pylistr   )r   r   r"   r"   r#   _base_setup_args  s    
zWheelBuilder._base_setup_argsc             C   s   | j |}d|jf }t|t}tjd| |dd|g | j }|d k	rT|d|g7 }yt||jd|d dS    |jd	 tj	d
|j dS W d Q R X d S )Nz#Running setup.py bdist_wheel for %szDestination directory: %sZbdist_wheelz-dz--python-tagF)cwdshow_stdoutspinnerTerrorzFailed building wheel for %s)
r*  rd   r   r   r   r  r   Zsetup_py_dirZfinishr.  )r   r   r'  r!  	base_argsZspin_messager-  Z
wheel_argsr"   r"   r#   Z__build_one  s    



zWheelBuilder.__build_onec             C   sV   | j |}tjd|j |ddg }yt||jdd dS    tjd|j dS d S )NzRunning setup.py clean for %sZcleanz--allF)r+  r,  Tz Failed cleaning build dir for %s)r*  r   r$  rd   r   r  r.  )r   r   r/  Z
clean_argsr"   r"   r#   r%    s    
zWheelBuilder._clean_oneFc             C   s  | j s|r| jst| jj| j | jjj }g }x|D ]}|jrDq8|j	r^|st
jd|j q8|rj|jrjq8|r|jr|jj rq8|r|j rq8|r|j}|j \}}tjj|d|dkrq8dtjj| jjt|jkrt
jd|j q8|j| q8W | sdS t
jddjdd	 |D  t J g g  }}	x6|D ],}d}
|rtj}
t| j|j}yt| W nB tk
r } z$t
j d
|j| |	j| w6W Y dd}~X nX n| j }| j!|||
d}|rX|j| |rb|jrt"j#j$t"j#j|jt% rtd|j&  |j'| jj(|_tjj)t*||_|jj	s<tt+|j|jdd| jj,d n
|	j| q6W W dQ R X |rt
jddjdd	 |D  |	rt
jddjdd	 |	D  t-|	dkS )zBuild wheels.

        :param unpack: If True, replace the sdist we built from with the
            newly built wheel, in preparation for installation.
        :return: True if all the wheels built correctly.
        z(Skipping %s, due to already being wheel.Nr:   zCSkipping bdist_wheel for %s, due to binaries being disabled for it.Tz*Building wheels for collected packages: %sz, c             S   s   g | ]
}|j qS r"   )rd   )r   r   r"   r"   r#   r     s    z&WheelBuilder.build.<locals>.<listcomp>z Building wheel for %s failed: %s)r!  zbad source dir - missing markerF)sessionzSuccessfully built %s c             S   s   g | ]
}|j qS r"   )rd   )r   r   r"   r"   r#   r   Q  s    zFailed to build %sc             S   s   g | ]
}|j qS r"   )rd   )r   r   r"   r"   r#   r   V  s    r   ).r  r  r   r  Zprepare_filesr  ZrequirementsvaluesZ
constraintr;   r   r$  rd   Zeditabler&   r<   r  splitextr=   r>   Zegg_info_matchesr?   r!   r   r2   r3   r   r   Zimplementation_tagr9   r   rA   r  r(  r6   r7   r   r   Zremove_temporary_sourceZbuild_locationZ	build_dirrI   r   r   r0  rU   )r   ZautobuildingZreqsetZbuildsetr   r&   r   ZextZbuild_successZbuild_failurer!  r&  rK   Z
wheel_filer"   r"   r#   build  s    






zWheelBuilder.build)NN)N)N)F)
r(   r)   r*   r+   r$   r(  r*  r#  r%  r4  r"   r"   r"   r#   r    s    


r  )r   r      )rN   r5  )FNNTNFNN)Qr+   Z
__future__r   r   r   rB   r   r4   Zloggingr6   Zos.pathr   r   r   rb   r"  r   base64r   Zemail.parserr   Zpip._vendor.sixr   r=   Z
pip.compatr   Zpip.downloadr   r   Zpip.exceptionsr	   r
   r   Zpip.locationsr   r   r   r   r   r   r   r   r   Zpip.utils.uir   Zpip.utils.loggingr   Zpip.utils.setuptools_buildr   Zpip._vendor.distlib.scriptsr   Zpip._vendorr   Zpip._vendor.packaging.utilsr   Zpip._vendor.six.movesr   Z	wheel_extr  Z	getLoggerr(   r   objectr   r9   r%   r]   rh   ru   r  r  rz   r   r   r   r   r   r  r  rE   r  r"   r"   r"   r#   <module>   sn   
)'


 
  '7