ó
Ð²Ebc           @   s‚  d  Z  d d l Z d d l Z d d l m Z d d l m Z d d d d	 d
 d d d g Z e j e	 ƒ Z
 d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e j d ƒ Z d „  Z e Z d e f d „  ƒ  YZ d „  Z d e f d „  ƒ  YZ e j d ƒ d f e j d ƒ d f e j d ƒ d f e j d ƒ d f e j d ƒ d  f e j d! ƒ d  f e j d" ƒ d# f e j d$ ƒ d% f e j d& ƒ d' f e j d( ƒ d) f f
 Z e j d* ƒ d f e j d+ ƒ d f e j d, ƒ d# f e j d" ƒ d# f e j d- ƒ d f f Z e j d. ƒ Z d/ „  Z d0 „  Z e j d1 e j ƒ Z i d2 d3 6d2 d4 6d5 d6 6d2 d7 6d8 d9 6d d 6d d# 6Z d: „  Z  d e f d; „  ƒ  YZ! d	 e f d< „  ƒ  YZ" e j d= e j ƒ Z# d> „  Z$ d? „  Z% d
 e f d@ „  ƒ  YZ& d e f dA „  ƒ  YZ' dB e f dC „  ƒ  YZ( i e( e e e ƒ dD 6e( e  e" dE „  ƒ dF 6e( e% e' e ƒ dG 6Z) e) dD e) dH <dI „  Z* d S(J   s~   
Implementation of a flexible versioning scheme providing support for PEP-440,
setuptools-compatible and semantic versioning.
iÿÿÿÿNi   (   t   string_types(   t   parse_requirementt   NormalizedVersiont   NormalizedMatchert   LegacyVersiont   LegacyMatchert   SemanticVersiont   SemanticMatchert   UnsupportedVersionErrort
   get_schemec           B   s   e  Z d  Z RS(   s   This is an unsupported version.(   t   __name__t
   __module__t   __doc__(    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR      s   t   Versionc           B   sƒ   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z e d „  ƒ Z RS(   c         C   sZ   | j  ƒ  |  _ } |  j | ƒ |  _ } t | t ƒ s> t ‚ t | ƒ d k sV t ‚ d  S(   Ni    (   t   stript   _stringt   parset   _partst
   isinstancet   tuplet   AssertionErrort   len(   t   selft   st   parts(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __init__   s    c         C   s   t  d ƒ ‚ d  S(   Ns   please implement in a subclass(   t   NotImplementedError(   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   %   s    c         C   s5   t  |  ƒ t  | ƒ k r1 t d |  | f ƒ ‚ n  d  S(   Ns   cannot compare %r and %r(   t   typet	   TypeError(   R   t   other(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _check_compatible(   s    c         C   s   |  j  | ƒ |  j | j k S(   N(   R   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __eq__,   s    c         C   s   |  j  | ƒ S(   N(   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __ne__0   s    c         C   s   |  j  | ƒ |  j | j k  S(   N(   R   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __lt__3   s    c         C   s   |  j  | ƒ p |  j | ƒ S(   N(   R!   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __gt__7   s    c         C   s   |  j  | ƒ p |  j | ƒ S(   N(   R!   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __le__:   s    c         C   s   |  j  | ƒ p |  j | ƒ S(   N(   R"   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __ge__=   s    c         C   s   t  |  j ƒ S(   N(   t   hashR   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __hash__A   s    c         C   s   d |  j  j |  j f S(   Ns   %s('%s')(   t	   __class__R
   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __repr__D   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   __str__G   s    c         C   s   t  d ƒ ‚ d  S(   Ns   Please implement in subclasses.(   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   is_prereleaseJ   s    (   R
   R   R   R   R   R   R    R!   R"   R#   R$   R&   R(   R)   t   propertyR*   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR      s   												t   Matcherc           B   sÄ   e  Z d Z i d  „  d 6d „  d 6d „  d 6d „  d 6d „  d	 6d
 „  d 6d „  d 6d „  d 6Z d „  Z d „  Z d „  Z e d „  ƒ Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s
   |  | k  S(   N(    (   t   vt   ct   p(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   <lambda>T   t    t   <c         C   s
   |  | k S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   U   R1   t   >c         C   s   |  | k p |  | k  S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   V   R1   s   <=c         C   s   |  | k p |  | k S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   W   R1   s   >=c         C   s
   |  | k S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   X   R1   s   ==c         C   s
   |  | k S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   Y   R1   s   ===c         C   s   |  | k p |  | k S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   [   R1   s   ~=c         C   s
   |  | k S(   N(    (   R-   R.   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   \   R1   s   !=c         C   s
   t  | ƒ S(   N(   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   a   s    c         C   s1  |  j  d  k r t d ƒ ‚ n  | j ƒ  |  _ } |  j | ƒ } | sY t d | ƒ ‚ n  | j |  _ |  j j ƒ  |  _ g  } | j	 rx• | j	 D]‡ \ } } | j
 d ƒ rë | d k rÊ t d | ƒ ‚ n  | d  t } } |  j  | ƒ n |  j  | ƒ t } } | j | | | f ƒ q Wn  t | ƒ |  _ d  S(	   Ns   Please specify a version classs   Not valid: %rs   .*s   ==s   !=s#   '.*' not allowed for %r constraintsiþÿÿÿ(   s   ==s   !=(   t   version_classt   Nonet
   ValueErrorR   R   R   t   namet   lowert   keyt   constraintst   endswitht   Truet   Falset   appendR   R   (   R   R   t   rt   clistt   opt   vnt   prefix(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   d   s(    	c         C   s¶   t  | t ƒ r! |  j | ƒ } n  xŽ |  j D]ƒ \ } } } |  j j | ƒ } t  | t ƒ rm t |  | ƒ } n  | s˜ d | |  j j f } t	 | ƒ ‚ n  | | | | ƒ s+ t
 Sq+ Wt S(   sÉ   
        Check if the provided version matches the constraints.

        :param version: The version to match against this instance.
        :type version: String or :class:`Version` instance.
        s   %r not implemented for %s(   R   R    R4   R   t
   _operatorst   gett   getattrR'   R
   R   R=   R<   (   R   t   versiont   operatort
   constraintRC   t   ft   msg(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   match   s    c         C   sJ   d  } t |  j ƒ d k rF |  j d d d k rF |  j d d } n  | S(   Ni   i    s   ==s   ===(   s   ==s   ===(   R5   R   R   (   R   t   result(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   exact_version–   s    ,c         C   sG   t  |  ƒ t  | ƒ k s* |  j | j k rC t d |  | f ƒ ‚ n  d  S(   Ns   cannot compare %s and %s(   R   R7   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR      s    *c         C   s/   |  j  | ƒ |  j | j k o. |  j | j k S(   N(   R   R9   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   ¡   s    c         C   s   |  j  | ƒ S(   N(   R   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR    ¥   s    c         C   s   t  |  j ƒ t  |  j ƒ S(   N(   R%   R9   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR&   ©   s    c         C   s   d |  j  j |  j f S(   Ns   %s(%r)(   R'   R
   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR(   ¬   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR)   ¯   s    N(   R
   R   R5   R4   RD   R   R   RL   R+   RN   R   R   R    R&   R(   R)   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR,   O   s(   






								sk   ^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c         C   sK  |  j  ƒ  }  t j |  ƒ } | s4 t d |  ƒ ‚ n  | j ƒ  } t d „  | d j d ƒ Dƒ ƒ } x0 t | ƒ d k r• | d d k r• | d  } qf W| d s© d } n t | d ƒ } | d d !} | d	 d
 !} | d d !} | d } | d k rÿ d } n | d t | d ƒ f } | d k r.d } n | d t | d ƒ f } | d k r]d } n | d t | d ƒ f } | d  k rŒd } nf g  }	 xQ | j d ƒ D]@ }
 |
 j
 ƒ  rÉd t |
 ƒ f }
 n d |
 f }
 |	 j |
 ƒ q¢Wt |	 ƒ } | s| r| rd } qd } n  | s&d } n  | s5d } n  | | | | | | f S(   Ns   Not a valid version: %sc         s   s   |  ] } t  | ƒ Vq d  S(   N(   t   int(   t   .0R-   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pys	   <genexpr>¾   s    i   t   .iÿÿÿÿi    i   i   i   i	   i
   i   i   t   at   zt   _t   final(   NN(    (   NN(    (   NN(    (    (   RR   iÿÿÿÿ(   RS   (   RT   (   RU   (   R   t   PEP440_VERSION_RERL   R   t   groupsR   t   splitR   RO   R5   t   isdigitR>   (   R   t   mRW   t   numst   epocht   pret   postt   devt   localR   t   part(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _pep_440_key¸   sT    #%
	
								c           B   sA   e  Z d  Z d „  Z e d d d d d g ƒ Z e d „  ƒ Z RS(   sI  A rational version.

    Good:
        1.2         # equivalent to "1.2.0"
        1.2.0
        1.2a1
        1.2.3a2
        1.2.3b1
        1.2.3c1
        1.2.3.4
        TODO: fill this out

    Bad:
        1           # minimum two numbers
        1.2a        # release level must have a release serial
        1.2.3b
    c         C   sQ   t  | ƒ } t j | ƒ } | j ƒ  } t d „  | d j d ƒ Dƒ ƒ |  _ | S(   Nc         s   s   |  ] } t  | ƒ Vq d  S(   N(   RO   (   RP   R-   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pys	   <genexpr>  s    i   RQ   (   t   _normalized_keyRV   RL   RW   R   RX   t   _release_clause(   R   R   RM   RZ   RW   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   
  s
    &RR   t   bR.   t   rcR_   c            s   t  ‡  f d †  ˆ  j Dƒ ƒ S(   Nc         3   s(   |  ] } | r | d  ˆ  j  k Vq d S(   i    N(   t   PREREL_TAGS(   RP   t   t(   R   (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pys	   <genexpr>  s    (   t   anyR   (   R   (    (   R   s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR*     s    (   R
   R   R   R   t   setRg   R+   R*   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   ø   s   	c         C   sU   t  |  ƒ }  t  | ƒ } |  | k r( t S|  j | ƒ s; t St | ƒ } |  | d k S(   NRQ   (   t   strR<   t
   startswithR=   R   (   t   xt   yt   n(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _match_prefix  s    c           B   s   e  Z e Z i d  d 6d d 6d d 6d d 6d d	 6d
 d 6d d 6d d 6Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z RS(   t   _match_compatibles   ~=t	   _match_ltR2   t	   _match_gtR3   t	   _match_les   <=t	   _match_ges   >=t	   _match_eqs   ==t   _match_arbitrarys   ===t	   _match_nes   !=c         C   sx   | r" d | k o | j  d } n | j  d o: | j  d } | rn | j j d d ƒ d } |  j | ƒ } n  | | f S(   Nt   +iÿÿÿÿi   i    (   R   R   RX   R4   (   R   RG   RI   RC   t   strip_localR   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _adjust_local6  s    c         C   sj   |  j  | | | ƒ \ } } | | k r+ t S| j } d j g  | D] } t | ƒ ^ qA ƒ } t | | ƒ S(   NRQ   (   R{   R=   Rd   t   joinRk   Rp   (   R   RG   RI   RC   t   release_clauset   it   pfx(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRr   D  s    	(c         C   sj   |  j  | | | ƒ \ } } | | k r+ t S| j } d j g  | D] } t | ƒ ^ qA ƒ } t | | ƒ S(   NRQ   (   R{   R=   Rd   R|   Rk   Rp   (   R   RG   RI   RC   R}   R~   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRs   L  s    	(c         C   s%   |  j  | | | ƒ \ } } | | k S(   N(   R{   (   R   RG   RI   RC   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRt   T  s    c         C   s%   |  j  | | | ƒ \ } } | | k S(   N(   R{   (   R   RG   RI   RC   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRu   X  s    c         C   sC   |  j  | | | ƒ \ } } | s0 | | k } n t | | ƒ } | S(   N(   R{   Rp   (   R   RG   RI   RC   RM   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRv   \  s
    c         C   s   t  | ƒ t  | ƒ k S(   N(   Rk   (   R   RG   RI   RC   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRw   d  s    c         C   sD   |  j  | | | ƒ \ } } | s0 | | k } n t | | ƒ } | S(   N(   R{   Rp   (   R   RG   RI   RC   RM   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRx   g  s
    c         C   s˜   |  j  | | | ƒ \ } } | | k r+ t S| | k  r; t S| j } t | ƒ d k rc | d  } n  d j g  | D] } t | ƒ ^ qp ƒ } t | | ƒ S(   Ni   iÿÿÿÿRQ   (   R{   R<   R=   Rd   R   R|   Rk   Rp   (   R   RG   RI   RC   R}   R~   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRq   o  s    	((   R
   R   R   R4   RD   R{   Rr   Rs   Rt   Ru   Rv   Rw   Rx   Rq   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   '  s&   
								s   [.+-]$R1   s   ^[.](\d)s   0.\1s   ^[.-]s
   ^\((.*)\)$s   \1s   ^v(ersion)?\s*(\d+)s   \2s   ^r(ev)?\s*(\d+)s   [.]{2,}RQ   s   \b(alfa|apha)\bt   alphas   \b(pre-alpha|prealpha)\bs	   pre.alphas	   \(beta\)$t   betas
   ^[:~._+-]+s
   [,*")([\]]s   [~:+_ -]s   \.$s   (\d+(\.\d+)*)c   	      C   sé  |  j  ƒ  j ƒ  } x& t D] \ } } | j | | ƒ } q W| sJ d } n  t j | ƒ } | sn d } | } nû | j ƒ  d j d ƒ } g  | D] } t | ƒ ^ qŽ } x# t	 | ƒ d k  rË | j
 d ƒ q© Wt	 | ƒ d k rñ | | j ƒ  } nD d j g  | d D] } t | ƒ ^ qƒ | | j ƒ  } | d  } d j g  | D] } t | ƒ ^ qBƒ } | j  ƒ  } | r›x) t D] \ } } | j | | ƒ } qvWn  | sª| } n& d | k r¼d n d } | | | } t | ƒ såd } n  | S(	   s€   
    Try to suggest a semantic form for a version for which
    _suggest_normalized_version couldn't come up with anything.
    s   0.0.0i    RQ   i   R_   t   -Ry   N(   R   R8   t   _REPLACEMENTSt   subt   _NUMERIC_PREFIXRL   RW   RX   RO   R   R>   t   endR|   Rk   t   _SUFFIX_REPLACEMENTSt	   is_semverR5   (	   R   RM   t   patt   replRZ   RC   t   suffixR~   t   sep(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _suggest_semantic_version–  s:    		:
(		c         C   s   y t  |  ƒ |  SWn t k
 r% n X|  j ƒ  } xS d2 d3 d4 d5 d6 d7 d8 d9 d: d; d< d= d> d? d@ f D] \ } } | j | | ƒ } qf Wt j d d | ƒ } t j d d | ƒ } t j d d | ƒ } t j d d | ƒ } t j d d | ƒ } | j d ƒ r| d  } n  t j d! d | ƒ } t j d" d# | ƒ } t j d$ d% | ƒ } t j d& d | ƒ } t j d' d( | ƒ } t j d) d( | ƒ } t j d* d
 | ƒ } t j d+ d, | ƒ } t j d- d% | ƒ } t j d. d/ | ƒ } t j d0 d1 | ƒ } y t  | ƒ Wn t k
 rdA } n X| S(B   sè  Suggest a normalized version close to the given version string.

    If you have a version string that isn't rational (i.e. NormalizedVersion
    doesn't like it) then you might be able to get an equivalent (or close)
    rational version from this function.

    This does a number of simple normalizations to the given string, based
    on observation of versions currently in use on PyPI. Given a dump of
    those version during PyCon 2009, 4287 of them:
    - 2312 (53.93%) match NormalizedVersion without change
      with the automatic suggestion
    - 3474 (81.04%) match when using this suggestion method

    @param s {str} An irrational version string.
    @returns A rational version string, or None, if couldn't determine one.
    s   -alphaRR   s   -betaRe   R€   R   Rf   R.   s   -finalR1   s   -pres   -releases   .releases   -stableRy   RQ   RT   t    s   .finalRU   s   pre$t   pre0s   dev$t   dev0s   ([abc]|rc)[\-\.](\d+)$s   \1\2s   [\-\.](dev)[\-\.]?r?(\d+)$s   .\1\2s   [.~]?([abc])\.?s   \1R-   i   s   \b0+(\d+)(?!\d)s   (\d+[abc])$s   \g<1>0s   \.?(dev-r|dev\.r)\.?(\d+)$s   .dev\2s   -(a|b|c)(\d+)$s   [\.\-](dev|devel)$s   .dev0s   (?![\.\-])dev$s   (final|stable)$s   \.?(r|-|-r)\.?(\d+)$s   .post\2s   \.?(dev|git|bzr)\.?(\d+)$s   \.?(pre|preview|-c)(\d+)$s   c\g<2>s   p(\d+)$s   .post\1(   s   -alphaRR   (   s   -betaRe   (   R€   RR   (   R   Re   (   Rf   R.   (   s   -finalR1   (   s   -preR.   (   s   -releaseR1   (   s   .releaseR1   (   s   -stableR1   (   Ry   RQ   (   RT   RQ   (   RŽ   R1   (   s   .finalR1   (   RU   R1   N(   Rc   R   R8   t   replacet   reR„   Rl   R5   (   R   t   rst   origRŠ   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _suggest_normalized_versionÄ  sH    
			
s   ([a-z]+|\d+|[\.-])R.   R]   t   previews   final-R‚   Rf   t   @R_   c         C   s¬   d „  } g  } x | |  ƒ D]‚ } | j  d ƒ r‘ | d k  rg x' | rc | d d k rc | j ƒ  q@ Wn  x' | r | d d k r | j ƒ  qj Wn  | j | ƒ q Wt | ƒ S(   Nc         S   s›   g  } x t  j |  j ƒ  ƒ D]j } t j | | ƒ } | r d | d  k oU d k n rl | j d ƒ } n
 d | } | j | ƒ q q W| j d ƒ | S(   Nt   0i   t   9i   t   *s   *final(   t   _VERSION_PARTRX   R8   t   _VERSION_REPLACERE   t   zfillR>   (   R   RM   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt	   get_partsC  s     
Rš   s   *finaliÿÿÿÿs   *final-t   00000000(   Rl   t   popR>   R   (   R   Rž   RM   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _legacy_keyB  s    	c           B   s    e  Z d  „  Z e d „  ƒ Z RS(   c         C   s
   t  | ƒ S(   N(   R¡   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   ]  s    c         C   sR   t  } xE |  j D]: } t | t ƒ r | j d ƒ r | d k  r t } Pq q W| S(   NRš   s   *final(   R=   R   R   R    Rl   R<   (   R   RM   Rm   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR*   `  s    (   R
   R   R   R+   R*   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   \  s   	c           B   s?   e  Z e Z e e j ƒ Z d  e d <e j d ƒ Z	 d „  Z
 RS(   Rq   s   ~=s   ^(\d+(\.\d+)*)c         C   s‡   | | k  r t  S|  j j t | ƒ ƒ } | sE t j d | | ƒ t S| j ƒ  d } d | k rz | j d d ƒ d } n  t	 | | ƒ S(   NsA   Cannot compute compatible match for version %s  and constraint %si    RQ   i   (
   R=   t
   numeric_reRL   Rk   t   loggert   warningR<   RW   t   rsplitRp   (   R   RG   RI   RC   RZ   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRq   s  s    	
(   R
   R   R   R4   t   dictR,   RD   R’   t   compileR¢   Rq   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   k  s
   
sN   ^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$c         C   s   t  j |  ƒ S(   N(   t
   _SEMVER_RERL   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyRˆ   ‰  s    c   
      C   sŸ   d „  } t  |  ƒ } | s* t |  ƒ ‚ n  | j ƒ  } g  | d  D] } t | ƒ ^ qA \ } } } | | d d ƒ | | d d ƒ } }	 | | | f | |	 f S(   Nc         S   si   |  d  k r | f } nM |  d j d ƒ } t g  | D]' } | j ƒ  rV | j d ƒ n | ^ q5 ƒ } | S(   Ni   RQ   i   (   R5   RX   R   RY   R   (   R   t   absentRM   R   R/   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt
   make_tupleŽ  s
    :i   t   |i   Rš   (   Rˆ   R   RW   RO   (
   R   Rª   RZ   RW   R~   t   majort   minort   patchR]   t   build(    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   _semantic_key  s    	
,'c           B   s    e  Z d  „  Z e d „  ƒ Z RS(   c         C   s
   t  | ƒ S(   N(   R°   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   £  s    c         C   s   |  j  d d d k S(   Ni   i    R«   (   R   (   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR*   ¦  s    (   R
   R   R   R+   R*   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   ¢  s   	c           B   s   e  Z e Z RS(    (   R
   R   R   R4   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   «  s   t   VersionSchemec           B   s8   e  Z d d  „ Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  | |  _ | |  _ d  S(   N(   R9   t   matchert	   suggester(   R   R9   R²   R³   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR   °  s    		c         C   s8   y |  j  j | ƒ t } Wn t k
 r3 t } n X| S(   N(   R²   R4   R<   R   R=   (   R   R   RM   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   is_valid_versionµ  s    

c         C   s5   y |  j  | ƒ t } Wn t k
 r0 t } n X| S(   N(   R²   R<   R   R=   (   R   R   RM   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   is_valid_matcher½  s    

c         C   s   |  j  d | ƒ S(   s:   
        Used for processing some metadata fields
        s   dummy_name (%s)(   Rµ   (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   is_valid_constraint_listÅ  s    c         C   s+   |  j  d  k r d  } n |  j  | ƒ } | S(   N(   R³   R5   (   R   R   RM   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   suggestË  s    	N(   R
   R   R5   R   R´   Rµ   R¶   R·   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR±   ¯  s
   			t
   normalizedc         C   s   | S(   N(    (   R   R   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR0   Õ  R1   t   legacyt   semantict   defaultc         C   s'   |  t  k r t d |  ƒ ‚ n  t  |  S(   Ns   unknown scheme name: %r(   t   _SCHEMESR6   (   R7   (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyR	   Ý  s    (+   R   t   loggingR’   t   compatR    t   utilR   t   __all__t	   getLoggerR
   R£   R6   R   t   objectR   R,   R§   RV   Rb   Rc   R   Rp   R   Rƒ   R‡   R…   R   R•   t   IR›   R5   Rœ   R¡   R   R   R¨   Rˆ   R°   R   R   R±   R¼   R	   (    (    (    s8   /tmp/pip-build-UPPWic/pip/pip/_vendor/distlib/version.pyt   <module>	   s€   1d	=$	W	.	r
					#	
	