Merge "Automagic versioning"

This commit is contained in:
Jenkins 2015-12-15 11:36:40 +00:00 committed by Gerrit Code Review
commit 75a31c23e5
2 changed files with 18 additions and 6 deletions
doc/source
swauth

@ -65,9 +65,10 @@ copyright = u'2010-2011, OpenStack, LLC'
# built documents.
#
# The short X.Y version.
version = '.'.join(str(v) for v in swauth.version_info[:2])
from swauth import __version__
version = __version__.rsplit('.', 1)[0]
# The full version, including alpha/beta/rc tags.
release = swauth.version
release = swauth.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

@ -14,10 +14,21 @@
# limitations under the License.
import gettext
import pkg_resources
#: Version information (major, minor, revision[, 'dev']).
version_info = (1, 0, 9, 'dev')
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
try:
# First, try to get our version out of PKG-INFO. If we're installed,
# this'll let us find our version without pulling in pbr. After all, if
# we're installed on a system, we're not in a Git-managed source tree, so
# pbr doesn't really buy us anything.
__version__ = pkg_resources.get_provider(
pkg_resources.Requirement.parse('swauth')).version
except pkg_resources.DistributionNotFound:
# No PKG-INFO? We're probably running from a checkout, then. Let pbr do
# its thing to figure out a version number.
import pbr.version
__version__ = pbr.version.VersionInfo(
'swauth').version_string()
gettext.install('swauth')