abc@`s<ddlmZmZmZddlZddlZddlZddlZddlm Z m Z ddl m Z m Z mZdefdYZde ejefd YZd efd YZd efd YZdZdefdYZejdZdZdZdefdYZdS(i(tabsolute_importtdivisiontprint_functionNi(t string_typestwith_metaclass(tVersiont LegacyVersiontparsetInvalidSpecifiercB`seZdZRS(sH An invalid specifier was found, users should refer to PEP 440. (t__name__t __module__t__doc__(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRst BaseSpecifiercB`seZejdZejdZejdZejdZejdZ e j dZ ejddZ ejddZ RS( cC`sdS(s Returns the str representation of this Specifier like object. This should be representative of the Specifier itself. N((tself((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__str__tcC`sdS(sF Returns a hash value for this Specifier like object. N((R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__hash__RcC`sdS(sq Returns a boolean representing whether or not the two Specifier like objects are equal. N((R tother((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__eq__$RcC`sdS(su Returns a boolean representing whether or not the two Specifier like objects are not equal. N((R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__ne__+RcC`sdS(sg Returns whether or not pre-releases as a whole are allowed by this specifier. N((R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt prereleases2RcC`sdS(sd Sets whether or not pre-releases as a whole are allowed by this specifier. N((R tvalue((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR9RcC`sdS(sR Determines if the given item is contained within this specifier. N((R titemR((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pytcontains@RcC`sdS(s Takes an iterable of items and filters them so that only items which are contained within this specifier are allowed in it. N((R titerableR((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pytfilterFRN(R R tabctabstractmethodRRRRtabstractpropertyRtsettertNoneRR(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR st_IndividualSpecifiercB`seZiZdddZdZdZdZdZdZ dZ dZ e d Z e d Ze d Zejd Zd ZddZddZRS(RcC`sj|jj|}|s0tdj|n|jdj|jdjf|_||_dS(NsInvalid specifier: '{0}'toperatortversion(t_regextsearchRtformattgrouptstript_spect _prereleases(R tspecRtmatch((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__init__Rs cC`sF|jdk r!dj|jnd}dj|jjt||S(Ns, prereleases={0!r}Rs<{0}({1!r}{2})>(R(RR$Rt __class__R tstr(R tpre((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__repr___s !  cC`sdj|jS(Ns{0}{1}(R$R'(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRlscC`s t|jS(N(thashR'(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRoscC`s`t|tr:y|j|}WqPtk r6tSXnt||jsPtS|j|jkS(N(t isinstanceRR,RtNotImplementedR'(R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRrs cC`s`t|tr:y|j|}WqPtk r6tSXnt||jsPtS|j|jkS(N(R1RR,RR2R'(R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR}s cC`st|dj|j|S(Ns _compare_{0}(tgetattrR$t _operators(R top((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt _get_operatorscC`s(t|ttfs$t|}n|S(N(R1RRR(R R!((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_coerce_versionscC`s |jdS(Ni(R'(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR scC`s |jdS(Ni(R'(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR!scC`s|jS(N(R((R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRscC`s ||_dS(N(R((R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRscC`s |j|S(N(R(R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt __contains__scC`sW|dkr|j}n|j|}|jr;| r;tS|j|j||jS(N(RRR7t is_prereleasetFalseR6R R!(R RR((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs   cc`st}g}i|dk r!|ntd6}xf|D]^}|j|}|j||r2|jr|pn|j r|j|qt}|Vq2q2W| r|rx|D] }|VqWndS(NR(R:RtTrueR7RR9Rtappend(R RRtyieldedtfound_prereleasestkwR!tparsed_version((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs     N(R R R4RR+R/RRRRR6R7tpropertyR R!RRR8RR(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRNs       tLegacySpecifiercB`seZdZejdedejejBZidd6dd6dd6d d 6d d 6d d6ZdZ dZ dZ dZ dZ dZdZRS(s (?P(==|!=|<=|>=|<|>)) \s* (?P [^,;\s)]* # Since this is a "legacy" specifier, and the version # string can be just about anything, we match everything # except for whitespace, a semi-colon for marker support, # a closing paren since versions can be enclosed in # them, and a comma since it's a version separator. ) s^\s*s\s*$tequals==t not_equals!=tless_than_equals<=tgreater_than_equals>=t less_thantcC`s(t|ts$tt|}n|S(N(R1RR-(R R!((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR7scC`s||j|kS(N(R7(R t prospectiveR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_equalscC`s||j|kS(N(R7(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_not_equalscC`s||j|kS(N(R7(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_less_than_equalscC`s||j|kS(N(R7(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_greater_than_equalscC`s||j|kS(N(R7(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_less_thanscC`s||j|kS(N(R7(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_greater_thans(R R t _regex_strtretcompiletVERBOSEt IGNORECASER"R4R7RLRMRNRORPRQ(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRBs"        c`s"tjfd}|S(Nc`s#t|tstS|||S(N(R1RR:(R RKR)(tfn(sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pytwrapped s(t functoolstwraps(RWRX((RWsD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_require_version_compare st SpecifiercB`seZdZejdedejejBZidd6dd6dd6d d 6d d 6d d6dd6dd6Ze dZ e dZ e dZ e dZ e dZe dZe dZdZedZejdZRS(s (?P(~=|==|!=|<=|>=|<|>|===)) (?P (?: # The identity operators allow for an escape hatch that will # do an exact string match of the version you wish to install. # This will not be parsed by PEP 440 and we cannot determine # any semantic meaning from it. This operator is discouraged # but included entirely as an escape hatch. (?<====) # Only match for the identity operator \s* [^\s]* # We just match everything, except for whitespace # since we are only testing for strict identity. ) | (?: # The (non)equality operators allow for wild card and local # versions to be specified so we have to define these two # operators separately to enable that. (?<===|!=) # Only match for equals and not equals \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)* # release (?: # pre release [-_\.]? (a|b|c|rc|alpha|beta|pre|preview) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? # You cannot use a wild card and a dev or local version # together so group them with a | and make them optional. (?: (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local | \.\* # Wild card syntax of .* )? ) | (?: # The compatible operator requires at least two digits in the # release segment. (?<=~=) # Only match for the compatible operator \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)+ # release (We have a + instead of a *) (?: # pre release [-_\.]? (a|b|c|rc|alpha|beta|pre|preview) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release ) | (?: # All other operators only allow a sub set of what the # (non)equality operators do. Specifically they do not allow # local versions to be specified nor do they allow the prefix # matching wild cards. (?=RGRHRIRJt arbitrarys===cC`sfdjttjdt|d }|d7}|jd||oe|jd||S(Nt.cS`s|jd o|jd S(Ntposttdev(t startswith(tx((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pytsis.*s>=s==(tjointlistt itertoolst takewhilet_version_splitR6(R RKR)tprefix((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_compatibles   cC`s|jdrht|j}t|d }tt|}|t| }t||\}}n't|}|jst|j}n||kS(Ns.*i(tendswithRtpublicRiR-tlent _pad_versiontlocal(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRLs  cC`s|j|| S(N(RL(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRMscC`s|t|kS(N(R(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRNscC`s|t|kS(N(R(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyROscC`sXt|}||kstS|j rT|jrTt|jt|jkrTtSntS(N(RR:R9t base_versionR;(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRPs  cC`st|}||kstS|j rT|jrTt|jt|jkrTtSn|jdk rt|jt|jkrtSntS(N(RR:tis_postreleaseRqRpRR;(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRQs  cC`s"t|jt|jkS(N(R-tlower(R RKR)((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_arbitraryscC`ss|jdk r|jS|j\}}|dkro|dkrY|jdrY|d }nt|jrotSntS( Ns==s>=s<=s~=s===s.*i(s==s>=s<=s~=s===(R(RR'RlRR9R;R:(R R R!((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs  cC`s ||_dS(N(R((R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs(R R RRRSRTRURVR"R4R[RkRLRMRNRORPRQRtRARR(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR\s,^ # s^([0-9]+)((?:a|b|c|rc)[0-9]+)$cC`s\g}xO|jdD]>}tj|}|rG|j|jq|j|qW|S(NR_(tsplitt _prefix_regexR#textendtgroupsR<(R!tresultRR*((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRi'sc C`sgg}}|jttjd||jttjd||j|t|d|j|t|d|jddgtdt|dt|d|jddgtdt|dt|dttj|ttj|fS(NcS`s |jS(N(tisdigit(Rc((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRd6RcS`s |jS(N(Rz(Rc((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRd7Riit0(R<RfRgRhRntinserttmaxtchain(tlefttrightt left_splitt right_split((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRo2s ""//t SpecifierSetcB`seZdddZdZdZdZdZdZdZ dZ d Z e d Z e jd Z d Zdd ZddZRS(RcC`sg|jdD]}|jr|j^q}t}xL|D]D}y|jt|WqDtk r|jt|qDXqDWt||_||_ dS(Nt,( RuR&tsettaddR\RRBt frozensett_specsR((R t specifiersRtstparsedt specifier((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR+Os4   cC`s=|jdk r!dj|jnd}djt||S(Ns, prereleases={0!r}Rs(R(RR$RR-(R R.((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR/ds!cC`s djtd|jDS(NRcs`s|]}t|VqdS(N(R-(t.0R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pys ns(RetsortedR(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRmscC`s t|jS(N(R0R(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRpscC`st|trt|}nt|ts1tSt}t|j|jB|_|jdkr|jdk r|j|_nZ|jdk r|jdkr|j|_n-|j|jkr|j|_n td|S(NsFCannot combine SpecifierSets with True and False prerelease overrides.( R1RRR2RRR(Rt ValueError(R RR((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__and__ss  cC`set|trt|}n7t|trBtt|}nt|tsUtS|j|jkS(N(R1RRRR-R2R(R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRscC`set|trt|}n7t|trBtt|}nt|tsUtS|j|jkS(N(R1RRRR-R2R(R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRscC`s t|jS(N(RnR(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__len__scC`s t|jS(N(titerR(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyt__iter__scC`s:|jdk r|jS|js#dStd|jDS(Ncs`s|]}|jVqdS(N(R(RR((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pys s(R(RRtany(R ((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs  cC`s ||_dS(N(R((R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRscC`s |j|S(N(R(R R((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyR8sc`sptttfs$tndkr<|jn rPjrPtStfd|j DS(Nc3`s$|]}|jdVqdS(RN(R(RR(RR(sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pys s( R1RRRRRR9R:tallR(R RR((RRsD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs  cC`s |dkr|j}n|jrTx,|jD]!}|j|dt|}q+W|Sg}g}x|D]{}t|ttfst|}n|}t|trqgn|j r| r|s|j |qqg|j |qgW| r|r|dkr|S|SdS(NR( RRRRtboolR1RRRR9R<(R RRR)tfilteredR>RR@((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRs*    N(R R RR+R/RRRRRRRRARRR8RR(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyRMs       (t __future__RRRRRYRgRSt_compatRRR!RRRRRtABCMetatobjectR RRBR[R\RTRvRiRoR(((sD/usr/lib/python2.7/site-packages/pip/_vendor/packaging/specifiers.pyts"    "94