Switch to openstack style versioning
Bug 1078480 Change-Id: I32471acc16e7ca6f60672474c9bf70537ba76fd2 Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
This commit is contained in:
parent
42599700a7
commit
4e99d4d0bb
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,7 +3,7 @@
|
|||||||
build
|
build
|
||||||
dist
|
dist
|
||||||
heat.egg-info
|
heat.egg-info
|
||||||
heat/vcsversion.py
|
heat/versioninfo
|
||||||
tags
|
tags
|
||||||
*.log
|
*.log
|
||||||
heat-test.db
|
heat-test.db
|
||||||
|
@ -7,6 +7,7 @@ include MANIFEST.in pylintrc
|
|||||||
include openstack-common.conf
|
include openstack-common.conf
|
||||||
include babel.cfg
|
include babel.cfg
|
||||||
graft templates
|
graft templates
|
||||||
|
include heat/versioninfo
|
||||||
include heat/cloudinit/config
|
include heat/cloudinit/config
|
||||||
include heat/cloudinit/loguserdata.sh
|
include heat/cloudinit/loguserdata.sh
|
||||||
include heat/cloudinit/part-handler.py
|
include heat/cloudinit/part-handler.py
|
||||||
|
@ -47,7 +47,7 @@ if scriptname == 'heat-boto':
|
|||||||
from heat import boto_client as heat_client
|
from heat import boto_client as heat_client
|
||||||
else:
|
else:
|
||||||
from heat import client as heat_client
|
from heat import client as heat_client
|
||||||
from heat import version
|
from heat.version import version_info as version
|
||||||
from heat.common import config
|
from heat.common import config
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
from heat import utils
|
from heat import utils
|
||||||
@ -639,8 +639,8 @@ Commands:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
oparser = optparse.OptionParser(version='%%prog %s'
|
deferred_string = version.deferred_version_string(prefix='%prog ')
|
||||||
% version.version_string(),
|
oparser = optparse.OptionParser(version=str(deferred_string),
|
||||||
usage=usage.strip())
|
usage=usage.strip())
|
||||||
create_options(oparser)
|
create_options(oparser)
|
||||||
(opts, cmd, args) = parse_options(oparser, sys.argv[1:])
|
(opts, cmd, args) = parse_options(oparser, sys.argv[1:])
|
||||||
|
@ -13,57 +13,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
try:
|
from heat.openstack.common import version as common_version
|
||||||
import git
|
|
||||||
except ImportError:
|
|
||||||
git = None
|
|
||||||
|
|
||||||
try:
|
NEXT_VERSION = '2013.1'
|
||||||
from heat.vcsversion import version_info
|
version_info = common_version.VersionInfo('heat', pre_version=NEXT_VERSION)
|
||||||
except ImportError:
|
|
||||||
version_info = {}
|
|
||||||
|
|
||||||
HEAT_VERSION = '8'
|
|
||||||
FINAL = False # This becomes true at Release Candidate time
|
|
||||||
|
|
||||||
|
|
||||||
def get_git_sha():
|
|
||||||
if not git:
|
|
||||||
return version_info.get('sha', '')
|
|
||||||
|
|
||||||
try:
|
|
||||||
repo = git.Repo('.')
|
|
||||||
except git.InvalidGitRepositoryError:
|
|
||||||
return version_info.get('sha', '')
|
|
||||||
return repo.head.commit.hexsha
|
|
||||||
|
|
||||||
|
|
||||||
def write_git_sha():
|
|
||||||
|
|
||||||
sha = get_git_sha()
|
|
||||||
vcsversion_path = 'heat/vcsversion.py'
|
|
||||||
|
|
||||||
if sha:
|
|
||||||
with open(vcsversion_path, 'w') as version_file:
|
|
||||||
version_file.write("""
|
|
||||||
# This file is automatically generated by heat's setup.py, so don't edit it. :)
|
|
||||||
version_info = {
|
|
||||||
'sha': '%s'
|
|
||||||
}
|
|
||||||
""" % (sha))
|
|
||||||
else:
|
|
||||||
try:
|
|
||||||
os.remove(vcsversion_path)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def version_string(type='short'):
|
|
||||||
version = HEAT_VERSION
|
|
||||||
if not FINAL:
|
|
||||||
version += '-dev ' + get_git_sha()
|
|
||||||
elif type != 'short':
|
|
||||||
version += ' ' + get_git_sha()
|
|
||||||
return version
|
|
||||||
|
6
setup.py
6
setup.py
@ -20,15 +20,13 @@ import subprocess
|
|||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
from heat.openstack.common import setup
|
from heat.openstack.common import setup
|
||||||
|
from heat.version import version_info as version
|
||||||
from heat import version
|
|
||||||
version.write_git_sha()
|
|
||||||
|
|
||||||
requires = setup.parse_requirements()
|
requires = setup.parse_requirements()
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='heat',
|
name='heat',
|
||||||
version=version.HEAT_VERSION,
|
version=version.canonical_version_string(always=True),
|
||||||
description='The heat project provides services for provisioning '
|
description='The heat project provides services for provisioning '
|
||||||
'virtual machines',
|
'virtual machines',
|
||||||
license='Apache License (2.0)',
|
license='Apache License (2.0)',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user