Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / pbr / version.pyc
Size: Mime:
ó
›‹EYc@scdZddlZddlZddlZd„Zdefd„ƒYZdefd„ƒYZdS(s9
Utilities for consuming the version from pkg_resources.
iÿÿÿÿNcCs+yt|ƒtSWntk
r&tSXdS(N(tinttTruet
ValueErrortFalse(tstring((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt_is_ints


tSemanticVersioncBsïeZdZdddddd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
ed„ƒZed
„ƒZd„Zd„Zd„Zeed„Zdd„Zd„Zd„Zd„Zd„ZRS(svA pure semantic version independent of serialisation.

    See the pbr doc 'semver' for details on the semantics.
    icCs_||_||_||_||_||_|jrL|jrLd|_n|pUd|_dS(s
Create a SemanticVersion.

        :param major: Major component of the version.
        :param minor: Minor component of the version. Defaults to 0.
        :param patch: Patch level component. Defaults to 0.
        :param prerelease_type: What sort of prerelease version this is -
            one of a(alpha), b(beta) or rc(release candidate).
        :param prerelease: For prerelease versions, what number prerelease.
            Defaults to 0.
        :param dev_count: How many commits since the last release.
        iN(t_majort_minort_patcht_prerelease_typet_prereleaset
_dev_count(tselftmajortminortpatchtprerelease_typet
prereleaset	dev_count((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__init__(s					cCs#t|tƒstS|j|jkS(N(t
isinstanceRRt__dict__(R
tother((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__eq__?scCsttt|jjƒƒƒS(N(tsumtmapthashRtvalues(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__hash__Dsc	Cs|idd6dd6dd6dd6}|jr>|jr>d}nd}|j|j|j|||j|j|jpxtjfS(s.Return a key for sorting SemanticVersion's on.tatbtrctziiN(	tNoneRR
RRR	Rtsystmaxsize(R
t	rc_lookuptuq_dev((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt	_sort_keyGs"	cCs4t|tƒstdƒ‚n|jƒ|jƒkS(s1Compare self and other, another Semantic Version.s,ordering to non-SemanticVersion is undefined(RRt	TypeErrorR'(R
R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__lt__^scCs||kp||kS(N((R
R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__le__hscCs||kS(N((R
R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__ge__kscCs||kS(N((R
R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__gt__nscCs||kS(N((R
R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__ne__qscCsd|jƒS(Nspbr.version.SemanticVersion(%s)(trelease_string(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__repr__tscCs9y|j|ƒSWn!tk
r4td|ƒ‚nXdS(s²Create a SemanticVersion from a pip version string.

        This method will parse a version like 1.3.0 into a SemanticVersion.

        This method is responsible for accepting any version string that any
        older version of pbr ever created.

        Therefore: versions like 1.3.0a1 versions are handled, parsed into a
        canonical form and then output - resulting in 1.3.0.0a1.
        Pre pbr-semver dev versions like 0.10.1.3.g83bef74 will be parsed but
        output as 0.10.1.dev3.g83bef74.

        :raises ValueError: Never tagged versions sdisted by old pbr result in
            just the git hash, e.g. '1234567' which poses a substantial problem
            since they collide with the semver versions when all the digits are
            numerals. Such versions will result in a ValueError being thrown if
            any non-numeric digits are present. They are an exception to the
            general case of accepting anything we ever output, since they were
            never intended and would permanently mess up versions on PyPI if
            ever released - we're treating that as a critical bug that we ever
            made them and have stopped doing that.
        sInvalid version %rN(t_from_pip_string_unsafet
IndexErrorR(tklasstversion_string((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pytfrom_pip_stringws
cCsQ|d jƒs#td|ƒ‚n|jdƒ}g|D]}|jƒr9|^q9}t|ƒ}|dkr‚td|ƒ‚n°|dkr2|t|ƒkr||djƒr||}djtjd„|ƒƒ}|j|ƒ||t|ƒg|||d+|d7}n|jdgd|ƒn|j||ƒt	|dƒ}t	|dƒ}	d}
d}d}d}
d„}t|d	ƒr§t	|d	ƒ}nd}dg|d	d	+|d}t}y#|rït	|dƒrït
}nWntk
rnX|rt	|dƒ}
nÒ|rn|ddd
ksK|dddkrn||dƒ\}}
|d}nx~|rî|d}|jdƒr£t	|dƒ}
n>|jdƒrËd}
t	|dƒ}ntd||fƒ‚|d}qqWt||	|d|d|
d|
ƒ}|rM|
r5td|fƒ‚n|jƒj|ƒ}n|S(NisInvalid version %rt.iitcSs
|jƒS(N(tisdigit(tx((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt<lambda>¦scSs}tjdƒ}djtj||ƒƒ}tjdƒ}djtj||ƒƒ}|t|ƒdd…}|t|ƒfS(NR7R6tisalpha(	toperatortmethodcallertjoint	itertoolst	dropwhilet	takewhiletlenR"R(tsegmentR7R:RR((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt_parse_type´sit0RRtrtdevtpostisUnknown remainder %r in %rRRRs0Cannot combine postN and devN - no mapping in %r(RRRE(R7RtsplitRAR=R>R@tappendtextendRR"RRRt
startswithRt	incrementtto_dev(R2R3tinput_componentstct
componentst	digit_lentmixed_componenttlast_componentRRRt
post_countRRRCRt	remaindertremainder_starts_with_intt	componenttresult((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR0•s~%

!
	



	
cCsd|j|j|jfS(s3Return the short version minus any alpha/beta tags.s%s.%s.%s(RRR	(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pytbrief_stringêscCs
|jdƒS(s´Return the version number to use when building a debian package.

        This translates the PEP440/semver precedence rules into Debian version
        sorting operators.
        t~(t
_long_version(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt
debian_stringîscCsˆ|jr+|jd}|j}|j}nMd}|jrS|jd}|j}n%d}|jrr|jd}nd}t|||ƒS(s‰Return a decremented SemanticVersion.

        Decrementing versions doesn't make a lot of sense - this method only
        exists to support rendering of pre-release versions strings into
        serialisations (such as rpm) with no sort-before operator.

        The 9999 magic version component is from the spec on this - pbr-semver.

        :return: A new SemanticVersion object.
        ii'i(R	RRR(R
t	new_patcht	new_minort	new_major((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt	decrementös	
		
	cCsÂ|jr+|j}|jd}|j}nd}d}|jd}|rl|jd}d}d}d}n	|j}|r£|jd}d}d}d}d}n	|j}t|||||ƒS(s~Return an incremented SemanticVersion.

        The default behaviour is to perform a patch level increment. When
        incrementing a prerelease version, the patch level is not changed
        - the prerelease serial is changed (e.g. beta 0 -> beta 1).

        Incrementing non-pre-release versions will not introduce pre-release
        versions - except when doing a patch incremental to a pre-release
        version the new version will only consist of major/minor/patch.

        :param minor: Increment the minor version.
        :param major: Increment the major version.
        :return: A new SemanticVersion object.
        iiN(R
RR	R"RRR(R
RRtnew_prerelease_typetnew_prereleaseR]R^R_((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyRLs.		


		
			R6cCsà|js|jr<|dkr<|jƒjƒg}d}n|jƒg}|jrz|jd|||j|jfƒn|jrÉ|jsœ|j|ƒn
|jdƒ|jdƒ|j|jƒndjd„|DƒƒS(s1Construct a long string version of this semver.

        :param pre_separator: What separator to use between components
            that sort before rather than after. If None, use . and lower the
            version number of the component to preserve sorting. (Used for
            rpm support)
        R5s%s%s%s%sRFR6css|]}t|ƒVqdS(N(tstr(t.0ts((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pys	<genexpr>VsN(R
RR"R`RYRIRR=(R
t
pre_separatort	rc_markertsegments((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR[=s 				

cCs|jddƒS(shReturn the full version of the package.

        This including suffixes indicating VCS status.
        R5RD(R[(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR.XscCs
|jdƒS(sSReturn the version number to use when building an RPM package.

        This translates the PEP440/semver precedence rules into RPM version
        sorting operators. Because RPM has no sort-before operator (such as the
        ~ operator in dpkg),  we show all prerelease versions as being versions
        of the release before.
        N(R[R"(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt
rpm_string_scCs+t|j|j|j|j|jd|ƒS(s~Return a development version of this semver.

        :param dev_count: The number of commits since the last release.
        R(RRRR	R
R(R
R((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyRMiscCs|j|j|jg}|jr´iddtf6ddtf6ddtf6ddtf6ddtf6d	dtf6}|j||jt|jƒfƒ|j|jp­|j	ƒnG|jrá|jd
ƒ|j|jdƒn|jdƒ|jd
ƒt
|ƒS(sºPresent the version as a version_info tuple.

        For documentation on version_info tuples see the Python
        documentation for sys.version_info.

        Since semver and PEP-440 represent overlapping but not subsets of
        versions, we have to have some heuristic / mapping rules, and have
        extended the releaselevel field to have alphadev, betadev and
        candidatedev values. When they are present the dev count is used
        to provide the serial.
        - a/b/rc take precedence.
        - if there is no pre-release version the dev version is used.
        - serial is taken from the dev/a/b/c component.
        - final non-dev versions never get serials.
        talphaRtbetaRt	candidateR talphadevtbetadevtcandidatedevRFitfinali(RRR	R
RRRItboolRRttuple(R
Rhttype_map((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt
version_tuplers"	



	


N(t__name__t
__module__t__doc__R"RRRR'R)R*R+R,R-R/tclassmethodR4R0RYR\R`RRLR[R.RiRMRt(((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR"s.					
					U			*		
		tVersionInfocBs_eZd„Zd„Zd„Zd„Zd„Zd„Zd„ZeZ	eZ
dd„ZRS(	cCs(||_d|_d|_d|_dS(s­Object that understands versioning for a package

        :param package: name of the python package, such as glance, or
                        python-glanceclient
        N(tpackageR"tversiont_cached_versiont	_semantic(R
Rz((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR™s			cCs
|jƒS(s1Make the VersionInfo object behave like a string.(R3(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt__str__¤scCsd|j|jƒfS(sInclude the name.spbr.version.VersionInfo(%s:%s)(RzR3(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR/¨scCsƒddl}y1|jj|jƒ}|j|ƒ}|j}Wn6|jk
ruddlm}|j	|jƒ}nXt
j|ƒS(sObtain a version from pkg_resources or setup-time logic if missing.

        This will try to get the version of the package from the pkg_resources
        record associated with the package, and if there is no such record
        falls back to the logic sdist would use.
        iÿÿÿÿN(t	packaging(t
pkg_resourcestRequirementtparseRztget_providerR{tDistributionNotFoundtpbrRtget_versionRR4(R
R€trequirementtprovidert
result_stringR((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt_get_version_from_pkg_resources­s	
cCs|jƒjƒS(shReturn the full version of the package.

        This including suffixes indicating VCS status.
        (tsemantic_versionR.(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR.ÃscCs(|jdkr!|jƒ|_n|jS(s3Return the SemanticVersion object for this version.N(R}R"RŠ(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR‹ÊscCs|jƒjƒS(s3Return the short version minus any alpha/beta tags.(R‹RY(R
((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyR3ÐsR6cCs,|js%d||jƒf|_n|jS(síReturn a cached version string.

        This will return a cached version string if one is already cached,
        irrespective of prefix. If none is cached, one will be created with
        prefix and then cached and returned.
        s%s%s(R|R3(R
tprefix((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pytcached_version_stringØs	(RuRvRR~R/RŠR.R‹R3tcanonical_version_stringtversion_string_with_vcsR(((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyRy—s							(RwR>R;R#RtobjectRRy(((s@/home/tvault/.virtenv/lib/python2.7/site-packages/pbr/version.pyt<module>s	ÿv