Merge "fix the version info of trove to use pbr"

This commit is contained in:
Jenkins 2015-11-17 04:20:11 +00:00 committed by Gerrit Code Review
commit 47474b98c2
4 changed files with 5 additions and 66 deletions

View File

@ -38,7 +38,7 @@ copyright = u'2013, OpenStack Foundation'
# built documents.
#
# The short X.Y version.
from trove import version as trove_version
from trove.version import version_info as trove_version
# The full version, including alpha/beta/rc tags.
release = trove_version.version_string_with_vcs()
# The short X.Y version.

View File

@ -1,34 +0,0 @@
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
:mod:`trove` -- Cloud PaaS Database Platform
===================================
.. automodule:: trove
:platform: Unix
:synopsis: Platform-As-A-Service Database Cloud
"""
__all__ = ['__version__']
import pbr.version
version_info = pbr.version.VersionInfo('trove')
# We have a circular import problem when we first run python setup.py sdist
# It's harmless, so deflect it.
try:
__version__ = version_info.version_string()
except AttributeError:
__version__ = None

View File

@ -20,7 +20,7 @@ import os.path
from oslo_config import cfg
from oslo_log import log as logging
import trove
from trove.version import version_info as version
UNKNOWN_SERVICE_ID = 'unknown-service-id-error'
@ -1227,7 +1227,7 @@ def custom_parser(parsername, parser):
def parse_args(argv, default_config_files=None):
cfg.CONF(args=argv[1:],
project='trove',
version=trove.__version__,
version=version.cached_version_string(),
default_config_files=default_config_files)

View File

@ -13,33 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
try:
from trove.vcsversion import version_info
except ImportError:
version_info = {'branch_nick': u'LOCALBRANCH',
'revision_id': 'LOCALREVISION',
'revno': 0}
import pbr.version
TROVE_VERSION = ['2012', '1']
YEAR, COUNT = TROVE_VERSION
FINAL = False # This becomes true at Release Candidate time
def canonical_version_string():
return '.'.join([YEAR, COUNT])
def version_string():
if FINAL:
return canonical_version_string()
else:
return '%s-dev' % (canonical_version_string(),)
def vcs_version_string():
return "%s:%s" % (version_info['branch_nick'], version_info['revision_id'])
def version_string_with_vcs():
return "%s-%s" % (canonical_version_string(), vcs_version_string())
version_info = pbr.version.VersionInfo('trove')