X-Git-Url: http://git.samba.org/samba.git/?p=third_party%2Fsubunit;a=blobdiff_plain;f=setup.py;h=d7089df2f955f26d493745d6d0386329bb96357e;hp=2038d04826026d490b5e733b3414779339e83401;hb=2fed9ee652ea198de3b26173db9bd5480f2ac057;hpb=3a41c806338121e7597c52b8e6e79302e67d8008 diff --git a/setup.py b/setup.py index 2038d04..d7089df 100755 --- a/setup.py +++ b/setup.py @@ -9,23 +9,28 @@ except ImportError: else: extra = { 'install_requires': [ - 'testtools>=0.9.6', + 'extras', + 'testscenarios', + 'testtools>=0.9.30', ] } -try: + +def _get_version_from_file(filename, start_of_line, split_marker): + """Extract version from file, giving last matching value or None""" + try: + return [x for x in open(filename) + if x.startswith(start_of_line)][-1].split(split_marker)[1].strip() + except (IOError, IndexError): + return None + + +VERSION = ( # Assume we are in a distribution, which has PKG-INFO - version_lines = [x for x in open('PKG-INFO').readlines() - if x.startswith('Version:')] - version_line = version_lines and version_lines[-1] or 'VERSION = 0.0' - VERSION = version_line.split(':')[1].strip() - -except IOError: + _get_version_from_file('PKG-INFO', 'Version:', ':') # Must be a development checkout, so use the Makefile - version_lines = [x for x in open('Makefile').readlines() - if x.startswith('VERSION')] - version_line = version_lines and version_lines[-1] or 'VERSION = 0.0' - VERSION = version_line.split('=')[1].strip() + or _get_version_from_file('Makefile', 'VERSION', '=') + or "0.0") setup( @@ -35,6 +40,7 @@ setup( long_description=open('README').read(), classifiers=[ 'Intended Audience :: Developers', + 'Programming Language :: Python :: 3', 'Programming Language :: Python', 'Topic :: Software Development :: Testing', ], @@ -42,17 +48,20 @@ setup( author='Robert Collins', author_email='subunit-dev@lists.launchpad.net', url='http://launchpad.net/subunit', - packages=['subunit'], + packages=['subunit', 'subunit.tests'], package_dir={'subunit': 'python/subunit'}, scripts = [ - 'filters/subunit2gtk', - 'filters/subunit2junitxml', - 'filters/subunit2pyunit', + 'filters/subunit-1to2', + 'filters/subunit-2to1', 'filters/subunit-filter', 'filters/subunit-ls', 'filters/subunit-notify', + 'filters/subunit-output', 'filters/subunit-stats', 'filters/subunit-tags', + 'filters/subunit2gtk', + 'filters/subunit2junitxml', + 'filters/subunit2pyunit', 'filters/tap2subunit', ], **extra