fix the version info of trove to use pbr
Change-Id: I2a445cdea20e70399e331ea4e97042ecd0137c2e Closes-Bug: #1513259
This commit is contained in:
parent
b6459ac348
commit
68c1c61b54
@ -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.
|
||||
|
@ -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
|
@ -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'
|
||||
@ -1200,5 +1200,5 @@ 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)
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user