Skip to content
Browse files

make readline a dependency on OSX and pyreadline on Windows

closes gh-343
  • Loading branch information...
1 parent 0c41d1b commit 2836f0cfd5b37bf56c073effaf5a5996df18f5e3 @minrk committed Apr 8, 2011
Showing with 22 additions and 2 deletions.
  1. +5 −0 setup.py
  2. +2 −2 setupbase.py
  3. +15 −0 setupext/setupext.py
View
5 setup.py
@@ -218,6 +218,11 @@ def cleanup():
doc='Sphinx>=0.3',
test='nose>=0.10.1',
)
+ requires = setup_args.setdefault('install_requires', [])
+ if sys.platform == 'darwin':
+ requires.append('readline')
+ elif sys.platform.startswith('win'):
+ requires.append('pyreadline')
# Script to be run by the windows binary installer after the default setup
# routine, to add shortcuts and similar windows-only things. Windows
View
4 setupbase.py
@@ -310,7 +310,7 @@ def check_for_dependencies():
print_line, print_raw, print_status,
check_for_sphinx, check_for_pygments,
check_for_nose, check_for_pexpect,
- check_for_pyzmq
+ check_for_pyzmq, check_for_readline
)
print_line()
print_raw("BUILDING IPYTHON")
@@ -327,7 +327,7 @@ def check_for_dependencies():
check_for_nose()
check_for_pexpect()
check_for_pyzmq()
-
+ check_for_readline()
def record_commit_info(pkg_dir, build_cmd=build_py):
""" Return extended build command class for recording commit
View
15 setupext/setupext.py
@@ -140,3 +140,18 @@ def check_for_pyzmq():
print_status("pyzmq", zmq.__version__)
return True
+def check_for_readline():
+ try:
+ import readline
+ except ImportError:
+ try:
+ import pyreadline
+ except ImportError:
+ print_status('readline', "no (required for good interactive behavior)")
+ return False
+ else:
+ print_status('readline', "yes pyreadline-"+pyreadline.release.version)
+ return True
+ else:
+ print_status('readline', "yes")
+ return True

0 comments on commit 2836f0c

Please sign in to comment.
Something went wrong with that request. Please try again.