diff --git a/MANIFEST.in b/MANIFEST.in index 1f543d6600..c888933372 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include AUTHORS LICENSE .functests .unittests .probetests test/__init__.py +include ChangeLog graft doc graft etc graft test/functional diff --git a/setup.py b/setup.py index 5555883946..b706f38adb 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,23 @@ # limitations 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) + name='swift' version='1.0.2' @@ -29,6 +46,7 @@ setup( url='https://launchpad.net/swift', packages=find_packages(exclude=['test','bin']), test_suite = 'nose.collector', + cmdclass = {'sdist': local_sdist}, classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: Apache Software License',