From 64b6a62990f9fe4504c96d74b1c6592d9f1df56b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Apr 2013 19:26:41 +0100 Subject: [PATCH] Make 'setup.py test' and 'setup.py trial' work. Signed-off-by: Daira Hopwood --- setup.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 070f163f..5c56a84a 100755 --- a/setup.py +++ b/setup.py @@ -63,6 +63,24 @@ pass if have_setuptools: + from setuptools import Command + + class Trial(Command): + description = "run trial" + user_options = [] + + def initialize_options(self): + pass + def finalize_options(self): + pass + def run(self): + import sys + from twisted.scripts import trial + sys.argv = ['trial', '--rterrors', 'foolscap.test'] + trial.run() # does not return + + setup_args['cmdclass'] = {"trial": Trial, "test": Trial} + import platform if platform.system() == "Windows": del setup_args["scripts"] @@ -71,7 +89,7 @@ "flappserver = foolscap.appserver.cli:run_flappserver", "flappclient = foolscap.appserver.client:run_flappclient", ] } - setup_args['install_requires'] = ['twisted >= 2.4.0'] + setup_args['install_requires'] = setup_args['tests_require'] = ['twisted >= 12.1.0'] # note that pyOpenSSL-0.7 and recent Twisted causes unit test failures, # see bug #62