testtools: Fix included testtools, for systems that don't have it.
[nivanova/samba-autobuild/.git] / lib / testtools / setup.py
1 #!/usr/bin/env python
2 """Distutils installer for testtools."""
3
4 from distutils.core import setup
5 import testtools
6 version = '.'.join(str(component) for component in testtools.__version__[0:3])
7 phase = testtools.__version__[3]
8 if phase != 'final':
9     import bzrlib.workingtree
10     t = bzrlib.workingtree.WorkingTree.open_containing(__file__)[0]
11     if phase == 'alpha':
12         # No idea what the next version will be
13         version = 'next-%s' % t.branch.revno()
14     else:
15         # Preserve the version number but give it a revno prefix
16         version = version + '~%s' % t.branch.revno()
17
18 setup(name='testtools',
19       author='Jonathan M. Lange',
20       author_email='jml+testtools@mumak.net',
21       url='https://launchpad.net/testtools',
22       description=('Extensions to the Python standard library unit testing '
23                    'framework'),
24       version=version,
25       packages=['testtools', 'testtools.testresult', 'testtools.tests'])