diff --git a/IPython/testing/iptest.py b/IPython/testing/iptest.py index ecc1ee457..ef6f6376c 100644 --- a/IPython/testing/iptest.py +++ b/IPython/testing/iptest.py @@ -42,12 +42,6 @@ from IPython.external.decorators import KnownFailure, knownfailureif pjoin = path.join - -#----------------------------------------------------------------------------- -# Globals -#----------------------------------------------------------------------------- - - #----------------------------------------------------------------------------- # Warnings control #----------------------------------------------------------------------------- @@ -127,7 +121,7 @@ have = {} have['curses'] = test_for('_curses') have['matplotlib'] = test_for('matplotlib') have['numpy'] = test_for('numpy') -have['pexpect'] = test_for('IPython.external.pexpect') +have['pexpect'] = test_for('pexpect') have['pymongo'] = test_for('pymongo') have['pygments'] = test_for('pygments') have['qt'] = test_for('IPython.external.qt') diff --git a/setup.py b/setup.py index d57540d28..a2887bd74 100755 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ from setupbase import ( find_entry_points, build_scripts_entrypt, find_data_files, - check_for_dependencies, + check_for_readline, git_prebuild, check_submodule_status, update_submodules, @@ -78,7 +78,6 @@ from setupbase import ( install_scripts_for_symlink, unsymlink, ) -from setupext import setupext isfile = os.path.isfile pjoin = os.path.join @@ -268,14 +267,22 @@ if sys.version_info < (3, 3): extras_require['notebook'].extend(extras_require['nbformat']) extras_require['nbconvert'].extend(extras_require['nbformat']) -install_requires = [] +install_requires = [ + 'decorator', + 'pickleshare', + 'simplegeneric>0.8', +] -# add readline +# add platform-specific dependencies if sys.platform == 'darwin': - if 'bdist_wheel' in sys.argv[1:] or not setupext.check_for_readline(): + install_requires.append('appnope') + if 'bdist_wheel' in sys.argv[1:] or not check_for_readline(): install_requires.append('gnureadline') -elif sys.platform.startswith('win'): + +if sys.platform.startswith('win'): extras_require['terminal'].append('pyreadline>=2.0') +else: + install_requires.append('pexpect') everything = set() for deps in extras_require.values(): @@ -317,13 +324,6 @@ if 'setuptools' in sys.modules: "ipython_win_post_install.py"}} else: - # If we are installing without setuptools, call this function which will - # check for dependencies an inform the user what is needed. This is - # just to make life easy for users. - for install_cmd in ('install', 'symlink'): - if install_cmd in sys.argv: - check_for_dependencies() - break # scripts has to be a non-empty list, or install_scripts isn't called setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] diff --git a/setupbase.py b/setupbase.py index 4fe466657..956a51e5a 100644 --- a/setupbase.py +++ b/setupbase.py @@ -490,37 +490,23 @@ class install_scripts_for_symlink(install_scripts): # Verify all dependencies #--------------------------------------------------------------------------- -def check_for_dependencies(): - """Check for IPython's dependencies. - - This function should NOT be called if running under setuptools! - """ - from setupext.setupext import ( - print_line, print_raw, print_status, - check_for_sphinx, check_for_pygments, - check_for_nose, check_for_pexpect, - check_for_pyzmq, check_for_readline, - check_for_jinja2, check_for_tornado - ) - print_line() - print_raw("BUILDING IPYTHON") - print_status('python', sys.version) - print_status('platform', sys.platform) - if sys.platform == 'win32': - print_status('Windows version', sys.getwindowsversion()) - - print_raw("") - print_raw("OPTIONAL DEPENDENCIES") - - check_for_sphinx() - check_for_pygments() - check_for_nose() - if os.name == 'posix': - check_for_pexpect() - check_for_pyzmq() - check_for_tornado() - check_for_readline() - check_for_jinja2() +def check_for_readline(): + """Check for GNU readline""" + try: + import gnureadline as readline + except ImportError: + pass + else: + return True + try: + import readline + except ImportError: + return False + else: + if sys.platform == 'darwin' and 'libedit' in readline.__doc__: + print("Ignoring readline linked to libedit", file=sys.stderr) + return False + return True #--------------------------------------------------------------------------- # VCS related @@ -670,7 +656,7 @@ def get_bdist_wheel(): if found: lis.pop(idx) - for pkg in ("gnureadline", "pyreadline", "mock", "terminado"): + for pkg in ("gnureadline", "pyreadline", "mock", "terminado", "appnope", "pexpect"): _remove_startswith(requires, pkg) requires.append("gnureadline; sys.platform == 'darwin' and platform.python_implementation == 'CPython'") requires.append("terminado (>=0.3.3); extra == 'notebook' and sys.platform != 'win32'") @@ -678,6 +664,8 @@ def get_bdist_wheel(): requires.append("pyreadline (>=2.0); extra == 'terminal' and sys.platform == 'win32' and platform.python_implementation == 'CPython'") requires.append("pyreadline (>=2.0); extra == 'all' and sys.platform == 'win32' and platform.python_implementation == 'CPython'") requires.append("mock; extra == 'test' and python_version < '3.3'") + requires.append("appnope; sys.platform == 'darwin'") + requires.append("pexpect; sys.platform != 'win32'") for r in requires: pkg_info['Requires-Dist'] = r write_pkg_info(metadata_path, pkg_info)