ó •abc @srdZddlZddlZddlmZddddd d d d gZejeƒZd e fd „ƒYZ de fd„ƒYZ de fd„ƒYZ ejdƒZd„ZeZde fd„ƒYZd„Zde fd„ƒYZejdƒdfejdƒdfejdƒdfejdƒdfejdƒdfejd ƒdfejd!ƒd"fejd#ƒd$fejd%ƒd&fejd'ƒd(ff Zejd)ƒdfejd*ƒdfejd+ƒd"fejd!ƒd"fejd,ƒdffZejd-ƒZd.„Zd/„Zejd0ejƒZid1d26d1d36d4d56d1d66d7d86dd6dd"6Zd9„Zde fd:„ƒYZde fd;„ƒYZ ejd<ejƒZ!d=„Z"d>„Z#d e fd?„ƒYZ$d e fd@„ƒYZ%dAe fdB„ƒYZ&ie&eeeƒdC6e&ee dD„ƒdE6e&e#e%eƒdF6Z'e'dCe'dG=|<|>|!=|={2,3}|~=)?\s*([^\s,]+)$s ^\d+(\.\d+)*$cCs ||kS(N((tvtctp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytWttcCs||kp||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+YR,s<=cCs||kp||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+ZR,s>=cCs ||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+[R,s==cCs ||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+\R,s===cCs||kp||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+^R,s~=cCs ||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+_R,s!=c CsÚ|jdkrtdƒ‚n|jƒ|_}|jj|ƒ}|s\td|ƒ‚n|jdƒ}|djƒ|_|jj ƒ|_ g}|drÇg|dj dƒD]}|jƒ^q´}xø|D]í}|j j|ƒ}|s td||fƒ‚n|jƒ}|dp#d}|d }|j d ƒr”|dkr^td |ƒ‚n|d t}} |jj|ƒsª|j|ƒqªn|j|ƒt}} |j||| fƒqÓWnt|ƒ|_dS(NsPlease specify a version classs Not valid: %rR,iit,sInvalid %r in %rs~=is.*s==s!=s#'.*' not allowed for %r constraintsiþÿÿÿ(s==s!=(t version_classtNonet ValueErrorR Rtdist_retmatchtgroupstnametlowertkeytsplittcomp_retendswithtTruetnum_retFalsetappendttupleR( RRtmR5tclistR)t constraintstoptvntprefix((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRbs: ,     cCs¶t|tƒr!|j|ƒ}nxŽ|jD]ƒ\}}}|jj|ƒ}t|tƒrmt||ƒ}n|s˜d||jjf}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( t isinstanceRR0Rt _operatorstgettgetattrR"R RR>R<(Rtversiontoperatort constraintRFtftmsg((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR4‡scCsJd}t|jƒdkrF|jdddkrF|jdd}n|S(Niis==s===(s==s===(R1tlenR(Rtresult((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt exact_versionœs,cCsGt|ƒt|ƒks*|j|jkrCtd||fƒ‚ndS(Nscannot compare %s and %s(RR6R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR£s*cCs/|j|ƒ|j|jko.|j|jkS(N(RR8R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR§s cCs|j|ƒ S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR«scCst|jƒt|jƒS(N(R R8R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR!¯scCsd|jj|jfS(Ns%s(%r)(R"R R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR#²scCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR$µsN(R R R1R0tretcompileR3R:R=RHRR4R&RRRRRR!R#R$(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR'Ns,         %      sk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c CsK|jƒ}tj|ƒ}|s4td|ƒ‚n|jƒ}td„|djdƒDƒƒ}x0t|ƒdkr•|ddkr•|d }qfW|ds©d}nt|dƒ}|dd!}|d d !}|d d !}|d }|dkrÿd}n|dt|dƒf}|dkr.d}n|dt|dƒf}|dkr]d}n|dt|dƒf}|dkrŒd}nfg} xQ|jdƒD]@} | j ƒrÉdt| ƒf} n d| f} | j | ƒq¢Wt| ƒ}|s| r|rd}qd}n|s&d}n|s5d}n||||||fS(NsNot a valid version: %scss|]}t|ƒVqdS(N(tint(t.0R(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys Äsit.iÿÿÿÿiiiii i i i tatzt_tfinal(NN((NN((NN(((RXiÿÿÿÿ(RY(RZ(R[( R tPEP440_VERSION_RER4RR5R@R9RPRUR1tisdigitR?( RRAR5tnumstepochtpretposttdevtlocalRtpart((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _pep_440_key¾sT  #%                      cBsAeZdZd„ZedddddgƒZed„ƒZRS(sIA 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 cCsQt|ƒ}tj|ƒ}|jƒ}td„|djdƒDƒƒ|_|S(Ncss|]}t|ƒVqdS(N(RU(RVR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys siRW(t_normalized_keyR\R4R5R@R9t_release_clause(RRRQRAR5((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs   &RXtbR)trcRbcst‡fd†ˆjDƒƒS(Nc3s(|]}|r|dˆjkVqdS(iN(t PREREL_TAGS(RVtt(R(s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys s(tanyR(R((Rs?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%s(R R R RtsetRjR&R%(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRþs cCsUt|ƒ}t|ƒ}||kr(tS|j|ƒs;tSt|ƒ}||dkS(NRW(tstrR<t startswithR>RP(txtytn((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _match_prefix"s    cBseZeZidd6dd6dd6dd6dd 6d d 6d d 6dd6Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d„Z RS(t_match_compatibles~=t _match_ltR-t _match_gtR.t _match_les<=t _match_ges>=t _match_eqs==t_match_arbitrarys===t _match_nes!=cCsx|r"d|ko|jd}n|jd o:|jd}|rn|jjddƒd}|j|ƒ}n||fS(Nt+iÿÿÿÿii(RRR9R0(RRKRMRFt strip_localR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _adjust_local<scCsj|j|||ƒ\}}||kr+tS|j}djg|D]}t|ƒ^qAƒ}t||ƒ S(NRW(R~R>RgtjoinRnRs(RRKRMRFtrelease_clausetitpfx((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRuJs   (cCsj|j|||ƒ\}}||kr+tS|j}djg|D]}t|ƒ^qAƒ}t||ƒ S(NRW(R~R>RgRRnRs(RRKRMRFR€RR‚((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRvRs   (cCs%|j|||ƒ\}}||kS(N(R~(RRKRMRF((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRwZscCs%|j|||ƒ\}}||kS(N(R~(RRKRMRF((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRx^scCsC|j|||ƒ\}}|s0||k}nt||ƒ}|S(N(R~Rs(RRKRMRFRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRybs cCst|ƒt|ƒkS(N(Rn(RRKRMRF((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRzjscCsD|j|||ƒ\}}|s0||k}nt||ƒ }|S(N(R~Rs(RRKRMRFRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR{ms cCs˜|j|||ƒ\}}||kr+tS||kr;tS|j}t|ƒdkrc|d }ndjg|D]}t|ƒ^qpƒ}t||ƒS(NiiÿÿÿÿRW(R~R<R>RgRPRRnRs(RRKRMRFR€RR‚((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRtus    ((R R RR0RHR~RuRvRwRxRyRzR{Rt(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR-s&         s[.+-]$R,s^[.](\d)s0.\1s^[.-]s ^\((.*)\)$s\1s^v(ersion)?\s*(\d+)s\2s^r(ev)?\s*(\d+)s[.]{2,}RWs\b(alfa|apha)\btalphas\b(pre-alpha|prealpha)\bs pre.alphas \(beta\)$tbetas ^[:~._+-]+s [,*")([\]]s[~:+_ -]s\.$s (\d+(\.\d+)*)c Csé|jƒjƒ}x&tD]\}}|j||ƒ}qW|sJd}ntj|ƒ}|snd}|}nû|jƒdjdƒ}g|D]}t|ƒ^qŽ}x#t |ƒdkrË|j dƒq©Wt |ƒdkrñ||j ƒ}nDdj g|dD]}t |ƒ^qƒ||j ƒ}|d }dj g|D]}t |ƒ^qBƒ}|jƒ}|r›x)tD]\}}|j||ƒ}qvWn|sª|}n&d|kr¼dnd}|||}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. s0.0.0iRWiRbt-R|N(R R7t _REPLACEMENTStsubt_NUMERIC_PREFIXR4R5R9RURPR?tendRRnt_SUFFIX_REPLACEMENTSt is_semverR1( RRQtpattreplRARFtsuffixRtsep((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_suggest_semantic_versionœs:  : (    cCs yt|ƒ|SWntk r%nX|jƒ}xSd2d3d4d5d6d7d8d9d:d;d<d=d>d?d@fD]\}}|j||ƒ}qfWtjdd|ƒ}tjdd|ƒ}tjdd|ƒ}tjdd|ƒ}tjdd|ƒ}|jdƒr |d }ntjd!d|ƒ}tjd"d#|ƒ}tjd$d%|ƒ}tjd&d|ƒ}tjd'd(|ƒ}tjd)d(|ƒ}tjd*d |ƒ}tjd+d,|ƒ}tjd-d%|ƒ}tjd.d/|ƒ}tjd0d1|ƒ}yt|ƒWntk rdA}nX|S(Bsè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-alphaRXs-betaRhRƒR„RiR)s-finalR,s-pres-releases.releases-stableR|RWRZt s.finalR[spre$tpre0sdev$tdev0s([abc]|rc)[\-\.](\d+)$s\1\2s[\-\.](dev)[\-\.]?r?(\d+)$s.\1\2s[.~]?([abc])\.?s\1R(is\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+)$sc\g<2>sp(\d+)$s.post\1(s-alphaRX(s-betaRh(RƒRX(R„Rh(RiR)(s-finalR,(s-preR)(s-releaseR,(s.releaseR,(s-stableR,(R|RW(RZRW(R‘R,(s.finalR,(R[R,N(RfRR7treplaceRSR‡RoR1(RtrstorigR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_suggest_normalized_versionÊsH           s([a-z]+|\d+|[\.-])R)R`tpreviewsfinal-R…Rit@RbcCs¬d„}g}x||ƒD]‚}|jdƒr‘|dkrgx'|rc|ddkrc|jƒq@Wnx'|r|ddkr|jƒqjWn|j|ƒqWt|ƒS(NcSs›g}xtj|jƒƒD]j}tj||ƒ}|rd|d koUdknrl|jdƒ}n d|}|j|ƒqqW|jdƒ|S(Nt0it9it*s*final(t _VERSION_PARTR9R7t_VERSION_REPLACERItzfillR?(RRQR*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt get_partsIs   Rœs*finaliÿÿÿÿs*final-t00000000(RotpopR?R@(RR RQR*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _legacy_keyHs  cBs eZd„Zed„ƒZRS(cCs t|ƒS(N(R£(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRcscCsRt}xE|jD]:}t|tƒr|jdƒr|dkrt}PqqW|S(NRœs*final(R>RRGRRoR<(RRQRp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%fs (R R RR&R%(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRbs cBs?eZeZeejƒZdedt numeric_reR4RntloggertwarningR<R5trsplitRs(RRKRMRFRAR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRtys    ( R R RR0tdictR'RHRSRTR¤Rt(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRqs  sN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs tj|ƒS(N(t _SEMVER_RER4(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR‹sc CsŸd„}t|ƒ}|s*t|ƒ‚n|jƒ}g|d D]}t|ƒ^qA\}}}||ddƒ||ddƒ}} |||f|| fS(NcSsi|dkr|f}nM|djdƒ}tg|D]'}|jƒrV|jdƒn|^q5ƒ}|S(NiRWi(R1R9R@R]RŸ(RtabsentRQRR*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt make_tuple”s   :it|iRœ(R‹RR5RU( RR«RAR5RtmajortminortpatchR`tbuild((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _semantic_key“s  ,'cBs eZd„Zed„ƒZRS(cCs t|ƒS(N(R±(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR©scCs|jdddkS(NiiR¬(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%¬s(R R RR&R%(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR¨s cBseZeZRS((R R RR0(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR±st VersionSchemecBs8eZdd„Zd„Zd„Zd„Zd„ZRS(cCs||_||_||_dS(N(R8tmatchert suggester(RR8R³R´((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR¶s  cCs8y|jj|ƒt}Wntk r3t}nX|S(N(R³R0R<RR>(RRRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytis_valid_version»s    cCs5y|j|ƒt}Wntk r0t}nX|S(N(R³R<RR>(RRRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytis_valid_matcherÃs     cCs|jd|ƒS(s: Used for processing some metadata fields sdummy_name (%s)(R¶(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytis_valid_constraint_listËscCs+|jdkrd}n|j|ƒ}|S(N(R´R1(RRRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytsuggestÑs N(R R R1RRµR¶R·R¸(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR²µs     t normalizedcCs|S(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+ÛR,tlegacytsemantictdefaultcCs'|tkrtd|ƒ‚nt|S(Nsunknown scheme name: %r(t_SCHEMESR2(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRãs ()R tloggingRStcompatRt__all__t getLoggerR R¥R2RtobjectR R'RTR\ReRfRRsRR†RŠRˆRR—tIRR1RžR£RRR©R‹R±RRR²R½R(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt s~   1k =$ W  . r       #