diff options
20 files changed, 271 insertions, 270 deletions
diff --git a/Makefile.am b/Makefile.am index 1053348..fedcbb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,29 +16,6 @@ EXTRA_DIST = \ perl/lib/Subunit.pm \ perl/lib/Subunit/Diff.pm \ perl/subunit-diff \ - python/iso8601/LICENSE \ - python/iso8601/README \ - python/iso8601/README.subunit \ - python/iso8601/setup.py \ - python/iso8601/test_iso8601.py \ - python/subunit/tests/__init__.py \ - python/subunit/tests/sample-script.py \ - python/subunit/tests/sample-two-script.py \ - python/subunit/tests/test_chunked.py \ - python/subunit/tests/test_details.py \ - python/subunit/tests/test_filters.py \ - python/subunit/tests/test_filter_to_disk.py \ - python/subunit/tests/test_output_filter.py \ - python/subunit/tests/test_progress_model.py \ - python/subunit/tests/test_run.py \ - python/subunit/tests/test_subunit_filter.py \ - python/subunit/tests/test_subunit_stats.py \ - python/subunit/tests/test_subunit_tags.py \ - python/subunit/tests/test_tap2subunit.py \ - python/subunit/tests/test_test_protocol.py \ - python/subunit/tests/test_test_protocol2.py \ - python/subunit/tests/test_test_results.py \ - setup.py \ shell/README \ shell/share/subunit.sh \ shell/subunit-ui.patch \ @@ -49,22 +26,6 @@ ACLOCAL_AMFLAGS = -I m4 include_subunitdir = $(includedir)/subunit -dist_bin_SCRIPTS = \ - 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/subunit2csv \ - filters/subunit2disk \ - filters/subunit2gtk \ - filters/subunit2junitxml \ - filters/subunit2pyunit \ - filters/tap2subunit - TESTS = $(check_PROGRAMS) ## install libsubunit.pc @@ -73,19 +34,6 @@ pcdata_DATA = \ libsubunit.pc \ libcppunit_subunit.pc -pkgpython_PYTHON = \ - python/subunit/__init__.py \ - python/subunit/chunked.py \ - python/subunit/details.py \ - python/subunit/filters.py \ - python/subunit/iso8601.py \ - python/subunit/progress_model.py \ - python/subunit/run.py \ - python/subunit/v2.py \ - python/subunit/test_results.py \ - python/subunit/_output.py \ - python/subunit/_to_disk.py - lib_LTLIBRARIES = libsubunit.la lib_LTLIBRARIES += libcppunit_subunit.la diff --git a/filters/subunit-ls b/filters/subunit-ls deleted file mode 100755 index 8c6a1e7..0000000 --- a/filters/subunit-ls +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# subunit: extensions to python unittest to get test results from subprocesses. -# Copyright (C) 2008 Robert Collins <robertc@robertcollins.net> -# -# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause -# license at the users choice. A copy of both licenses are available in the -# project source as Apache-2.0 and BSD. You may not use this file except in -# compliance with one of these two licences. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# license you chose for the specific language governing permissions and -# limitations under that license. -# - -"""List tests in a subunit stream.""" - -from optparse import OptionParser -import sys - -from testtools import ( - CopyStreamResult, StreamToExtendedDecorator, StreamResultRouter, - StreamSummary) - -from subunit import ByteStreamToStreamResult -from subunit.filters import find_stream, run_tests_from_stream -from subunit.test_results import ( - CatFiles, - TestIdPrintingResult, - ) - - -parser = OptionParser(description=__doc__) -parser.add_option("--times", action="store_true", - help="list the time each test took (requires a timestamped stream)", - default=False) -parser.add_option("--exists", action="store_true", - help="list tests that are reported as existing (as well as ran)", - default=False) -parser.add_option("--no-passthrough", action="store_true", - help="Hide all non subunit input.", default=False, dest="no_passthrough") -(options, args) = parser.parse_args() -test = ByteStreamToStreamResult( - find_stream(sys.stdin, args), non_subunit_name="stdout") -result = TestIdPrintingResult(sys.stdout, options.times, options.exists) -if not options.no_passthrough: - result = StreamResultRouter(result) - cat = CatFiles(sys.stdout) - result.add_rule(cat, 'test_id', test_id=None) -summary = StreamSummary() -result = CopyStreamResult([result, summary]) -result.startTestRun() -test.run(result) -result.stopTestRun() -if summary.wasSuccessful(): - exit_code = 0 -else: - exit_code = 1 -sys.exit(exit_code) diff --git a/filters/subunit2pyunit b/filters/subunit2pyunit deleted file mode 100755 index d10ceea..0000000 --- a/filters/subunit2pyunit +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# subunit: extensions to python unittest to get test results from subprocesses. -# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net> -# -# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause -# license at the users choice. A copy of both licenses are available in the -# project source as Apache-2.0 and BSD. You may not use this file except in -# compliance with one of these two licences. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# license you chose for the specific language governing permissions and -# limitations under that license. -# - -"""Display a subunit stream through python's unittest test runner.""" - -from operator import methodcaller -from optparse import OptionParser -import sys -import unittest - -from testtools import StreamToExtendedDecorator, DecorateTestCaseResult, StreamResultRouter - -from subunit import ByteStreamToStreamResult -from subunit.filters import find_stream -from subunit.test_results import CatFiles - -parser = OptionParser(description=__doc__) -parser.add_option("--no-passthrough", action="store_true", - help="Hide all non subunit input.", default=False, dest="no_passthrough") -parser.add_option("--progress", action="store_true", - help="Use bzrlib's test reporter (requires bzrlib)", - default=False) -(options, args) = parser.parse_args() -test = ByteStreamToStreamResult( - find_stream(sys.stdin, args), non_subunit_name='stdout') -def wrap_result(result): - result = StreamToExtendedDecorator(result) - if not options.no_passthrough: - result = StreamResultRouter(result) - result.add_rule(CatFiles(sys.stdout), 'test_id', test_id=None) - return result -test = DecorateTestCaseResult(test, wrap_result, - before_run=methodcaller('startTestRun'), - after_run=methodcaller('stopTestRun')) -if options.progress: - from bzrlib.tests import TextTestRunner - from bzrlib import ui - ui.ui_factory = ui.make_ui_for_terminal(None, sys.stdout, sys.stderr) - runner = TextTestRunner() -else: - runner = unittest.TextTestRunner(verbosity=2) -if runner.run(test).wasSuccessful(): - exit_code = 0 -else: - exit_code = 1 -sys.exit(exit_code) diff --git a/python/subunit/filter_scripts/__init__.py b/python/subunit/filter_scripts/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/python/subunit/filter_scripts/__init__.py diff --git a/filters/subunit2csv b/python/subunit/filter_scripts/subunit2csv.py index 4adf5cd..0a8a0de 100755 --- a/filters/subunit2csv +++ b/python/subunit/filter_scripts/subunit2csv.py @@ -22,5 +22,10 @@ from subunit.filters import run_filter_script from subunit.test_results import CsvResult -run_filter_script(lambda output:StreamToExtendedDecorator(CsvResult(output)), - __doc__, protocol_version=2) +def main(): + run_filter_script(lambda output: StreamToExtendedDecorator( + CsvResult(output)), __doc__, protocol_version=2) + + +if __name__ == '__main__': + main() diff --git a/filters/subunit2disk b/python/subunit/filter_scripts/subunit2disk.py index c1d2e1a..fea2f0e 100755 --- a/filters/subunit2disk +++ b/python/subunit/filter_scripts/subunit2disk.py @@ -16,8 +16,14 @@ """Export a stream to files and directories on disk.""" +import sys + from subunit._to_disk import to_disk +def main(): + sys.exit(to_disk()) + + if __name__ == '__main__': - exit(to_disk()) + main() diff --git a/filters/subunit2gtk b/python/subunit/filter_scripts/subunit2gtk.py index 5c0ebe3..110f2f0 100755 --- a/filters/subunit2gtk +++ b/python/subunit/filter_scripts/subunit2gtk.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -16,28 +16,28 @@ ### The GTK progress bar __init__ function is derived from the pygtk tutorial: # The PyGTK Tutorial is Copyright (C) 2001-2005 John Finlay. -# +# # The GTK Tutorial is Copyright (C) 1997 Ian Main. -# +# # Copyright (C) 1998-1999 Tony Gale. -# +# # Permission is granted to make and distribute verbatim copies of this manual # provided the copyright notice and this permission notice are preserved on all # copies. -# +# # Permission is granted to copy and distribute modified versions of this # document under the conditions for verbatim copying, provided that this # copyright notice is included exactly as in the original, and that the entire # resulting derived work is distributed under the terms of a permission notice # identical to this one. -# +# # Permission is granted to copy and distribute translations of this document # into another language, under the above conditions for modified versions. -# +# # If you are intending to incorporate this document into a published work, # please contact the maintainer, and we will make an effort to ensure that you # have the most up to date information available. -# +# # There is no guarantee that this document lives up to its intended purpose. # This is simply provided as a free resource. As such, the authors and # maintainers of the information provided within can not make any guarantee @@ -218,23 +218,30 @@ class GTKTestResult(unittest.TestResult): self.ok_label.set_text(str(self.testsRun - bad)) self.not_ok_label.set_text(str(bad)) -GObject.threads_init() -result = StreamToExtendedDecorator(GTKTestResult()) -test = ByteStreamToStreamResult(sys.stdin, non_subunit_name='stdout') -# Get setup -while Gtk.events_pending(): - Gtk.main_iteration() -# Start IO -def run_and_finish(): - test.run(result) - result.stopTestRun() -t = threading.Thread(target=run_and_finish) -t.daemon = True -result.startTestRun() -t.start() -Gtk.main() -if result.decorated.wasSuccessful(): - exit_code = 0 -else: - exit_code = 1 -sys.exit(exit_code) + +def main(): + GObject.threads_init() + result = StreamToExtendedDecorator(GTKTestResult()) + test = ByteStreamToStreamResult(sys.stdin, non_subunit_name='stdout') + # Get setup + while Gtk.events_pending(): + Gtk.main_iteration() + + # Start IO + def run_and_finish(): + test.run(result) + result.stopTestRun() + t = threading.Thread(target=run_and_finish) + t.daemon = True + result.startTestRun() + t.start() + Gtk.main() + if result.decorated.wasSuccessful(): + exit_code = 0 + else: + exit_code = 1 + sys.exit(exit_code) + + +if __name__ == '__main__': + main() diff --git a/filters/subunit2junitxml b/python/subunit/filter_scripts/subunit2junitxml.py index 8e827d5..89167b5 100755 --- a/filters/subunit2junitxml +++ b/python/subunit/filter_scripts/subunit2junitxml.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -31,6 +31,11 @@ except ImportError: raise -run_filter_script( - lambda output:StreamToExtendedDecorator(JUnitXmlResult(output)), __doc__, - protocol_version=2) +def main(): + run_filter_script( + lambda output: StreamToExtendedDecorator( + JUnitXmlResult(output)), __doc__, protocol_version=2) + + +if __name__ == '__main__': + main() diff --git a/python/subunit/filter_scripts/subunit2pyunit.py b/python/subunit/filter_scripts/subunit2pyunit.py new file mode 100755 index 0000000..2a040ec --- /dev/null +++ b/python/subunit/filter_scripts/subunit2pyunit.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# subunit: extensions to python unittest to get test results from subprocesses. +# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net> +# +# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause +# license at the users choice. A copy of both licenses are available in the +# project source as Apache-2.0 and BSD. You may not use this file except in +# compliance with one of these two licences. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# license you chose for the specific language governing permissions and +# limitations under that license. +# + +"""Display a subunit stream through python's unittest test runner.""" + +from operator import methodcaller +from optparse import OptionParser +import sys +import unittest + +from testtools import StreamToExtendedDecorator, DecorateTestCaseResult, StreamResultRouter + +from subunit import ByteStreamToStreamResult +from subunit.filters import find_stream +from subunit.test_results import CatFiles + + +def main(): + parser = OptionParser(description=__doc__) + parser.add_option("--no-passthrough", action="store_true", + help="Hide all non subunit input.", + default=False, dest="no_passthrough") + parser.add_option("--progress", action="store_true", + help="Use bzrlib's test reporter (requires bzrlib)", + default=False) + (options, args) = parser.parse_args() + test = ByteStreamToStreamResult( + find_stream(sys.stdin, args), non_subunit_name='stdout') + + def wrap_result(result): + result = StreamToExtendedDecorator(result) + if not options.no_passthrough: + result = StreamResultRouter(result) + result.add_rule(CatFiles(sys.stdout), 'test_id', test_id=None) + return result + test = DecorateTestCaseResult(test, wrap_result, + before_run=methodcaller('startTestRun'), + after_run=methodcaller('stopTestRun')) + if options.progress: + from bzrlib.tests import TextTestRunner + from bzrlib import ui + ui.ui_factory = ui.make_ui_for_terminal(None, sys.stdout, sys.stderr) + runner = TextTestRunner() + else: + runner = unittest.TextTestRunner(verbosity=2) + if runner.run(test).wasSuccessful(): + exit_code = 0 + else: + exit_code = 1 + sys.exit(exit_code) + + +if __name__ == '__main__': + main() diff --git a/filters/subunit-1to2 b/python/subunit/filter_scripts/subunit_1to2.py index 9725820..d59447b 100755 --- a/filters/subunit-1to2 +++ b/python/subunit/filter_scripts/subunit_1to2.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/filters/subunit-2to1 b/python/subunit/filter_scripts/subunit_2to1.py index d358f66..ed9f26e 100755 --- a/filters/subunit-2to1 +++ b/python/subunit/filter_scripts/subunit_2to1.py @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -25,7 +25,7 @@ from testtools import ( ) from subunit import ByteStreamToStreamResult, TestProtocolClient -from subunit.filters import find_stream, run_tests_from_stream +from subunit.filters import find_stream from subunit.test_results import CatFiles diff --git a/filters/subunit-filter b/python/subunit/filter_scripts/subunit_filter.py index 7314531..0f45b88 100755 --- a/filters/subunit-filter +++ b/python/subunit/filter_scripts/subunit_filter.py @@ -7,7 +7,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -33,8 +33,6 @@ import re from testtools import ExtendedToStreamDecorator, StreamToExtendedDecorator from subunit import ( - DiscardStream, - ProtocolTestCase, StreamResultToBytes, read_test_list, ) @@ -143,7 +141,7 @@ def _make_result(output, options, predicate): fixup_expected_failures.update(read_test_list(path)) return StreamToExtendedDecorator(TestResultFilter( ExtendedToStreamDecorator( - StreamResultToBytes(output)), + StreamResultToBytes(output)), filter_error=options.error, filter_failure=options.failure, filter_success=options.success, diff --git a/python/subunit/filter_scripts/subunit_ls.py b/python/subunit/filter_scripts/subunit_ls.py new file mode 100755 index 0000000..0eee267 --- /dev/null +++ b/python/subunit/filter_scripts/subunit_ls.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# subunit: extensions to python unittest to get test results from subprocesses. +# Copyright (C) 2008 Robert Collins <robertc@robertcollins.net> +# +# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause +# license at the users choice. A copy of both licenses are available in the +# project source as Apache-2.0 and BSD. You may not use this file except in +# compliance with one of these two licences. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# license you chose for the specific language governing permissions and +# limitations under that license. +# + +"""List tests in a subunit stream.""" + +from optparse import OptionParser +import sys + +from testtools import ( + CopyStreamResult, StreamResultRouter, + StreamSummary) + +from subunit import ByteStreamToStreamResult +from subunit.filters import find_stream +from subunit.test_results import ( + CatFiles, + TestIdPrintingResult, + ) + + +def main(): + parser = OptionParser(description=__doc__) + parser.add_option("--times", action="store_true", + help="list the time each test took (requires a timestamped stream)", + default=False) + parser.add_option("--exists", action="store_true", + help="list tests that are reported as existing (as well as ran)", + default=False) + parser.add_option("--no-passthrough", action="store_true", + help="Hide all non subunit input.", default=False, dest="no_passthrough") + (options, args) = parser.parse_args() + test = ByteStreamToStreamResult( + find_stream(sys.stdin, args), non_subunit_name="stdout") + result = TestIdPrintingResult(sys.stdout, options.times, options.exists) + if not options.no_passthrough: + result = StreamResultRouter(result) + cat = CatFiles(sys.stdout) + result.add_rule(cat, 'test_id', test_id=None) + summary = StreamSummary() + result = CopyStreamResult([result, summary]) + result.startTestRun() + test.run(result) + result.stopTestRun() + if summary.wasSuccessful(): + exit_code = 0 + else: + exit_code = 1 + sys.exit(exit_code) + + +if __name__ == '__main__': + main() diff --git a/filters/subunit-notify b/python/subunit/filter_scripts/subunit_notify.py index 71da071..af04327 100755 --- a/filters/subunit-notify +++ b/python/subunit/filter_scripts/subunit_notify.py @@ -43,6 +43,11 @@ def notify_of_result(result): nw.show() -run_filter_script( - lambda output:StreamToExtendedDecorator(TestResultStats(output)), - __doc__, notify_of_result, protocol_version=2) +def main(): + run_filter_script( + lambda output:StreamToExtendedDecorator(TestResultStats(output)), + __doc__, notify_of_result, protocol_version=2) + + +if __name__ == '__main__': + main() diff --git a/filters/subunit-output b/python/subunit/filter_scripts/subunit_output.py index 61e5d11..d377092 100755 --- a/filters/subunit-output +++ b/python/subunit/filter_scripts/subunit_output.py @@ -16,8 +16,13 @@ """A command-line tool to generate a subunit result byte-stream.""" +import sys + from subunit._output import output_main +def main(): + sys.exit(output_main()) + if __name__ == '__main__': - exit(output_main()) + main() diff --git a/filters/subunit-stats b/python/subunit/filter_scripts/subunit_stats.py index 79733b0..a152250 100755 --- a/filters/subunit-stats +++ b/python/subunit/filter_scripts/subunit_stats.py @@ -24,9 +24,15 @@ from subunit import TestResultStats from subunit.filters import run_filter_script -result = TestResultStats(sys.stdout) -def show_stats(r): - r.decorated.formatStats() -run_filter_script( - lambda output:StreamToExtendedDecorator(result), - __doc__, show_stats, protocol_version=2, passthrough_subunit=False) +def main(): + result = TestResultStats(sys.stdout) + + def show_stats(r): + r.decorated.formatStats() + + run_filter_script( + lambda output:StreamToExtendedDecorator(result), + __doc__, show_stats, protocol_version=2, passthrough_subunit=False) + +if __name__ == '__main__': + main() diff --git a/filters/subunit-tags b/python/subunit/filter_scripts/subunit_tags.py index 1022492..e2b40d6 100755 --- a/filters/subunit-tags +++ b/python/subunit/filter_scripts/subunit_tags.py @@ -24,4 +24,10 @@ import sys from subunit import tag_stream -sys.exit(tag_stream(sys.stdin, sys.stdout, sys.argv[1:])) + +def main(): + sys.exit(tag_stream(sys.stdin, sys.stdout, sys.argv[1:])) + + +if __name__ == '__main__': + main() diff --git a/filters/tap2subunit b/python/subunit/filter_scripts/tap2subunit.py index c571972..4263335 100755 --- a/filters/tap2subunit +++ b/python/subunit/filter_scripts/tap2subunit.py @@ -23,4 +23,11 @@ http://testanything.org/wiki/index.php/Main_Page. import sys from subunit import TAP2SubUnit -sys.exit(TAP2SubUnit(sys.stdin, sys.stdout)) + + +def main(): + sys.exit(TAP2SubUnit(sys.stdin, sys.stdout)) + + +if __name__ == '__main__': + main() diff --git a/python/subunit/tests/test_subunit_filter.py b/python/subunit/tests/test_subunit_filter.py index 95aea36..507bcb7 100644 --- a/python/subunit/tests/test_subunit_filter.py +++ b/python/subunit/tests/test_subunit_filter.py @@ -304,10 +304,7 @@ xfail todo class TestFilterCommand(TestCase): def run_command(self, args, stream): - root = os.path.dirname( - os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) - script_path = os.path.join(root, 'filters', 'subunit-filter') - command = [sys.executable, script_path] + list(args) + command = ['subunit-filter'] + list(args) ps = subprocess.Popen( command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -1,29 +1,6 @@ #!/usr/bin/env python import os.path -try: - # If the user has setuptools / distribute installed, use it - from setuptools import setup -except ImportError: - # Otherwise, fall back to distutils. - from distutils.core import setup - extra = {} -else: - extra = { - 'install_requires': [ - 'extras', - 'testtools>=0.9.34', - ], - 'tests_require': [ - 'fixtures', - 'hypothesis', - 'testscenarios', - ], - 'extras_require': { - 'docs': ['docutils'], - 'test': ['fixtures', 'testscenarios'], - 'test:python_version!="3.2"': ['hypothesis'], - }, - } +from setuptools import setup def _get_version_from_file(filename, start_of_line, split_marker): @@ -73,24 +50,40 @@ setup( "Bug Tracker": "https://bugs.launchpad.net/subunit", "Source Code": "https://github.com/testing-cabal/subunit/", }, - packages=['subunit', 'subunit.tests'], + packages=['subunit', 'subunit.tests', 'subunit.filter_scripts'], + package_dir={'subunit': 'python/subunit'}, - scripts = [ - '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/subunit2csv', - 'filters/subunit2disk', - 'filters/subunit2gtk', - 'filters/subunit2junitxml', - 'filters/subunit2pyunit', - 'filters/tap2subunit', + entry_points={ + 'console_scripts': [ + 'subunit-1to2=subunit.filter_scripts.subunit_1to2:main', + 'subunit-2to1=subunit.filter_scripts.subunit_2to1:main', + 'subunit-filter=subunit.filter_scripts.subunit_filter:main', + 'subunit-ls=subunit.filter_scripts.subunit_ls:main', + 'subunit-notify=subunit.filter_scripts.subunit_notify:main', + 'subunit-output=subunit.filter_scripts.subunit_output:main', + 'subunit-stats=subunit.filter_scripts.subunit_stats:main', + 'subunit-tags=subunit.filter_scripts.subunit_tags:main', + 'subunit2csv=subunit.filter_scripts.subunit2csv:main', + 'subunit2disk=subunit.filter_scripts.subunit2disk:main', + 'subunit2gtk=subunit.filter_scripts.subunit2gtk:main', + 'subunit2junitxml=subunit.filter_scripts.subunit2junitxml:main', + 'subunit2pyunit=subunit.filter_scripts.subunit2pyunit:main', + 'tap2subunit=subunit.filter_scripts.tap2subunit:main', + ] + }, + install_requires=[ + 'extras', + 'testtools>=0.9.34', ], + tests_require=[ + 'fixtures', + 'hypothesis', + 'testscenarios', + ], + extras_require={ + 'docs': ['docutils'], + 'test': ['fixtures', 'testscenarios'], + 'test:python_version!="3.2"': ['hypothesis'], + } python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", - **extra ) |