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