Added new script file, modified setup.py to install it, and added an empty implementa...
[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             'testtools>=0.9.30',
14         ]
15     }
16
17
18 def _get_version_from_file(filename, start_of_line, split_marker):
19     """Extract version from file, giving last matching value or None"""
20     try:
21         return [x for x in open(filename)
22             if x.startswith(start_of_line)][-1].split(split_marker)[1].strip()
23     except (IOError, IndexError):
24         return None
25
26
27 VERSION = (
28     # Assume we are in a distribution, which has PKG-INFO
29     _get_version_from_file('PKG-INFO', 'Version:', ':')
30     # Must be a development checkout, so use the Makefile
31     or _get_version_from_file('Makefile', 'VERSION', '=')
32     or "0.0")
33
34
35 setup(
36     name='python-subunit',
37     version=VERSION,
38     description=('Python implementation of subunit test streaming protocol'),
39     long_description=open('README').read(),
40     classifiers=[
41         'Intended Audience :: Developers',
42         'Programming Language :: Python :: 3',
43         'Programming Language :: Python',
44         'Topic :: Software Development :: Testing',
45     ],
46     keywords='python test streaming',
47     author='Robert Collins',
48     author_email='subunit-dev@lists.launchpad.net',
49     url='http://launchpad.net/subunit',
50     packages=['subunit', 'subunit.tests'],
51     package_dir={'subunit': 'python/subunit'},
52     scripts = [
53         'filters/subunit-1to2',
54         'filters/subunit-2to1',
55         'filters/subunit-filter',
56         'filters/subunit-ls',
57         'filters/subunit-notify',
58         'filters/subunit-output',
59         'filters/subunit-stats',
60         'filters/subunit-tags',
61         'filters/subunit2gtk',
62         'filters/subunit2junitxml',
63         'filters/subunit2pyunit',
64         'filters/tap2subunit',
65     ],
66     **extra
67 )