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
17 def _get_version_from_file(filename, start_of_line, split_marker):
18 """Extract version from file, giving last matching value or None"""
20 return [x for x in open(filename)
21 if x.startswith(start_of_line)][-1].split(split_marker)[1].strip()
22 except (IOError, IndexError):
27 # Assume we are in a distribution, which has PKG-INFO
28 _get_version_from_file('PKG-INFO', 'Version:', ':')
29 # Must be a development checkout, so use the Makefile
30 or _get_version_from_file('Makefile', 'VERSION', '=')
35 name='python-subunit',
37 description=('Python implementation of subunit test streaming protocol'),
38 long_description=open('README').read(),
40 'Intended Audience :: Developers',
41 'Programming Language :: Python',
42 'Topic :: Software Development :: Testing',
44 keywords='python test streaming',
45 author='Robert Collins',
46 author_email='subunit-dev@lists.launchpad.net',
47 url='http://launchpad.net/subunit',
49 package_dir={'subunit': 'python/subunit'},
51 'filters/subunit2gtk',
52 'filters/subunit2junitxml',
53 'filters/subunit2pyunit',
54 'filters/subunit-filter',
56 'filters/subunit-notify',
57 'filters/subunit-stats',
58 'filters/subunit-tags',
59 'filters/tap2subunit',