From f6ae203c98c5bc1ebdff97ebae316c333ac8f9cd Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 4 Feb 2013 09:35:51 +1100 Subject: [PATCH] Update to latest oslo-version In support of tag-based versioning, update to latest oslo-version code. Change-Id: I11e85bbfb67e42628cbb13ba5294047960600eae --- ceilometer/openstack/common/setup.py | 8 ++++---- ceilometer/version.py | 25 ------------------------- doc/source/conf.py | 12 ------------ setup.py | 7 ++++--- 4 files changed, 8 insertions(+), 44 deletions(-) delete mode 100644 ceilometer/version.py diff --git a/ceilometer/openstack/common/setup.py b/ceilometer/openstack/common/setup.py index 35680b30..22f864d5 100644 --- a/ceilometer/openstack/common/setup.py +++ b/ceilometer/openstack/common/setup.py @@ -117,9 +117,9 @@ def _run_shell_command(cmd, throw_on_error=False): output = subprocess.Popen(["/bin/sh", "-c", cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out = output.communicate() if output.returncode and throw_on_error: raise Exception("%s returned %d" % cmd, output.returncode) - out = output.communicate() if len(out) == 0: return None if len(out[0].strip()) == 0: @@ -131,7 +131,7 @@ def write_git_changelog(): """Write a changelog based on the git changelog.""" new_changelog = 'ChangeLog' if not os.getenv('SKIP_WRITE_GIT_CHANGELOG'): - if os.path.isdir('.git'): + if os.path.exists('.git'): git_log_cmd = 'git log --stat' changelog = _run_shell_command(git_log_cmd) mailmap = parse_mailmap() @@ -147,7 +147,7 @@ def generate_authors(): old_authors = 'AUTHORS.in' new_authors = 'AUTHORS' if not os.getenv('SKIP_GENERATE_AUTHORS'): - if os.path.isdir('.git'): + if os.path.exists('.git'): # don't include jenkins email address in AUTHORS file git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | " "egrep -v '" + jenkins_email + "'") @@ -279,7 +279,7 @@ def _get_version_from_git(pre_version): revision if there is one, or tag plus number of additional revisions if the current revision has no tag.""" - if os.path.isdir('.git'): + if os.path.exists('.git'): if pre_version: try: return _run_shell_command( diff --git a/ceilometer/version.py b/ceilometer/version.py deleted file mode 100644 index 40dc5d9b..00000000 --- a/ceilometer/version.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- encoding: utf-8 -*- -# -# Copyright © 2012 New Dream Network, LLC (DreamHost) -# -# Author: Doug Hellmann -# -# 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. -"""Version information for ceilometer. -""" - -from ceilometer.openstack.common import version as common_version - -NEXT_VERSION = '2013.1' - -version_info = common_version.VersionInfo('ceilometer') diff --git a/doc/source/conf.py b/doc/source/conf.py index 3e866f5f..7b77eb94 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -24,8 +24,6 @@ sys.path.insert(0, BASE_DIR) # This is required for ReadTheDocs.org, but isn't a bad idea anyway. os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings' -import ceilometer.version - def write_autodoc_index(): @@ -173,16 +171,6 @@ master_doc = 'index' project = u'Ceilometer' copyright = u'2013, OpenStack, LLC' -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -#version = '0.0' -from ceilometer.version import version_info as ceilometer_version -release = ceilometer_version.version_string_with_vcs() -version = ceilometer_version.canonical_version_string() - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None diff --git a/setup.py b/setup.py index 254efc35..02433abe 100755 --- a/setup.py +++ b/setup.py @@ -22,10 +22,11 @@ import os import setuptools from ceilometer.openstack.common import setup as common_setup -from ceilometer.version import NEXT_VERSION requires = common_setup.parse_requirements(['tools/pip-requires']) depend_links = common_setup.parse_dependency_links(['tools/pip-requires']) +project = 'ceilometer' +version = common_setup.get_version(project, '2013.1') url_base = 'http://tarballs.openstack.org/ceilometer/ceilometer-%s.tar.gz' @@ -38,7 +39,7 @@ def directories(target_dir): setuptools.setup( name='ceilometer', - version=NEXT_VERSION, + version=version, description='cloud computing metering', @@ -46,7 +47,7 @@ setuptools.setup( author_email='ceilometer@lists.launchpad.net', url='https://launchpad.net/ceilometer', - download_url=url_base % NEXT_VERSION, + download_url=url_base % version, classifiers=[ 'Development Status :: 3 - Alpha',