Added code to generate a ChangeLog file from bzr on sdist.
This commit is contained in:
parent
0baceef8ad
commit
7dcd4c85f9
@ -1,4 +1,5 @@
|
||||
include AUTHORS LICENSE .functests .unittests .probetests test/__init__.py
|
||||
include ChangeLog
|
||||
graft doc
|
||||
graft etc
|
||||
graft test/functional
|
||||
|
18
setup.py
18
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',
|
||||
|
Loading…
Reference in New Issue
Block a user