Release 0.0.17
[third_party/subunit] / setup.py
1 #!/usr/bin/env python
2 try:
3     # If the user has setuptools / distribute installed, use it
4     from setuptools import setup
5 except ImportError:
6     # Otherwise, fall back to distutils.
7     from distutils.core import setup
8     extra = {}
9 else:
10     extra = {
11         'install_requires': [
12             'extras',
13             'testscenarios',
14             'testtools>=0.9.34',
15         ]
16     }
17
18
19 def _get_version_from_file(filename, start_of_line, split_marker):
20     """Extract version from file, giving last matching value or None"""
21     try:
22         return [x for x in open(filename)
23             if x.startswith(start_of_line)][-1].split(split_marker)[1].strip()
24     except (IOError, IndexError):
25         return None
26
27
28 VERSION = (
29     # Assume we are in a distribution, which has PKG-INFO
30     _get_version_from_file('PKG-INFO', 'Version:', ':')
31     # Must be a development checkout, so use the Makefile
32     or _get_version_from_file('Makefile', 'VERSION', '=')
33     or "0.0")
34
35
36 setup(
37     name='python-subunit',
38     version=VERSION,
39     description=('Python implementation of subunit test streaming protocol'),
40     long_description=open('README').read(),
41     classifiers=[
42         'Intended Audience :: Developers',
43         'Programming Language :: Python :: 3',
44         'Programming Language :: Python',
45         'Topic :: Software Development :: Testing',
46     ],
47     keywords='python test streaming',
48     author='Robert Collins',
49     author_email='subunit-dev@lists.launchpad.net',
50     url='http://launchpad.net/subunit',
51     packages=['subunit', 'subunit.tests'],
52     package_dir={'subunit': 'python/subunit'},
53     scripts = [
54         'filters/subunit-1to2',
55         'filters/subunit-2to1',
56         'filters/subunit-filter',
57         'filters/subunit-ls',
58         'filters/subunit-notify',
59         'filters/subunit-output',
60         'filters/subunit-stats',
61         'filters/subunit-tags',
62         'filters/subunit2gtk',
63         'filters/subunit2junitxml',
64         'filters/subunit2pyunit',
65         'filters/tap2subunit',
66     ],
67     **extra
68 )