diff options
author | Monty Taylor <mordred@inaugust.com> | 2012-05-17 16:02:04 -0400 |
---|---|---|
committer | Steven Dake <sdake@redhat.com> | 2012-05-21 16:48:34 -0700 |
commit | 2fc479c6845a71eba91ee72693caf8ab255a87bf (patch) | |
tree | 2e4baa4c7b325428fb83f74e3638838dbb0cf88e /setup.py | |
parent | 4c68cf63e3e640a843a83a70cf34742bed6f3683 (diff) | |
download | heat-cfntools-2fc479c6845a71eba91ee72693caf8ab255a87bf.tar.gz |
Align with project standards.
Rebased from: Change-Id: Ifc9fff4f88dfaebe97b7caba4d603d23c645e346
Reviewed-by: Steven Dake <sdake@redhat.com>
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 72 |
1 files changed, 12 insertions, 60 deletions
@@ -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=[]) |