ó
^\kdc           @€  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 m Z d d l m Z d d l m Z m Z d d l m Z m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z m Z m Z d d l m  Z  d d l! m" Z" d d l m  Z  d Z# d$ Z$ d d% d „ Z% y e& d „  Z' Wn e( k
 r†d „  Z' n Xd „  Z) d „  Z* e j+ d e j, ƒ Z- d „  Z. d „  Z/ e0 d d e2 d „ Z3 d „  Z4 e4 d „  ƒ Z5 d „  Z6 d „  Z7 d  e8 f d! „  ƒ  YZ9 d" e8 f d# „  ƒ  YZ: d S(&   sH   
Support for installing and building the "wheel" binary package format.
iÿÿÿÿ(   t   with_statementN(   t   urlsafe_b64encode(   t   Parser(   t   ConfigParsert   StringIO(   t   InvalidWheelFilenamet   UnsupportedWheel(   t   distutils_scheme(   t   logger(   t
   pep425tags(   t   call_subprocesst   normalize_patht   make_path_relative(   t   pkg_resources(   t   ScriptMakers   .whli   i    t   sha256i   c         C€  s§   t  j | ƒ } d } t |  d ƒ �O } | j | ƒ } x6 | rn | t | ƒ 7} | j | ƒ | j | ƒ } q9 WWd QXd t | j ƒ  ƒ j d ƒ j	 d ƒ } | | f S(   s6   Return (hash, length) for path using hashlib.new(algo)i    t   rbNs   sha256=t   latin1t   =(
   t   hashlibt   newt   opent   readt   lent   updateR   t   digestt   decodet   rstrip(   t   patht   algot	   blocksizet   ht   lengtht   ft   blockR   (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   rehash"   s    	(c         C€  s    t  |  t ƒ r |  j d ƒ S|  S(   Nt   ascii(   t
   isinstancet   unicodet   encode(   t   s(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   binary1   s    c         C€  s    t  |  t ƒ r |  j d ƒ Sd  S(   NR$   (   R%   t   strR'   (   R(   (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyR)   6   s    c         C€  sI   t  j d d k  r" i  } d } n i d d 6} d } t |  | | | � S(   Ni    i   t   bt    t   newline(   t   syst   version_infoR   (   t   namet   modet   nlt   bin(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   open_for_csv:   s    	c         C€  sÜ   t  j j |  ƒ rØ t |  d ƒ } zj | j ƒ  } | j t d ƒ ƒ sI t St j	 j
 t j ƒ  ƒ } t d ƒ | t t  j ƒ } | j ƒ  } Wd | j ƒ  Xt |  d ƒ } z | j | ƒ | j | ƒ Wd | j ƒ  Xt Sd S(   sL   Replace #!python with #!/path/to/python
    Return True if file was changed.R   s   #!pythons   #!Nt   wb(   t   osR   t   isfileR   t   readlinet
   startswithR)   t   FalseR.   t
   executableR'   t   getfilesystemencodingt   linesepR   t   closet   writet   True(   R   t   scriptt	   firstlinet   exenamet   rest(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt
   fix_scriptC   s     sZ   ^(?P<namever>(?P<name>.+?)(-(?P<ver>\d.+?))?)
                                \.dist-info$c      	   C€  s·   |  j  d d ƒ } xž t j | ƒ D]� } t j | ƒ } | r" | j d ƒ | k r" t t j j | | d ƒ ƒ �: } x0 | D]( } | j	 ƒ  j
 ƒ  } | d k rz t Sqz WWd QXq" q" Wt S(   sP   
    Return True if the extracted wheel in wheeldir should go into purelib.
    t   -t   _R0   t   WHEELs   root-is-purelib: trueN(   t   replaceR6   t   listdirt   dist_info_ret   matcht   groupR   R   t   joint   lowerR   R@   R:   (   R0   t   wheeldirt   name_foldedt   itemRL   t   wheelt   line(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   root_is_purelib]   s    !c         C€  sõ   t  j j |  ƒ s i  i  f St |  ƒ �N } t ƒ  } x. | D]& } | j | j ƒ  ƒ | j d ƒ q; W| j d ƒ Wd  QXt j	 ƒ  } | j
 | ƒ i  } i  } | j d ƒ rÄ t | j d ƒ ƒ } n  | j d ƒ rë t | j d ƒ ƒ } n  | | f S(   Ns   
i    t   console_scriptst   gui_scripts(   R6   R   t   existsR   R   R?   t   stript   seekR   t   RawConfigParsert   readfpt   has_sectiont   dictt   items(   t   filenamet   fpt   dataRT   t   cpt   consolet   gui(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   get_entrypointsm   s"    
	c   $      €  s  t  |  d | d | d | ƒ} t |  ˆ ƒ r: | d ‰ n
 | d ‰ g  ‰ g  ‰ ˆ j t j j ƒ t j j } i  ‰ t ƒ  ‰  g  }	 | r¦ t j | d t	 d t	 ƒn  d „  ‰ t
 ‡  ‡ ‡ ‡ ‡ f d	 † ‰	 d( d( ‡ ‡ ‡	 ‡
 f d
 † }
 |
 | ˆ t	 ƒ ˆ st d ˆ
 ƒ ‚ t j j ˆ d d ƒ } t | ƒ \ ‰ ‰ ‡ ‡ f d †  } x¢ ˆ D]š } d( } d( } x… t j t j j ˆ | ƒ ƒ D]e } d( } | d k r­t } | } n  t j j ˆ | | ƒ } | | } |
 | | t
 d | d | ƒq†WqUWt d( | d ƒ ‰ t d) ƒ ˆ _ t	 ˆ _ ‡ f d †  } | ˆ _ d ˆ _ ˆ j d d( ƒ } | rGd t j k r‰d | } |	 j ˆ j | ƒ ƒ n  t j j d d ƒ d k rÔd t j d  | f } |	 j ˆ j | ƒ ƒ n  d t j d  | f } |	 j ˆ j | ƒ ƒ g  ˆ D] } t j d | ƒ r| ^ q} x | D] } ˆ | =q3Wn  ˆ j d d( ƒ } | rd t j k r‘d | } |	 j ˆ j | ƒ ƒ n  d t j d  | f } |	 j ˆ j | ƒ ƒ g  ˆ D] } t j d  | ƒ rÅ| ^ qÅ} x | D] } ˆ | =qðWn  t ˆ ƒ d k rL|	 j ˆ j  g  ˆ j! ƒ  D] } d! | ^ q/ƒ ƒ n  t ˆ ƒ d k rž|	 j ˆ j  g  ˆ j! ƒ  D] } d! | ^ qwi t	 d" 6ƒ ƒ n  t j j ˆ d d# ƒ } t j j ˆ d d$ ƒ } t" | d% ƒ �} t" | d& ƒ �ö } t# j$ | ƒ } t# j% | ƒ } xj | D]b }  ˆ j |  d |  d ƒ |  d <|  d ˆ  k rnt& |  d ƒ \ |  d <|  d' <n  | j' |  ƒ qWx6 |	 D]. }! t& |! ƒ \ }" }# | j' |! |" |# f ƒ q†Wx( ˆ D]  }! | j' ˆ |! d d f ƒ q¿WWd( QXWd( QXt( j) | | ƒ d( S(*   s   Install a wheelt   usert   homet   roott   purelibt   platlibt   forcet   quietc         S€  s   t  |  | ƒ j t j j d ƒ S(   Nt   /(   R   RI   R6   R   t   sep(   t   srct   p(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   normpath£   s    c         €  sB   ˆ |  ˆ ƒ } ˆ | ˆ ƒ } | ˆ | <| r> ˆ  j  | ƒ n  d S(   s6   Map archive RECORD paths to installation RECORD paths.N(   t   add(   t   srcfilet   destfilet   modifiedt   oldpatht   newpath(   t   changedt	   installedt   lib_dirRr   RP   (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   record_installed¦   s
    
