The swiftclient.openstack.common.version Module

Utilities for consuming the auto-generated versioninfo files.

class swiftclient.openstack.common.version.VersionInfo(package, python_package=None, pre_version=None)

Bases: object

canonical_version_string(always=False)

Return the simple version of the package excluding any suffixes.

For instance, if we are working towards the 2012.2 release, canonical_version_string should return 2012.2 in all cases.

Parameters:always – if true, skip all version caching
deferred_version_string(prefix='')

Generate an object which will expand in a string context to the results of version_string(). We do this so that don’t call into pkg_resources every time we start up a program when passing version information into the CONF constructor, but rather only do the calculation when and if a version is requested

version_string(always=False)

Return the base version of the package.

For instance, if we are working towards the 2012.2 release, version_string should return 2012.2 if this is a final release, or 2012.2-dev if it is not.

Parameters:always – if true, skip all version caching
version_string_with_vcs(always=False)

Return the full version of the package including suffixes indicating VCS status.

For instance, if we are working towards the 2012.2 release, canonical_version_string should return 2012.2 if this is a final release, or else something like 2012.2~f1~20120705.20 if it’s not.

Parameters:always – if true, skip all version caching

This Page