3 # If the user has setuptools / distribute installed, use it
4 from setuptools import setup
6 # Otherwise, fall back to distutils.
7 from distutils.core import setup
18 def _get_version_from_file(filename, start_of_line, split_marker):
19 """Extract version from file, giving last matching value or None"""
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):
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', '=')
36 name='python-subunit',
38 description=('Python implementation of subunit test streaming protocol'),
39 long_description=open('README').read(),
41 'Intended Audience :: Developers',
42 'Programming Language :: Python :: 3',
43 'Programming Language :: Python',
44 'Topic :: Software Development :: Testing',
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'},
53 'filters/subunit-1to2',
54 'filters/subunit-2to1',
55 'filters/subunit-filter',
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',