c         €  s  t  j j | ƒ s" t  j | ƒ n  xât  j |  ƒ D]Ñ\ } } } | t |  ƒ j t  j j ƒ } | r‘ | j t  j j d ƒ d j	 d ƒ r‘ q2 n  xÞ | D]Ö }	 t  j j
 | | |	 ƒ }
 | rê | d k rê |
 j	 d ƒ rê ˆ  j |	 ƒ q˜ nb | rL|	 j	 d ƒ rL|	 j ƒ  j ˆ j j d d ƒ j ƒ  ƒ rLˆ s<t d ƒ ‚ ˆ j |
 ƒ n  t  j j |
 ƒ s˜ t  j |
 ƒ q˜ q˜ WxŽ | D]† } | r—| | ƒ r—qyn  t  j j
 | | ƒ } t  j j
 | | | ƒ } t j | | ƒ t } | rï| | ƒ } n  ˆ | | | ƒ qyWq2 Wd  S(	   Ni   i    s   .dataR,   s
   .dist-infoRF   RG   s   Multiple .dist-info directories(   R6   R   RX   t   makedirst   walkR   t   lstripRo   t   splitt   endswithRN   t   appendRO   R9   t   project_nameRI   t   AssertionErrort   shutilt   moveR:   (   t   sourcet   destt   is_baset   fixert   filtert   dirt   subdirst   filest   basedirR(   t
   destsubdirR!   Rt   Ru   Ry   (   t	   data_dirst   info_dirR|   t   req(    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   clobber®   s8    +!*s!   %s .dist-info directory not foundi    s   entry_points.txtc         €  s‚   |  j  ƒ  j d ƒ r" |  d  } nJ |  j  ƒ  j d ƒ rD |  d  } n( |  j  ƒ  j d ƒ rf |  d  } n |  } | ˆ  k p� | ˆ k S(   Ns   .exeiüÿÿÿs
   -script.pyiöÿÿÿs   .pya(   RO   R�   (   R0   t	   matchname(   Rd   Re   (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   is_entrypoint_wrapper×   s    t   scriptsRŠ   R‹   R,   c         €  s6   ˆ  j  i |  j d 6|  j j d ƒ d d 6|  j d 6S(   Nt   modulet   .i    t   import_namet   func(   t   script_templatet   prefixt   suffixR€   (   t   entry(   t   maker(    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   _get_script_text  s    	
sÏ   # -*- 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())
t   pipt   ENSUREPIP_OPTIONSs   pip = t
   altinstalls
   pip%s = %si   i   s   pip(\d(\.\d)?)?$t   easy_installs   easy_install = s   easy_install-%s = %ss   easy_install(-\d\.\d)?$s   %s = %sRe   t   RECORDs
   RECORD.pipt   rs   w+i   N(   R,   (*   R   RU   R   R6   R   Ro   t   sett
   compileallt   compile_dirR@   R:   t   NoneR„   RN   Rf   RJ   RE   R   t   variantst   set_modeR¡   Rœ   t   popt   environt   extendt   maket   getR.   t   versiont   reRL   R   t   make_multipleR_   R4   t   csvt   readert   writerR#   t   writerowR…   R†   ($   R0   R“   RP   Rg   Rh   Ri   t	   pycompilet   schemeR‡   t	   generatedR”   t   ep_fileR–   t   datadirRŠ   R‹   t   subdirRˆ   R¡   t
   pip_scriptt   spect   kt   pip_ept   easy_install_scriptt   easy_install_ept   kvt   recordt   temp_recordt	   record_int
   record_outR·   R¸   t   rowR!   R   t   l(    (   Ry   Rd   R‘   Re   R’   Rz   R{   R    Rr   R|   R“   RP   s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   move_wheel_filesˆ   s¤    
		!%	
$		
	#
+
6@!*c         €  s"   t  j ˆ  ƒ ‡  f d †  ƒ } | S(   Nc          ?€  sH   t  ƒ  } x8 ˆ  |  | Ž  D]' } | | k r | j | ƒ | Vq q Wd  S(   N(   R¨   Rs   (   t   argst   kwt   seenRR   (   t   fn(    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   uniquel  s
    	(   t	   functoolst   wraps(   RÑ   RÒ   (    (   RÑ   s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   _uniquek  s    c         c€  s¶   d d l  m } t j | |  j d ƒ ƒ ƒ } x� | D]y } t j j |  j | d ƒ } | V| j	 d ƒ r5 t j j
 | ƒ \ } } | d  } t j j | | d ƒ } | Vq5 q5 Wd S(	   s  
    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.
    iÿÿÿÿ(   t   FakeFileR¦   i    s   .pyiýÿÿÿs   .pycN(   t   pip.reqRÖ   R¶   R·   t   get_metadata_linesR6   R   RN   t   locationR�   R€   (   t   distRÖ   R§   RË   R   t   dnRÑ   t   base(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   uninstallation_pathsv  s    

c         C€  s�   y€ g  t  j d |  ƒ D] } | ^ q d } | j d ƒ } t ƒ  j | ƒ } | d j ƒ  } t t t	 | j
 d ƒ ƒ ƒ } | SWn t SXd S(   s†   
    Return the Wheel-Version of an extracted wheel, if possible.

    Otherwise, return False if we couldn't parse / extract it.
    i    RH   s   Wheel-VersionR™   N(   R   t   find_on_pathR«   t   get_metadataR   t   parsestrRY   t   tuplet   mapt   intR€   R:   (   t
   source_dirt   dRÚ   t
   wheel_dataR³   (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   wheel_versionŒ  s    )c         C€  sŽ   |  s t  d | ƒ ‚ n  |  d t d k rX t  d | d j t t |  ƒ ƒ f ƒ ‚ n2 |  t k rŠ t j d d j t t |  ƒ ƒ ƒ n  d S(   sê  
    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
    s(   %s is in an unsupported or invalid wheeli    sB   %s's Wheel-Version (%s) is not compatible with this version of pipR™   s*   Installing from a newer Wheel-Version (%s)N(   R   t   VERSION_COMPATIBLERN   Râ   R*   R   t   warn(   R³   R0   (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   check_compatibilityŸ  s    %	t   Wheelc           B€  sD   e  Z d  Z e j d e j ƒ Z d „  Z d d „ Z	 d d „ Z
 RS(   s   A wheel filesž   ^(?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 | ƒ ‚ n  | ˆ  _ | 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
 †  ˆ  j	 Dƒ ƒ ˆ  _ d S(   sX   
        :raises InvalidWheelFilename: when the filename is invalid for a wheel
        s!   %s is not a valid wheel filename.R0   RG   RF   t   vert   pyverR™   t   abit   platc         3€  s>   |  ]4 } ˆ  j  D]$ } ˆ  j D] } | | | f Vq q q d  S(   N(   t   abist   plats(   t   .0t   xt   yt   z(   t   self(    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pys	   <genexpr>Ö  s    N(   t   wheel_file_reRL   R   R`   RM   RI   R0   R³   R€   t
   pyversionsRð   Rñ   R¨   t	   file_tags(   Rö   R`   t
   wheel_info(    (   Rö   s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   __init__Å  s    	c         C€  s]   | d k r t j } n  g  |  j D]! } | | k r" | j | ƒ ^ q" } | rY t | ƒ Sd S(   s"  
        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.
        N(   R«   R	   t   supported_tagsRù   t   indext   min(   Rö   t   tagst   ct   indexes(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   support_index_minÙ  s    1c         C€  s4   | d k r t j } n  t t | ƒ j |  j ƒ ƒ S(   s'   Is this wheel supported on this system?N(   R«   R	   Rü   t   boolR¨   t   intersectionRù   (   Rö   Rÿ   (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt	   supportedå  s    N(   t   __name__t
   __module__t   __doc__R´   t   compilet   VERBOSER÷   Rû   R«   R  R  (    (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyRë   º  s   	t   WheelBuilderc           B€  s/   e  Z d  Z g  g  d „ Z d „  Z d „  Z RS(   s#   Build wheels from a RequirementSet.c         C€  s7   | |  _  | |  _ t | ƒ |  _ | |  _ | |  _ d  S(   N(   t   requirement_sett   finderR   t	   wheel_dirt   build_optionst   global_options(   Rö   R  R  R  R  R  (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyRû   ï  s
    			c         C€  s¯   t  j d d | j g t |  j ƒ } t j d | j ƒ t j d |  j ƒ | d d |  j g |  j	 } y! t
 | d | j d t ƒt SWn t j d	 | j ƒ t SXd
 S(   s   Build one wheel.s   -csj   import setuptools;__file__=%r;exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))s#   Running setup.py bdist_wheel for %ss   Destination directory: %st   bdist_wheels   -dt   cwdt   show_stdouts   Failed building wheel for %sN(   R.   R;   t   setup_pyt   listR  R   t   notifyR0   R  R  R
   Rä   R:   R@   t   error(   Rö   R“   t	   base_argst
   wheel_args(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt
   _build_oneö  s    	
c         C€  s_  |  j  j |  j ƒ |  j  j j ƒ  } g  | D] } | j s, | ^ q, } | sQ d St j d d j g  | D] } | j	 ^ qg ƒ ƒ t j
 d 7_
 g  g  } } x: | D]2 } |  j | ƒ rÉ | j | ƒ q¤ | j | ƒ q¤ Wt j
 d 8_
 | r"t j d d j g  | D] } | j	 ^ qƒ ƒ n  | r[t j d d j g  | D] } | j	 ^ q>ƒ ƒ n  d S(   s   Build wheels.Ns*   Building wheels for collected packages: %st   ,i   s   Successfully built %st    s   Failed to build %s(   R  t   prepare_filesR  t   requirementst   valuest   is_wheelR   R  RN   R0   t   indentR  R‚   (   Rö   t   reqsetR“   t   buildsett   build_successt   build_failure(    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   build	  s&    "'3(   R  R  R  Rû   R  R&  (    (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyR  ì  s   	(   i   i    i   (;   R  t
   __future__R    R©   R¶   RÓ   R   R6   R´   R…   R.   t   base64R   t   email.parserR   t   pip.backwardcompatR   R   t   pip.exceptionsR   R   t   pip.locationsR   t   pip.logR   R¢   R	   t   pip.utilR
   R   R   t   pip._vendorR   t   pip._vendor.distlib.scriptsR   t	   wheel_extRè   R#   R&   R)   t	   NameErrorR4   RE   R	  R
  RK   RU   Rf   R:   R«   R@   RÍ   RÕ   RÝ   Rç   Rê   t   objectRë   R  (    (    (    s0   /var/www/testScraper/venv/build/pip/pip/wheel.pyt   <module>   sT   						â			2