From 8a31e29feafddc3c29bf1ca8ee378fb7b69c67b7 Mon Sep 17 00:00:00 2001 From: Pearu Peterson Date: Wed, 19 Apr 2006 18:58:30 +0000 Subject: New feature: interactively set sys.argv when setup.py is called without arguments. At the moment the feature only can show system/platform/fcompiler information.. --- numpy/distutils/core.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'numpy/distutils/core.py') diff --git a/numpy/distutils/core.py b/numpy/distutils/core.py index 6f4ab007f..bdc55a8ab 100644 --- a/numpy/distutils/core.py +++ b/numpy/distutils/core.py @@ -1,4 +1,5 @@ +import sys from distutils.core import * try: from setuptools import setup as old_setup @@ -90,6 +91,11 @@ def _command_line_ok(_cache=[]): def setup(**attr): + interactive = len(sys.argv)<=1 + if interactive: + from interactive import interactive_sys_argv + sys.argv[:] = interactive_sys_argv(sys.argv) + cmdclass = numpy_cmdclass.copy() new_attr = attr.copy() @@ -150,7 +156,19 @@ def setup(**attr): and not new_attr.has_key('headers'): new_attr['headers'] = [] - return old_setup(**new_attr) + if interactive: + try: + r = old_setup(**new_attr) + except Exception, msg: + print '-'*72 + print 'setup failed with:',msg + raw_input('Press ENTER to close the interactive session..') + raise msg + print '-'*72 + raw_input('Press ENTER to close the interactive session..') + print '='*72 + else: + return old_setup(**new_attr) def _check_append_library(libraries, item): import warnings -- cgit v1.2.1