Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyo

ó
“tÆ_c@`sÞddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZmZmZer ddlmZmZmZmZmZmZmZmZmZeeefZeeeefZeeege fZ!nd	e"fd
„ƒYZ#de
ej$e%ƒfd„ƒYZ&d
e&fd„ƒYZ'de'fd„ƒYZ(d„Z)de'fd„ƒYZ*ej+dƒZ,d„Z-d„Z.de&fd„ƒYZ/dS(i(tabsolute_importtdivisiontprint_functionNi(tstring_typestwith_metaclass(t
TYPE_CHECKING(tcanonicalize_version(tVersiont
LegacyVersiontparse(	tListtDicttUniontIterabletIteratortOptionaltCallabletTuplet	FrozenSettInvalidSpecifiercB`seZdZRS(sH
    An invalid specifier was found, users should refer to PEP 440.
    (t__name__t
__module__t__doc__(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR"st
BaseSpecifiercB`sžeZejd„ƒZejd„ƒZejd„ƒZejd„ƒZejd„ƒZ	e	j
d„ƒZ	ejdd„ƒZejdd„ƒZ
RS(	cC`sdS(sŽ
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        N((tself((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__str__)scC`sdS(sF
        Returns a hash value for this Specifier like object.
        N((R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__hash__1scC`sdS(sq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        N((Rtother((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__eq__8scC`sdS(su
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        N((RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__ne__@scC`sdS(sg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        N((R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pytprereleasesHscC`sdS(sd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        N((Rtvalue((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRPscC`sdS(sR
        Determines if the given item is contained within this specifier.
        N((RtitemR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pytcontainsXscC`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((RtiterableR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pytfilter_sN(RRtabctabstractmethodRRRRtabstractpropertyRtsettertNoneR!R#(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR(st_IndividualSpecifiercB`sËeZiZddd„Zd„Zd„Zed„ƒZd„Z	d„Z
d„Zd„Zd	„Z
ed
„ƒZed„ƒZed„ƒZejd
„ƒZd„Zdd„Zdd„ZRS(tcC`sj|jj|ƒ}|s0tdj|ƒƒ‚n|jdƒjƒ|jdƒjƒf|_||_dS(NsInvalid specifier: '{0}'toperatortversion(t_regextsearchRtformattgrouptstript_spect_prereleases(RtspecRtmatch((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__init__lscC`sF|jdk	r!dj|jƒnd}dj|jjt|ƒ|ƒS(Ns, prereleases={0!r}R*s<{0}({1!r}{2})>(R3R(R/Rt	__class__Rtstr(Rtpre((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__repr__zs!cC`sdj|jŒS(Ns{0}{1}(R/R2(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR„scC`s|jdt|jdƒfS(Nii(R2R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_canonical_specˆscC`s
t|jƒS(N(thashR;(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRscC`sft|tƒr@y|jt|ƒƒ}WqVtk
r<tSXnt||jƒsVtS|j|jkS(N(t
isinstanceRR7R8RtNotImplementedR;(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR‘s
cC`sft|tƒr@y|jt|ƒƒ}WqVtk
r<tSXnt||jƒsVtS|j|jkS(N(R=RR7R8RR>R2(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRs
cC`s#t|dj|j|ƒƒ}|S(Ns_compare_{0}(tgetattrR/t
_operators(Rtoptoperator_callable((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt
_get_operator©scC`s(t|ttfƒs$t|ƒ}n|S(N(R=RRR	(RR,((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_coerce_version°scC`s|jdS(Ni(R2(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR+¶scC`s|jdS(Ni(R2(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR,»scC`s|jS(N(R3(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRÀscC`s
||_dS(N(R3(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRÅscC`s
|j|ƒS(N(R!(RR ((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__contains__ÊscC`s]|dkr|j}n|j|ƒ}|jr;|r;tS|j|jƒ}|||jƒS(N(R(RRDt
is_prereleasetFalseRCR+R,(RR Rtnormalized_itemRB((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR!Îscc`s¾t}g}i|dk	r!|ntd6}xf|D]^}|j|ƒ}|j||r2|jr‚|pn|jr‚|j|ƒqt}|Vq2q2W|rº|rºx|D]}|Vq¨WndS(NR(RGR(tTrueRDR!RFRtappend(RR"Rtyieldedtfound_prereleasestkwR,tparsed_version((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR#äs
	

N(RRR@R(R6R:RtpropertyR;RRRRCRDR+R,RR'RER!R#(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR)hs"	
							tLegacySpecifiercB`s¡eZdZejdedejejBƒZidd6dd6dd6d	d
6dd6d
d6Zd„Z	d„Z
d„Zd„Zd„Z
d„Zd„ZRS(sÛ
        (?P<operator>(==|!=|<=|>=|<|>))
        \s*
        (?P<version>
            [^,;\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_thant<tgreater_thant>cC`s(t|tƒs$tt|ƒƒ}n|S(N(R=RR8(RR,((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRD scC`s||j|ƒkS(N(RD(RtprospectiveR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_equal&scC`s||j|ƒkS(N(RD(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_not_equal*scC`s||j|ƒkS(N(RD(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_less_than_equal.scC`s||j|ƒkS(N(RD(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_greater_than_equal2scC`s||j|ƒkS(N(RD(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_less_than6scC`s||j|ƒkS(N(RD(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_greater_than:s(RRt
_regex_strtretcompiletVERBOSEt
IGNORECASER-R@RDRZR[R\R]R^R_(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRPs $
						c`s"tjˆƒ‡fd†ƒ}|S(Nc`s#t|tƒstSˆ|||ƒS(N(R=RRG(RRYR4(tfn(sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pytwrappedCs(t	functoolstwraps(ReRf((ResQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_require_version_compare?st	SpecifiercB`seZdZejdedejejBƒZidd6dd6dd6d	d
6dd6d
d6dd6dd6Ze	d„ƒZ
e	d„ƒZe	d„ƒZe	d„ƒZ
e	d„ƒZe	d„ƒZe	d„ƒZd„Zed„ƒZejd„ƒZRS(s
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        (?P<version>
            (?:
                # 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.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.

                \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]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        s^\s*s\s*$t
compatibles~=RQs==RRs!=RSs<=RTs>=RURVRWRXt	arbitrarys===cC`sfdjttjd„t|ƒƒƒd ƒ}|d7}|jdƒ||ƒoe|jdƒ||ƒS(Nt.cS`s|jdƒo|jdƒS(Ntposttdev(t
startswith(tx((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt<lambda>Ésiÿÿÿÿs.*s>=s==(tjointlistt	itertoolst	takewhilet_version_splitRC(RRYR4tprefix((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_compatible¹s


$c	C`s¤|jdƒrot|jƒ}t|d ƒ}tt|ƒƒ}|t|ƒ }t||ƒ\}}||kSt|ƒ}|js–t|jƒ}n||kSdS(Ns.*iþÿÿÿ(tendswithRtpublicRwR8tlent_pad_versiontlocal(	RRYR4t
split_spectsplit_prospectivetshortened_prospectivetpadded_spectpadded_prospectivetspec_version((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRZÖs
	cC`s|j||ƒS(N(RZ(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR[ÿscC`st|jƒt|ƒkS(N(RR{(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR\scC`st|jƒt|ƒkS(N(RR{(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR]
scC`sXt|ƒ}||kstS|jrT|jrTt|jƒt|jƒkrTtSntS(N(RRGRFtbase_versionRI(RRYtspec_strR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR^scC`sŒt|ƒ}||kstS|jrT|jrTt|jƒt|jƒkrTtSn|jdk	rˆt|jƒt|jƒkrˆtSntS(N(RRGtis_postreleaseR…R~R(RI(RRYR†R4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR_1scC`s"t|ƒjƒt|ƒjƒkS(N(R8tlower(RRYR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt_compare_arbitraryRscC`ss|jdk	r|jS|j\}}|dkro|dkrY|jdƒrY|d }nt|ƒjrotSntS(	Ns==s>=s<=s~=s===s.*iþÿÿÿ(s==s>=s<=s~=s===(R3R(R2RzR	RFRIRG(RR+R,((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRVs
cC`s
||_dS(N(R3(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRps(RRR`RaRbRcRdR-R@RiRyRZR[R\R]R^R_R‰RORR'(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRjMs*]$
)		!	s^([0-9]+)((?:a|b|c|rc)[0-9]+)$cC`s\g}xO|jdƒD]>}tj|ƒ}|rG|j|jƒƒq|j|ƒqW|S(NRm(tsplitt
_prefix_regexR.textendtgroupsRJ(R,tresultR R5((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRwysc	C`sgg}}|jttjd„|ƒƒƒ|jttjd„|ƒƒƒ|j|t|dƒƒ|j|t|dƒƒ|jddgtdt|dƒt|dƒƒƒ|jddgtdt|dƒt|dƒƒƒttj|Œƒttj|ŒƒfS(NcS`s
|jƒS(N(tisdigit(Rq((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRrŠscS`s
|jƒS(N(R(Rq((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRr‹siit0(RJRtRuRvR|tinserttmaxtchain(tlefttrightt
left_splittright_split((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR}…s
""88tSpecifierSetcB`s¡eZddd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zed
„ƒZ
e
jd„ƒZ
d„Zdd
„Zdd„ZRS(R*cC`s¨g|jdƒD]}|jƒr|jƒ^q}tƒ}xL|D]D}y|jt|ƒƒWqDtk
r‡|jt|ƒƒqDXqDWt|ƒ|_||_	dS(Nt,(
RŠR1tsettaddRjRRPt	frozensett_specsR3(Rt
specifiersRtstsplit_specifierstparsedt	specifier((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR6™s4	

cC`s=|jdk	r!dj|jƒnd}djt|ƒ|ƒS(Ns, prereleases={0!r}R*s<SpecifierSet({0!r}{1})>(R3R(R/RR8(RR9((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR:°s!cC`s djtd„|jDƒƒƒS(NR™cs`s|]}t|ƒVqdS(N(R8(t.0RŸ((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pys	<genexpr>¼s(RstsortedR(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRºscC`s
t|jƒS(N(R<R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR¾scC`sÞt|tƒrt|ƒ}nt|tƒs1tStƒ}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.(	R=RR˜R>RœRR3R(t
ValueError(RRR¢((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__and__Âs		cC`sMt|ttfƒr*tt|ƒƒ}nt|tƒs=tS|j|jkS(N(R=RR)R˜R8R>R(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRÚs
cC`sMt|ttfƒr*tt|ƒƒ}nt|tƒs=tS|j|jkS(N(R=RR)R˜R8R>R(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRãs
cC`s
t|jƒS(N(R|R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__len__ìscC`s
t|jƒS(N(titerR(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt__iter__ðscC`s:|jdk	r|jS|js#dStd„|jDƒƒS(Ncs`s|]}|jVqdS(N(R(R£RŸ((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pys	<genexpr>s(R3R(Rtany(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRôs
	cC`s
||_dS(N(R3(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyRscC`s
|j|ƒS(N(R!(RR ((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyREsc`sptˆttfƒs$tˆƒ‰nˆdkr<|j‰nˆrPˆjrPtSt‡‡fd†|j	DƒƒS(Nc3`s$|]}|jˆdˆƒVqdS(RN(R!(R£RŸ(R R(sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pys	<genexpr>*s(
R=RRR	R(RRFRGtallR(RR R((R RsQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR!scC`s|dkr|j}n|jrTx,|jD]!}|j|dt|ƒƒ}q+W|Sg}g}xƒ|D]{}t|ttfƒs‘t|ƒ}n|}t|tƒr¬qgn|j	rÕ|rÕ|sâ|j
|ƒqâqg|j
|ƒqgW|r|r|dkr|S|SdS(NR(R(RRR#tboolR=RRR	RFRJ(RR"RR4tfilteredRLR RN((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR#,s*
	
N(RRR(R6R:RRR¦RRR§R©RORR'RER!R#(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyR˜˜s	
										(0t
__future__RRRR$RgRuRat_compatRRt_typingRtutilsRR,RRR	ttypingR
RRR
RRRRRt
ParsedVersionR8tUnparsedVersionR¬tCallableOperatorR¥RtABCMetatobjectRR)RPRiRjRbR‹RwR}R˜(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/packaging/specifiers.pyt<module>s0@"@Ÿ8	ÿ*		
Back to Directory File Manager