
^Wc           @@  s  d  Z  d d l m Z d d l Z d d l 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 m Z d d l 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 m Z d d
 l m Z d d l  m! Z! m" Z" m# Z# m$ Z$ d d l% m& Z& m' Z' m( Z( m) Z) d d l* m+ Z+ m, Z, d d l- m. Z. d d l/ m0 Z0 m1 Z1 m2 Z2 d d l3 m Z4 d d l5 m6 Z6 d d l7 m8 Z8 d d d g Z9 d d d f d d d f d d d f d d d f d d e: f d d d f g Z; e j< e=  Z> d e? f d     YZ@ d e? f d     YZA e
 jB d e
 jC  d   ZD d! e? f d"     YZE d# e? f d$     YZF e d d%  ZG d&   ZH d'   ZI d(   ZJ d)   ZK e d* d+  ZL d S(,   s!   Routines related to PyPI, indexesi    (   t   absolute_importN(   t
   namedtuple(   t   parse(   t   request(   t	   ipaddress(   t   cached_propertyt   splitextt   normalize_patht   ARCHIVE_EXTENSIONSt   SUPPORTED_EXTENSIONS(   t   RemovedInPip9Warningt   RemovedInPip10Warning(   t
   indent_log(   t   DistributionNotFoundt   BestVersionAlreadyInstalledt   InvalidWheelFilenamet   UnsupportedWheel(   t   HAS_TLSt   is_urlt   path_to_urlt   url_to_path(   t   Wheelt	   wheel_ext(   t   supported_tags(   t   html5libt   requestst   six(   t   canonicalize_name(   t   SSLErrort   FormatControlt   fmt_ctl_handle_mutual_excludet   PackageFindert   httpst   *t	   localhosts   127.0.0.0/8s   ::1/128t   filet   ssht   InstallationCandidatec           B@  sb   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z RS(
   c         C@  s@   | |  _  t |  |  _ | |  _ |  j  |  j |  j f |  _ d  S(   N(   t   projectt   parse_versiont   versiont   locationt   _key(   t   selfR&   R(   R)   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __init__;   s    		c         C@  s   d j  |  j |  j |  j  S(   Ns,   <InstallationCandidate({0!r}, {1!r}, {2!r})>(   t   formatR&   R(   R)   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __repr__A   s    c         C@  s   t  |  j  S(   N(   t   hashR*   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __hash__F   s    c         C@  s   |  j  | d    S(   Nc         S@  s
   |  | k  S(   N(    (   t   st   o(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   <lambda>J   s    (   t   _compare(   R+   t   other(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __lt__I   s    c         C@  s   |  j  | d    S(   Nc         S@  s
   |  | k S(   N(    (   R1   R2   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR3   M   s    (   R4   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __le__L   s    c         C@  s   |  j  | d    S(   Nc         S@  s
   |  | k S(   N(    (   R1   R2   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR3   P   s    (   R4   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __eq__O   s    c         C@  s   |  j  | d    S(   Nc         S@  s
   |  | k S(   N(    (   R1   R2   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR3   S   s    (   R4   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __ge__R   s    c         C@  s   |  j  | d    S(   Nc         S@  s
   |  | k S(   N(    (   R1   R2   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR3   V   s    (   R4   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __gt__U   s    c         C@  s   |  j  | d    S(   Nc         S@  s
   |  | k S(   N(    (   R1   R2   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR3   Y   s    (   R4   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __ne__X   s    c         C@  s&   t  | t  s t S| |  j | j  S(   N(   t
   isinstanceR%   t   NotImplementedR*   (   R+   R5   t   method(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR4   [   s    (   t   __name__t
   __module__R,   R.   R0   R6   R7   R8   R9   R:   R;   R4   (    (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR%   9   s   									c           B@  s   e  Z d  Z e d e d d d  Z d   Z e e d   Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z e j d
  Z d   Z d   Z d   Z d   Z d   Z RS(   s   This finds packages.

    This is meant to match easy_install's technique for looking for
    packages, by reading pages and looking for appropriate links.
    c         C@  se  | d k r t d   n  g  |  _ xW | D]O } | j d  rj t |  }	 t j j |	  rj |	 } qj n  |  j j |  q+ W| |  _	 g  |  _
 t   |  _ | p t t   t    |  _ g  | r | n g  D] }
 d |
 d f ^ q |  _ | |  _ | |  _ | |  _ t saxR t j |  j	 |  j  D]5 } t j |  } | j d k r%t j d  Pq%q%Wn  d S(   s   Create a PackageFinder.

        :param format_control: A FormatControl object or None. Used to control
            the selection of source packages / binary packages when consulting
            the index and links.
        s>   PackageFinder() missing 1 required keyword argument: 'session't   ~R!   R    si   pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.N(   t   Nonet	   TypeErrort
   find_linkst
   startswithR   t   ost   patht   existst   appendt
   index_urlst   dependency_linkst   sett   logged_linksR   t   format_controlt   secure_originst   allow_all_prereleasest   process_dependency_linkst   sessionR   t	   itertoolst   chaint   urllib_parset   urlparset   schemet   loggert   warning(   R+   RD   RJ   RP   t   trusted_hostsRQ   RR   RN   t   linkt   new_linkt   hostt   parsed(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR,   i   s4    					.			c         C@  s0   |  j  r, t j d t  |  j j |  n  d  S(   NsX   Dependency Links processing has been deprecated and will be removed in a future release.(   RQ   t   warningst   warnR
   RK   t   extend(   R+   t   links(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   add_dependency_links   s
    	c         @  sX  g    g      f d   } x-|  D]%} t  j j |  } | j d  } | sX | r| rg | } n t |  } t  j j |  r | r t  j j |  } xI t  j |  D] } | t  j j | |   q Wq| r j	 |  qqJt  j j
 |  r| |  qJt j d |  q% t |  r: j	 |  q% t j d |  q% W   f S(   st   
        Sort locations into "files" (archives) and "urls", and return
        a pair of lists (files,urls)
        c         @  sL   t  |   } t j | d t d d k r;  j |  n   j |  d  S(   Nt   stricti    s	   text/html(   R   t	   mimetypest
   guess_typet   FalseRI   (   RG   t   url(   t   filest   urls(    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt	   sort_path   s    s   file:s:   Url '%s' is ignored: it is neither a file nor a directory.sQ   Url '%s' is ignored. It is either a non-existing path or lacks a specific scheme.(   RF   RG   RH   RE   R   t   isdirt   realpatht   listdirt   joinRI   t   isfileRX   RY   R   (   t	   locationst
   expand_dirRk   Rh   t   is_local_patht   is_file_urlRG   t   item(    (   Ri   Rj   sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   _sort_locations   s8    	 
c         C@  sp   t  t  } | j j r\ t | j j  } | j   sL t d | j   n  | j   } n | } | j	 | f S(   sL  
        Function used to generate link sort key for link tuples.
        The greater the return value, the more preferred it is.
        If not finding wheels, then sorted by version only.
        If finding wheels, then the sort order is by version, then:
          1. existing installs
          2. wheels ordered via Wheel.support_index_min()
          3. source archives
        Note: it was considered to embed this logic into the Link
              comparison operators, but then different sdist links
              with the same version, would have to be considered equal
        sB   %s is not a supported wheel for this platform. It can't be sorted.(
   t   lenR   R)   t   is_wheelR   t   filenamet	   supportedR   t   support_index_minR(   (   R+   t	   candidatet   support_numt   wheelt   pri(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   _candidate_sort_key   s    c   	      C@  s  t  j t |   } | j | j | j f } | d j d d  d } xht |  j D]Y} | | d k r | d d k r qU n  y t	 j
 t | d t j  s | d d  k r | d n | d j d   } t	 j t | d t j  r | d n | d j d   } WnQ t k
 r`| d rs| d j   | d j   k rs| d d k rsqU qsn X| | k rsqU n  | d | d k r| d d k r| d d  k	 rqU n  t SW| j d | j | j  t S(	   Ni    t   +i   iR!   t   utf8i   s   The repository located at %s is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host %s'.(   RU   RV   t   strRW   t   hostnamet   portt   rsplitt   SECURE_ORIGINSRO   R   t
   ip_addressR<   R   t	   text_typeRB   t   decodet
   ip_networkt
   ValueErrort   lowert   TrueRY   Rg   (	   R+   RX   R)   R^   t   origint   protocolt   secure_origint   addrt   network(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   _validate_secure_origin  s>      
 

c         @  s/     f d   } g  |  j  D] } | |  ^ q S(   s   Returns the locations found via self.index_urls

        Checks the url_name on the main (first in the list) index and
        use this url_name to produce all locations
        c         @  sA   t  j |  t j t      } | j d  s= | d } n  | S(   Nt   /(   t	   posixpathRo   RU   t   quoteR   t   endswith(   Rh   t   loc(   t   project_name(    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   mkurl_pypi_urlQ  s    (   RJ   (   R+   R   R   Rh   (    (   R   sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   _get_index_urls_locationsJ  s    c      	   C@  s  |  j  |  } |  j |  \ } } |  j |  j d t \ } } |  j |  j  \ } } d   t j | | |  D }	 g  t j d   | D d   | D d   | D  D] }
 |  j t |
  r |
 ^ q } t j	 d t
 |  |  x | D] } t j	 d |  q Wt |  } t |  j |  } t | | |  } |  j d   |  j D |  } g  } xY |  j | |  D]E } t j	 d	 | j  t   ! | j |  j | j |   Wd
 QXqsW|  j d   |  j D |  } | rt j	 d d j g  | D] } | j j ^ q  n  |  j |	 |  } | ry| j d t  t j	 d d j g  | D] } t | j j  ^ qT  n  | | | | S(   s  Find all available InstallationCandidate for project_name

        This checks index_urls, find_links and dependency_links.
        All versions found are returned as an InstallationCandidate list.

        See _link_package_versions for details on which files are accepted
        Rr   c         s@  s   |  ] } t  |  Vq d  S(   N(   t   Link(   t   .0Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>o  s    c         s@  s   |  ] } t  |  Vq d  S(   N(   R   (   R   Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>y  s    c         s@  s   |  ] } t  |  Vq d  S(   N(   R   (   R   Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>z  s    c         s@  s   |  ] } t  |  Vq d  S(   N(   R   (   R   Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>{  s    s,   %d location(s) to search for versions of %s:s   * %sc         s@  s   |  ] } t  | d   Vq d S(   s   -fN(   R   (   R   Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>  s    s   Analyzing links from page %sNc         s@  s   |  ] } t  |  Vq d  S(   N(   R   (   R   Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>  s    s   dependency_links found: %ss   , t   reverses   Local files found: %s(   R   Rv   RD   R   RK   RS   RT   R   RX   t   debugRw   R   t   fmt_ctl_formatsRN   t   Searcht   _package_versionst
   _get_pagesRh   R   Ra   Rb   Ro   R)   t   sortR   (   R+   R   t   index_locationst   index_file_loct   index_url_loct   fl_file_loct
   fl_url_loct   dep_file_loct   dep_url_loct   file_locationsR[   t   url_locationsR)   t   canonical_namet   formatst   searcht   find_links_versionst   page_versionst   paget   dependency_versionsR(   t   file_versionsR|   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   find_all_candidates`  sZ    			
 &)c   
      C@  s"  |  j  | j  } t | j j g  | D] } t | j  ^ q% d |  j rR |  j n d  } g  | D]! } t | j  | k re | ^ qe } | r t	 | d |  j
 } n d } | j d k	 r t | j j  } n d } | d k r=| d k r=t j d | d j t t d   | D  d t   t d |   n  t }	 | rm| d k sd| j | k rmt }	 n  | r| d k	 r|	 rt j d |  n t j d | | j  d S|	 rt j d	 | d j t | d t  pd
  t  n  t j d | j d j t | d t   | j S(   s   Try to find a Link matching req

        Expects req, an InstallRequirement and upgrade, a boolean
        Returns a Link if found,
        Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise
        t   prereleasest   keysN   Could not find a version that satisfies the requirement %s (from versions: %s)s   , c         s@  s   |  ] } t  | j  Vq d  S(   N(   R   R(   (   R   t   c(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pys	   <genexpr>  s    s%   No matching distribution found for %ssL   Existing installed version (%s) is most up-to-date and satisfies requirementsU   Existing installed version (%s) satisfies requirement (most up-to-date version is %s)s=   Installed version (%s) is most up-to-date (past versions: %s)t   nones)   Using version %s (newest of versions: %s)N(   R   t   nameRL   t	   specifiert   filterR   R(   RP   RB   t   maxR   t   satisfied_byR'   RX   t   criticalRo   t   sortedR   Rg   R   R   R   R)   (
   R+   t   reqt   upgradet   all_candidatesR   t   compatible_versionst   applicable_candidatest   best_candidatet   installed_versiont   best_installed(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   find_requirement  sd    	".		

	c         c@  sc   t    } xS | D]K } | | k r( q n  | j |  |  j |  } | d k rV q n  | Vq Wd S(   sp   
        Yields (page, page_url) from the given locations, skipping
        locations that have errors.
        N(   RL   t   addt	   _get_pageRB   (   R+   Rq   R   t   seenR)   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    	s   -py([123]\.?[0-9]?)$c         C@  sq   g  g  } } t    } xP | D]H } | | k r | j |  | j rU | j |  qe | j |  q q W| | S(   s   
        Returns elements of links in order, non-egg links first, egg links
        second, while eliminating duplicates
        (   RL   R   t   egg_fragmentRI   (   R+   Rb   t   eggst   no_eggsR   R[   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   _sort_links)  s    		c         C@  sR   g  } xE |  j  |  D]4 } |  j | |  } | d  k	 r | j |  q q W| S(   N(   R   t   _link_package_versionsRB   RI   (   R+   Rb   R   t   resultR[   t   v(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR   9  s    c         C@  s9   | |  j  k r5 t j d | |  |  j  j |  n  d  S(   Ns   Skipping link %s; %s(   RM   RX   R   R   (   R+   R[   t   reason(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   _log_skipped_linkA  s    c   	      C@  s~  d } | j r$ | j } | j } nX| j   \ } } | sP |  j | d  d S| t k rt |  j | d |  d Sd | j k r | t k r |  j | d | j  d Sd | j	 k r | d k r |  j | d  d S| t k r|y t
 | j  } Wn" t k
 r|  j | d	  d SXt | j  | j k rP|  j | d
 | j  d S| j   sp|  j | d  d S| j } n  d | j k r| t k r|  j | d | j  d S| st | | j |  } n  | d k r|  j | d
 | j  d S|  j j |  } | rX| | j    } | j d  } | t j d  k rX|  j | d  d Sn  t j d | |  t | j | |  S(   s'   Return an InstallationCandidate or Nones
   not a fileNs   unsupported archive format: %st   binarys   No binaries permitted for %st   macosx10s   .zips   macosx10 ones   invalid wheel filenames   wrong project name (not %s)s%   it is not compatible with this Pythont   sources   No sources permitted for %si   i   s   Python version is incorrects   Found link %s, version: %s(   RB   R   t   extR   R   R	   R   R   t   suppliedRG   R   Ry   R   R   R   t	   canonicalRz   R(   t   egg_info_matchest   _py_version_reR   t   startt   groupt   sysRX   R   R%   (	   R+   R[   R   R(   t   egg_infoR   R~   t   matcht
   py_version(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR   F  sl    		

c         C@  s   t  j | d |  j S(   NRR   (   t   HTMLPaget   get_pageRR   (   R+   R[   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    N(   R?   R@   t   __doc__Rg   RB   R,   Rc   t   staticmethodRv   R   R   R   R   R   R   t   ret   compileR   R   R   R   R   R   (    (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR   b   s&   >	1		G		S	c					As   ([a-z0-9_.]+)-([a-z0-9_.!+-]+)c         C@  s   | j  |   } | s) t j d |  d S| d k rU | j d  } | | j d  S| j d  j   } | j d d  } | j   d } | j |  r | j d  t	 |  Sd Sd S(   sx  Pull the version part out of a string.

    :param egg_info: The string to parse. E.g. foo-2.1
    :param search_name: The name of the package this belongs to. None to
        infer the name. Note that this cannot unambiguously parse strings
        like foo-2-2 which might be foo, 2-2 or foo-2, 2.
    :param link: The link the string came from, for logging on failure.
    s%   Could not parse version from link: %si    t   -t   _N(
   R   RX   R   RB   R   t   indexR   t   replaceRE   Rw   (   R   t   search_nameR[   t   _egg_info_reR   t
   full_matchR   t   look_for(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    R   c           B@  s   e  Z d  Z d
 d  Z d   Z e e d
 d   Z e	 d
 d   Z
 e	 d    Z e d    Z e d    Z e j d e j  Z d	   Z RS(   s'   Represents one page, along with its URLc         C@  s   d  } | rM d | k rM t j | d  \ } } d | k rM | d } qM n  | |  _ t j |  j d | d t |  _ | |  _ | |  _	 d  S(   Ns   Content-Typet   charsett   encodingt   namespaceHTMLElements(
   RB   t   cgit   parse_headert   contentR   R   Rg   R^   Rh   t   headers(   R+   R   Rh   R   R   t   content_typet   params(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR,     s    			c         C@  s   |  j  S(   N(   Rh   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   __str__  s    c         C@  s  | d  k r t d   n  | j } | j d d  d } d d l m } xS | j D]H } | j   j |  rT | t	 |  d k rT t
 j d | |  d  SqT Wy| r| j } xh t D]] } | j |  r |  j | d | }	 |	 j   j d	  r Pqt
 j d
 | |	  d  Sq q Wn  t
 j d |  t j |  \ } }
 } } } } | d k rt j j t j |   r| j d  s| d 7} n  t j | d  } t
 j d |  n  | j | d i d	 d 6d d 6} | j   | j j d d  }	 |	 j   j d	  s$t
 j d
 | |	  d  S|  | j | j | j  } Wn t j k
 rk} |  j | | |  n t k
 r} d | } |  j | | | d t
 j  nW t j! k
 r} |  j | d | |  n+ t j" k
 r|  j | d |  n X| Sd  S(   Ns9   get_page() missing 1 required keyword argument: 'session't   #i   i    (   t
   VcsSupports   +:s   Cannot look at %s URL %sRR   s	   text/htmls,   Skipping page %s because of Content-Type: %ss   Getting page %sR#   R   s
   index.htmls#    file: URL is directory, getting %sR   t   Accepts   max-age=600s   Cache-Controls   Content-Typet   unknowns6   There was a problem confirming the ssl certificate: %st   meths   connection error: %ss	   timed out(#   RB   RC   Rh   t   splitt   pip.vcsR   t   schemesR   RE   Rw   RX   R   Ry   R   R   t   _get_content_typeRU   RV   RF   RG   Rl   t   urllib_requestt   url2pathnamet   urljoint   gett   raise_for_statusR   R   R   t	   HTTPErrort   _handle_failR   t   infot   ConnectionErrort   Timeout(   t   clsR[   t   skip_archivesRR   Rh   R   RW   Ry   t   bad_extR   t   netlocRG   R   t   queryt   fragmentt   respt   instt   excR   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     sr    	+	!
c         C@  s,   | d  k r t j } n  | d |  |  d  S(   Ns%   Could not fetch URL %s: %s - skipping(   RB   RX   R   (   R[   R   Rh   R  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR    s    c         C@  s`   t  j |   \ } } } } } | d k r. d S| j |  d t } | j   | j j d d  S(   s;   Get the Content-Type of the given url, using a HEAD requestt   httpR    t    t   allow_redirectss   Content-Type(   s   https   https(   RU   t   urlsplitt   headR   R  R   R
  (   Rh   RR   RW   R  RG   R  R  R  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR    s    
c         C@  so   g  |  j  j d  D]! } | j d  d  k	 r | ^ q } | rd | d j d  rd | d j d  S|  j Sd  S(   Ns   .//baset   hrefi    (   R^   t   findallR
  RB   Rh   (   R+   t   xt   bases(    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   base_url+  s
    !c         c@  sn   xg |  j  j d  D]S } | j d  r | j d  } |  j t j |  j |   } t | |   Vq q Wd S(   s   Yields all links in the pages   .//aR  N(   R^   R   R
  t
   clean_linkRU   R	  R#  R   (   R+   t   anchorR  Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyRb   6  s    s   [^a-z0-9$&+,/:;=?@.#%_\\|-]c         C@  s   |  j  j d   |  S(   s   Makes sure a link is fully encoded.  That is, if a ' ' shows up in
        the link, it will be rewritten to %20 (while not over-quoting
        % or other characters).c         S@  s   d t  |  j d   S(   Ns   %%%2xi    (   t   ordR   (   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR3   H  s    (   t	   _clean_ret   sub(   R+   Rh   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR$  C  s    	N(   R?   R@   R   RB   R,   R   t   classmethodR   R   R   R  R  R   R#  t   propertyRb   R   R   t   IR'  R$  (    (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s   	UR   c           B@  s^  e  Z d d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z e d
    Z e d    Z e d    Z e d    Z d   Z e d    Z e d    Z e j d  Z e d    Z e j d  Z e d    Z e j d  Z e d    Z e d    Z e d    Z e d    Z e d    Z  RS(   c         C@  s4   | j  d  r t |  } n  | |  _ | |  _ d  S(   Ns   \\(   RE   R   Rh   t
   comes_from(   R+   Rh   R,  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR,   M  s    	c         C@  s.   |  j  r d |  j |  j  f St |  j  Sd  S(   Ns   %s (from %s)(   R,  Rh   R   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR   V  s    	c         C@  s   d |  S(   Ns	   <Link %s>(    (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR.   \  s    c         C@  s#   t  | t  s t S|  j | j k S(   N(   R<   R   R=   Rh   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR8   _  s    c         C@  s#   t  | t  s t S|  j | j k S(   N(   R<   R   R=   Rh   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR;   d  s    c         C@  s#   t  | t  s t S|  j | j k  S(   N(   R<   R   R=   Rh   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR6   i  s    c         C@  s#   t  | t  s t S|  j | j k S(   N(   R<   R   R=   Rh   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR7   n  s    c         C@  s#   t  | t  s t S|  j | j k S(   N(   R<   R   R=   Rh   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR:   s  s    c         C@  s#   t  | t  s t S|  j | j k S(   N(   R<   R   R=   Rh   (   R+   R5   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR9   x  s    c         C@  s   t  |  j  S(   N(   R/   Rh   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR0   }  s    c         C@  sk   t  j |  j  \ } } } } } t j | j d   p< | } t  j |  } | sg t d |  j   | S(   NR   s   URL %r produced no filename(   RU   R  Rh   R   t   basenamet   rstript   unquotet   AssertionError(   R+   R   R  RG   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyRy     s
    !c         C@  s   t  j |  j  d S(   Ni    (   RU   R  Rh   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyRW     s    c         C@  s   t  j |  j  d S(   Ni   (   RU   R  Rh   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR    s    c         C@  s   t  j t  j |  j  d  S(   Ni   (   RU   R/  R  Rh   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyRG     s    c         C@  s   t  t j |  j j d    S(   NR   (   R   R   R-  RG   R.  (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    c         C@  s   |  j    d S(   Ni   (   R   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    c         C@  s=   t  j |  j  \ } } } } } t  j | | | | d  f  S(   N(   RU   R  Rh   t
   urlunsplitRB   (   R+   RW   R  RG   R  R  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   url_without_fragment  s    !s   [#&]egg=([^&]*)c         C@  s,   |  j  j |  j  } | s d  S| j d  S(   Ni   (   t   _egg_fragment_reR   Rh   RB   R   (   R+   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    s   [#&]subdirectory=([^&]*)c         C@  s,   |  j  j |  j  } | s d  S| j d  S(   Ni   (   t   _subdirectory_fragment_reR   Rh   RB   R   (   R+   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   subdirectory_fragment  s    s2   (sha1|sha224|sha384|sha256|sha512|md5)=([a-f0-9]+)c         C@  s,   |  j  j |  j  } | r( | j d  Sd  S(   Ni   (   t   _hash_reR   Rh   R   RB   (   R+   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR/     s    c         C@  s,   |  j  j |  j  } | r( | j d  Sd  S(   Ni   (   R6  R   Rh   R   RB   (   R+   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt	   hash_name  s    c         C@  s0   t  j |  j j d d  d j d d  d  S(   NR   i   i    t   ?(   R   R-  Rh   R  (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   show_url  s    c         C@  s   |  j  t k S(   N(   R   R   (   R+   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyRx     s    c         C@  s*   d d l  m } |  j | j k r& t St S(   s   
        Determines if this points to an actual artifact (e.g. a tarball) or if
        it points to an "abstract" thing like a path or a VCS location.
        i    (   t   vcs(   R  R:  RW   t   all_schemesRg   R   (   R+   R:  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   is_artifact  s    N(!   R?   R@   RB   R,   R   R.   R8   R;   R6   R7   R:   R9   R0   R*  Ry   RW   R  RG   R   R   R2  R   R   R3  R   R4  R5  R6  R/   R7  R9  Rx   R<  (    (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR   K  s8   												s   no_binary only_binaryc         C@  s   |  j  d  } xU d | k rf | j   | j   | j d  | | j d  d 4d | k r d  Sq WxP | D]H } | d k r | j   qn n  t |  } | j |  | j |  qn Wd  S(   Nt   ,s   :all:i   s   :none:(   R  t   clearR   R   R   t   discard(   t   valuet   targetR5   t   newR   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    


c         C@  s   t  d d g  } | |  j k r1 | j d  n] | |  j k rP | j d  n> d |  j k ro | j d  n d |  j k r | j d  n  t |  S(   NR   R   s   :all:(   RL   t   only_binaryR?  t	   no_binaryt	   frozenset(   t   fmt_ctlR   R   (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyR     s    c         C@  s   t  d |  j |  j  d  S(   Ns   :all:(   R   RD  RC  (   RF  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   fmt_ctl_no_binary  s    c         C@  s$   t  |   t j d t d d d  S(   Nsf   --no-use-wheel is deprecated and will be removed in the future.  Please use --no-binary :all: instead.t
   stackleveli   (   RG  R_   R`   R   (   RF  (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   fmt_ctl_no_use_wheel	  s
    
R   s   supplied canonical formats(M   R   t
   __future__R    t   loggingR   t   collectionsR   RS   R   RF   R   Re   R   R_   t   pip._vendor.six.moves.urllibR   RU   R   R  t
   pip.compatR   t	   pip.utilsR   R   R   R   R	   t   pip.utils.deprecationR
   R   t   pip.utils.loggingR   t   pip.exceptionsR   R   R   R   t   pip.downloadR   R   R   R   t	   pip.wheelR   R   t   pip.pep425tagsR   t   pip._vendorR   R   R   t   pip._vendor.packaging.versionR'   t   pip._vendor.packaging.utilsR   t   pip._vendor.requests.exceptionsR   t   __all__RB   R   t	   getLoggerR?   RX   t   objectR%   R   R   R+  R   R   R   R   R   R   RG  RI  R   (    (    (    sZ   /private/var/folders/3n/6h2rwf155rn1m71wwyxn79n80000gn/T/pip-build-IcAT_k/pip/pip/index.pyt   <module>   s^   ("")  -
				