From 2fc479c6845a71eba91ee72693caf8ab255a87bf Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 17 May 2012 16:02:04 -0400 Subject: Align with project standards. Rebased from: Change-Id: Ifc9fff4f88dfaebe97b7caba4d603d23c645e346 Reviewed-by: Steven Dake --- setup.py | 72 +++++++++++----------------------------------------------------- 1 file changed, 12 insertions(+), 60 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index bfcbce1..58801cf 100755 --- a/setup.py +++ b/setup.py @@ -17,58 +17,19 @@ import gettext import os import subprocess -from setuptools import setup, find_packages -from setuptools.command.sdist import sdist +import setuptools -gettext.install('heat', unicode=1) +from heat.openstack.common import setup -from heat import version - - -def run_git_command(cmd): - output = subprocess.Popen(["/bin/sh", "-c", cmd], - stdout=subprocess.PIPE) - return output.communicate()[0].strip() - - -if os.path.isdir('.git'): - branch_nick_cmd = 'git branch | grep -Ei "\* (.*)" | cut -f2 -d" "' - branch_nick = run_git_command(branch_nick_cmd) - revid_cmd = "git --no-pager log --max-count=1 | cut -f2 -d' ' | head -1" - revid = run_git_command(revid_cmd) - revno_cmd = "git --no-pager log --oneline | wc -l" - revno = run_git_command(revno_cmd) - with open("heat/vcsversion.py", 'w') as version_file: - version_file.write(""" -# This file is automatically generated by setup.py, So don't edit it. :) -version_info = { - 'branch_nick': '%s', - 'revision_id': '%s', - 'revno': %s -} -""" % (branch_nick, revid, revno)) +setup.write_vcsversion('heat/vcsversion.py') -cmdclass = {} - -# If Sphinx is installed on the box running setup.py, -# enable setup.py to build the documentation, otherwise, -# just ignore it -try: - from sphinx.setup_command import BuildDoc - - class local_BuildDoc(BuildDoc): - def run(self): - for builder in ['html', 'man']: - self.builder = builder - self.finalize_options() - BuildDoc.run(self) - cmdclass['build_sphinx'] = local_BuildDoc - -except: - pass +# import this after write_vcsversion because version imports vcsversion +from heat import version +requires = setup.parse_requirements() +depend_links = setup.parse_dependency_links() -setup( +setuptools.setup( name='heat', version=version.canonical_version_string(), description='The heat project provides services for provisioning ' @@ -77,8 +38,10 @@ setup( author='Heat API Developers', author_email='discuss@heat-api.org', url='http://heat.openstack.org/', - packages=find_packages(exclude=['bin']), - cmdclass=cmdclass, + packages=setuptools.find_packages(exclude=['bin']), + cmdclass=setup.get_cmdclass(), + install_requires=requires, + dependency_links=depend_links, include_package_data=True, classifiers=[ 'Development Status :: 4 - Beta', @@ -92,15 +55,4 @@ setup( 'bin/heat-metadata', 'bin/heat-engine', 'bin/heat-db-setup'], - data_files=[('/etc/heat', ['etc/heat-api.conf', - 'etc/heat-api-paste.ini', - 'etc/heat-metadata.conf', - 'etc/heat-metadata-paste.ini', - 'etc/heat-engine.conf', - 'etc/heat-engine-paste.ini']), - ('/etc/bash_completion.d', ['etc/bash_completion.d/heat']), - ('/var/log/heat', ['var/log/heat/api.log', - 'var/log/heat/metadata.log', - 'var/log/heat/engine.log']), - ('/var/lib/heat', ['var/lib/heat/.dummy'])], py_modules=[]) -- cgit v1.2.1