From ab110a4113f5e8672d80c5845178268774b7ea23 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 14 Oct 2012 12:59:59 +0200 Subject: Add build to TestCommand's sub_commands ... and run the sub_commands in TestCommand.run. So if python setup.py test is executed before ever running the build target, the extension modules are built. Bug: https://bugs.launchpad.net/pycrypto/+bug/1055256 Bug: https://bugs.launchpad.net/pycrypto/+bug/976171 --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 0334939..c36efc2 100644 --- a/setup.py +++ b/setup.py @@ -318,6 +318,10 @@ class TestCommand(Command): self.config = {'slow_tests': not self.skip_slow_tests} def run(self): + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + # Run SelfTest self.announce("running self-tests") old_path = sys.path[:] @@ -346,6 +350,8 @@ class TestCommand(Command): # Run slower self-tests self.announce("running extended self-tests") + sub_commands = [ ('build', None) ] + kw = {'name':"pycrypto", 'version':"2.6", # See also: lib/Crypto/__init__.py 'description':"Cryptographic modules for Python.", -- cgit v1.2.1