Added code to generate a ChangeLog file from bzr on sdist.

This commit is contained in:
Monty Taylor 2010-07-28 14:17:22 -07:00
parent 0baceef8ad
commit 7dcd4c85f9
2 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
include AUTHORS LICENSE .functests .unittests .probetests test/__init__.py
include ChangeLog
graft doc
graft etc
graft test/functional

View File

@ -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',