From 7c39435df527126411ccaf5f95c1f9d0828af107 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 28 Jul 2010 14:37:58 -0700 Subject: [PATCH] Added ChangeLog generation. --- .bzrignore | 1 + MANIFEST.in | 1 + setup.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/.bzrignore b/.bzrignore index c3a502a1a44f..ab099d3e3297 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,2 +1,3 @@ run_tests.err.log .nova-venv +ChangeLog diff --git a/MANIFEST.in b/MANIFEST.in index e917077c522f..4eb28bde61f3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ include HACKING LICENSE run_tests.py run_tests.sh include README builddeb.sh exercise_rsapi.py +include ChangeLog graft CA graft doc graft smoketests diff --git a/setup.py b/setup.py index 127d014b1940..2940b518aaee 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,23 @@ # under the License. from setuptools import setup, find_packages +from setuptools.command.sdist import sdist + +import os +import subprocess + +class local_sdist(sdist): + """Customized sdist hook - builds the ChangeLog file from VC first""" + + def run(self): + if os.path.isdir('.bzr'): + # We're in a bzr branch + log_cmd = subprocess.Popen(["bzr","log","--gnu"], + stdout = subprocess.PIPE) + changelog = log_cmd.communicate()[0] + with open("ChangeLog", "w") as changelog_file: + changelog_file.write(changelog) + sdist.run(self) setup(name='nova', version='0.9.0', @@ -24,6 +41,7 @@ setup(name='nova', author='OpenStack', author_email='nova@lists.launchpad.net', url='http://www.openstack.org/', + cmdclass = {'sdist': local_sdist}, packages = find_packages(exclude=['bin','smoketests']), scripts=['bin/nova-api', 'bin/nova-compute',