Skip to content

Commit

Permalink
2to3:DEP: Remove interactive setup and gnu compiler configuration.
Browse files Browse the repository at this point in the history
These havn't been deprecated, but I think few have heard of them, much
less used them. Before this change, running setup.py without any
arguments would result in interactive help. This patch removes that
interactive help and lets setup print its usual list of commands and
options.

All the script uses of the numpy/distutils/fcompiler compilers look
quite broken to me, but I have tried to maintain compatibility with the
earlier version of gnu.py after the removal of `raw_input`.

These removals solve an incompatibility between Python3 and Python2.
The current interactive setup help uses `raw_input`, which has been
removed in python3 and replaced by `input`.  However, python2 already
has an `input` that has different semantics.  Rather than deal with
this, I think it simpler to keep both `raw_input` and `input` out of
numpy.

Closes #3063
Closes #3079
  • Loading branch information
charris committed Mar 5, 2013
1 parent 3ba223e commit baeaeac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 209 deletions.
16 changes: 0 additions & 16 deletions numpy/distutils/core.py
Expand Up @@ -104,24 +104,8 @@ def get_distribution(always=False):
dist = NumpyDistribution()
return dist

def _exit_interactive_session(_cache=[]):
if _cache:
return # been here
_cache.append(1)
print('-'*72)
raw_input('Press ENTER to close the interactive session..')
print('='*72)

def setup(**attr):

if len(sys.argv)<=1 and not attr.get('script_args',[]):
from interactive import interactive_sys_argv
import atexit
atexit.register(_exit_interactive_session)
sys.argv[:] = interactive_sys_argv(sys.argv)
if len(sys.argv)>1:
return setup(**attr)

cmdclass = numpy_cmdclass.copy()

new_attr = attr.copy()
Expand Down
4 changes: 2 additions & 2 deletions numpy/distutils/fcompiler/gnu.py
Expand Up @@ -372,15 +372,15 @@ def _can_target(cmd, arch):
if __name__ == '__main__':
from distutils import log
log.set_verbosity(2)

compiler = GnuFCompiler()
compiler.customize()
print(compiler.get_version())
raw_input('Press ENTER to continue...')

try:
compiler = Gnu95FCompiler()
compiler.customize()
print(compiler.get_version())
except Exception:
msg = get_exception()
print(msg)
raw_input('Press ENTER to continue...')
190 changes: 0 additions & 190 deletions numpy/distutils/interactive.py

This file was deleted.

4 changes: 3 additions & 1 deletion tools/py3tool.py
Expand Up @@ -76,7 +76,9 @@
'execfile',
'exec',
'callable',
'apply'
'apply',
'input',
'raw_input'
]

skip_fixes= []
Expand Down

0 comments on commit baeaeac

Please sign in to comment.