Makes Glance's versioning non-static. Uses Nova's versioning scheme.
This commit is contained in:
parent
67a71df391
commit
00ac0d44a6
@ -77,9 +77,11 @@ copyright = u'2010-present, OpenStack, LLC.'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '0.1'
|
from glance import version as glance_version
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '0.1.6'
|
release = glance_version.version_string()
|
||||||
|
# The short X.Y version.
|
||||||
|
version = glance_version.canonical_version_string()
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
46
glance/version.py
Normal file
46
glance/version.py
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
|
||||||
|
# Copyright 2011 OpenStack LLC
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
try:
|
||||||
|
from glance.vcsversion import version_info
|
||||||
|
except ImportError:
|
||||||
|
version_info = {'branch_nick': u'LOCALBRANCH',
|
||||||
|
'revision_id': 'LOCALREVISION',
|
||||||
|
'revno': 0}
|
||||||
|
|
||||||
|
GLANCE_VERSION = ['2011', '2']
|
||||||
|
YEAR, COUNT = GLANCE_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())
|
33
setup.py
33
setup.py
@ -20,6 +20,16 @@ import subprocess
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from setuptools.command.sdist import sdist
|
from setuptools.command.sdist import sdist
|
||||||
|
|
||||||
|
from glance import version
|
||||||
|
|
||||||
|
|
||||||
|
if os.path.isdir('.bzr'):
|
||||||
|
with open("glance/vcsversion.py", 'w') as version_file:
|
||||||
|
vcs_cmd = subprocess.Popen(["bzr", "version-info", "--python"],
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
|
vcsversion = vcs_cmd.communicate()[0]
|
||||||
|
version_file.write(vcsversion)
|
||||||
|
|
||||||
|
|
||||||
class local_sdist(sdist):
|
class local_sdist(sdist):
|
||||||
"""Customized sdist hook - builds the ChangeLog file from VC first"""
|
"""Customized sdist hook - builds the ChangeLog file from VC first"""
|
||||||
@ -37,8 +47,12 @@ class local_sdist(sdist):
|
|||||||
|
|
||||||
cmdclass = {'sdist': local_sdist}
|
cmdclass = {'sdist': local_sdist}
|
||||||
|
|
||||||
|
# If Sphinx is installed on the box running setup.py,
|
||||||
|
# enable setup.py to build the documentation, otherwise,
|
||||||
|
# just ignore it
|
||||||
try:
|
try:
|
||||||
from sphinx.setup_command import BuildDoc
|
from sphinx.setup_command import BuildDoc
|
||||||
|
|
||||||
class local_BuildDoc(BuildDoc):
|
class local_BuildDoc(BuildDoc):
|
||||||
def run(self):
|
def run(self):
|
||||||
for builder in ['html', 'man']:
|
for builder in ['html', 'man']:
|
||||||
@ -51,21 +65,19 @@ except:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
name = 'glance'
|
|
||||||
version = '0.1.6'
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=name,
|
name='glance',
|
||||||
version=version,
|
version=version.canonical_version_string(),
|
||||||
description='Glance',
|
description='The Glance project provides services for discovering, '
|
||||||
|
'registering, and retrieving virtual machine images',
|
||||||
license='Apache License (2.0)',
|
license='Apache License (2.0)',
|
||||||
author='OpenStack, LLC.',
|
author='OpenStack',
|
||||||
author_email='openstack-admins@lists.launchpad.net',
|
author_email='openstack@lists.launchpad.net',
|
||||||
url='https://launchpad.net/glance',
|
url='http://glance.openstack.org/',
|
||||||
packages=find_packages(exclude=['tests', 'bin']),
|
packages=find_packages(exclude=['tests', 'bin']),
|
||||||
test_suite='nose.collector',
|
test_suite='nose.collector',
|
||||||
cmdclass=cmdclass,
|
cmdclass=cmdclass,
|
||||||
|
include_package_data=True,
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 4 - Beta',
|
||||||
'License :: OSI Approved :: Apache Software License',
|
'License :: OSI Approved :: Apache Software License',
|
||||||
@ -73,7 +85,6 @@ setup(
|
|||||||
'Programming Language :: Python :: 2.6',
|
'Programming Language :: Python :: 2.6',
|
||||||
'Environment :: No Input/Output (Daemon)',
|
'Environment :: No Input/Output (Daemon)',
|
||||||
],
|
],
|
||||||
install_requires=[], # removed for better compat
|
|
||||||
scripts=['bin/glance-api',
|
scripts=['bin/glance-api',
|
||||||
'bin/glance-registry',
|
'bin/glance-registry',
|
||||||
'bin/glance-upload'])
|
'bin/glance-upload'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user