##// END OF EJS Templates
Merge pull request #6662 from minrk/dependencies...
Thomas Kluyver -
r20848:e94a8ddf merge
parent child Browse files
Show More
@@ -14,7 +14,7 b' import sys'
14 14 from copy import deepcopy
15 15 from collections import defaultdict
16 16
17 from IPython.external.decorator import decorator
17 from decorator import decorator
18 18
19 19 from IPython.config.configurable import SingletonConfigurable
20 20 from IPython.config.loader import (
@@ -17,7 +17,7 b' import sys'
17 17 import traceback
18 18 import warnings
19 19
20 from IPython.external.decorator import decorator
20 from decorator import decorator
21 21
22 22 from IPython.config.configurable import Configurable
23 23 from IPython.core.getipython import get_ipython
@@ -28,7 +28,7 b' import threading'
28 28
29 29 # Our own packages
30 30 from IPython.config.configurable import Configurable
31 from IPython.external.decorator import decorator
31 from decorator import decorator
32 32 from IPython.utils.decorators import undoc
33 33 from IPython.utils.path import locate_profile
34 34 from IPython.utils import py3compat
@@ -27,6 +27,8 b' import types'
27 27 import subprocess
28 28 from io import open as io_open
29 29
30 from pickleshare import PickleShareDB
31
30 32 from IPython.config.configurable import SingletonConfigurable
31 33 from IPython.core import debugger, oinspect
32 34 from IPython.core import magic
@@ -63,7 +65,6 b' from IPython.utils.decorators import undoc'
63 65 from IPython.utils.io import ask_yes_no
64 66 from IPython.utils.ipstruct import Struct
65 67 from IPython.utils.path import get_home_dir, get_ipython_dir, get_py_filename, unquote_filename, ensure_dir_exists
66 from IPython.utils.pickleshare import PickleShareDB
67 68 from IPython.utils.process import system, getoutput
68 69 from IPython.utils.py3compat import (builtin_mod, unicode_type, string_types,
69 70 with_metaclass, iteritems)
@@ -27,7 +27,7 b' from IPython.config.configurable import Configurable'
27 27 from IPython.core import oinspect
28 28 from IPython.core.error import UsageError
29 29 from IPython.core.inputsplitter import ESC_MAGIC, ESC_MAGIC2
30 from IPython.external.decorator import decorator
30 from decorator import decorator
31 31 from IPython.utils.ipstruct import Struct
32 32 from IPython.utils.process import arg_split
33 33 from IPython.utils.py3compat import string_types, iteritems
@@ -26,7 +26,7 b' from IPython.core.magic import (Magics, magics_class, line_magic,'
26 26 cell_magic, line_cell_magic,
27 27 register_line_magic, register_cell_magic,
28 28 register_line_cell_magic)
29 from IPython.external.decorator import decorator
29 from decorator import decorator
30 30 from IPython.testing.decorators import skipif
31 31 from IPython.testing.tools import AssertPrints
32 32 from IPython.utils.path import compress_user
@@ -73,7 +73,7 b' from IPython.testing.skipdoctest import skip_doctest'
73 73 from IPython.core.magic_arguments import (
74 74 argument, magic_arguments, parse_argstring
75 75 )
76 from IPython.external.simplegeneric import generic
76 from simplegeneric import generic
77 77 from IPython.utils.py3compat import (str_to_unicode, unicode_to_str, PY3,
78 78 unicode_type)
79 79 from IPython.utils.text import dedent
@@ -11,19 +11,14 b' import zmq'
11 11
12 12 from IPython.config.application import Application
13 13 from IPython.utils import io
14
15
16 def _on_os_x_10_9():
17 import platform
18 from distutils.version import LooseVersion as V
19 return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9')
14 from IPython.lib.inputhook import _use_appnope
20 15
21 16 def _notify_stream_qt(kernel, stream):
22 17
23 18 from IPython.external.qt_for_kernel import QtCore
24 19
25 if _on_os_x_10_9() and kernel._darwin_app_nap:
26 from IPython.external.appnope import nope_scope as context
20 if _use_appnope() and kernel._darwin_app_nap:
21 from appnope import nope_scope as context
27 22 else:
28 23 from IPython.core.interactiveshell import NoOpContext as context
29 24
@@ -93,10 +88,10 b' def loop_wx(kernel):'
93 88 import wx
94 89 from IPython.lib.guisupport import start_event_loop_wx
95 90
96 if _on_os_x_10_9() and kernel._darwin_app_nap:
91 if _use_appnope() and kernel._darwin_app_nap:
97 92 # we don't hook up App Nap contexts for Wx,
98 93 # just disable it outright.
99 from IPython.external.appnope import nope
94 from appnope import nope
100 95 nope()
101 96
102 97 doi = kernel.do_one_iteration
@@ -3,16 +3,8 b''
3 3 Inputhook management for GUI event loop integration.
4 4 """
5 5
6 #-----------------------------------------------------------------------------
7 # Copyright (C) 2008-2011 The IPython Development Team
8 #
9 # Distributed under the terms of the BSD License. The full license is in
10 # the file COPYING, distributed as part of this software.
11 #-----------------------------------------------------------------------------
12
13 #-----------------------------------------------------------------------------
14 # Imports
15 #-----------------------------------------------------------------------------
6 # Copyright (c) IPython Development Team.
7 # Distributed under the terms of the Modified BSD License.
16 8
17 9 try:
18 10 import ctypes
@@ -21,6 +13,7 b' except ImportError:'
21 13 except SystemError: # IronPython issue, 2/8/2014
22 14 ctypes = None
23 15 import os
16 import platform
24 17 import sys
25 18 from distutils.version import LooseVersion as V
26 19
@@ -57,8 +50,14 b' def _stdin_ready_nt():'
57 50
58 51 def _stdin_ready_other():
59 52 """Return True, assuming there's something to read on stdin."""
60 return True #
53 return True
54
55 def _use_appnope():
56 """Should we use appnope for dealing with OS X app nap?
61 57
58 Checks if we are on OS X 10.9 or greater.
59 """
60 return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9')
62 61
63 62 def _ignore_CTRL_C_posix():
64 63 """Ignore CTRL+C (SIGINT)."""
@@ -317,9 +316,10 b' class WxInputHook(InputHookBase):'
317 316 raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)
318 317
319 318 from IPython.lib.inputhookwx import inputhook_wx
320 from IPython.external.appnope import nope
321 319 self.manager.set_inputhook(inputhook_wx)
322 nope()
320 if _use_appnope():
321 from appnope import nope
322 nope()
323 323
324 324 import wx
325 325 if app is None:
@@ -334,8 +334,9 b' class WxInputHook(InputHookBase):'
334 334
335 335 This restores appnapp on OS X
336 336 """
337 from IPython.external.appnope import nap
338 nap()
337 if _use_appnope():
338 from appnope import nap
339 nap()
339 340
340 341 @inputhook_manager.register('qt', 'qt4')
341 342 class Qt4InputHook(InputHookBase):
@@ -362,10 +363,11 b' class Qt4InputHook(InputHookBase):'
362 363 app = QtGui.QApplication(sys.argv)
363 364 """
364 365 from IPython.lib.inputhookqt4 import create_inputhook_qt4
365 from IPython.external.appnope import nope
366 app, inputhook_qt4 = create_inputhook_qt4(self.manager, app)
366 app, inputhook_qt4 = create_inputhook_qt4(self, app)
367 367 self.manager.set_inputhook(inputhook_qt4)
368 nope()
368 if _use_appnope():
369 from appnope import nope
370 nope()
369 371
370 372 return app
371 373
@@ -374,8 +376,9 b' class Qt4InputHook(InputHookBase):'
374 376
375 377 This restores appnapp on OS X
376 378 """
377 from IPython.external.appnope import nap
378 nap()
379 if _use_appnope():
380 from appnope import nap
381 nap()
379 382
380 383
381 384 @inputhook_manager.register('qt5')
@@ -12,7 +12,7 b' from datetime import datetime'
12 12 from zmq import MessageTracker
13 13
14 14 from IPython.core.display import clear_output, display, display_pretty
15 from IPython.external.decorator import decorator
15 from decorator import decorator
16 16 from IPython.parallel import error
17 17 from IPython.utils.py3compat import string_types
18 18
@@ -31,7 +31,7 b' from IPython.utils.path import get_ipython_dir, compress_user'
31 31 from IPython.utils.py3compat import cast_bytes, string_types, xrange, iteritems
32 32 from IPython.utils.traitlets import (HasTraits, Integer, Instance, Unicode,
33 33 Dict, List, Bool, Set, Any)
34 from IPython.external.decorator import decorator
34 from decorator import decorator
35 35
36 36 from IPython.parallel import Reference
37 37 from IPython.parallel import error
@@ -8,7 +8,7 b' from __future__ import division'
8 8 import sys
9 9 import warnings
10 10
11 from IPython.external.decorator import decorator
11 from decorator import decorator
12 12 from IPython.testing.skipdoctest import skip_doctest
13 13
14 14 from . import map as Map
@@ -18,7 +18,7 b' from IPython.utils import pickleutil'
18 18 from IPython.utils.traitlets import (
19 19 HasTraits, Any, Bool, List, Dict, Set, Instance, CFloat, Integer
20 20 )
21 from IPython.external.decorator import decorator
21 from decorator import decorator
22 22
23 23 from IPython.parallel import util
24 24 from IPython.parallel.controller.dependency import Dependency, dependent
@@ -26,7 +26,7 b' import zmq'
26 26 from zmq.eventloop import ioloop, zmqstream
27 27
28 28 # local imports
29 from IPython.external.decorator import decorator
29 from decorator import decorator
30 30 from IPython.config.application import Application
31 31 from IPython.config.loader import Config
32 32 from IPython.utils.traitlets import Instance, Dict, List, Set, Integer, Enum, CBytes
@@ -22,7 +22,7 b' from nose import SkipTest'
22 22 import zmq
23 23 from zmq.tests import BaseZMQTestCase
24 24
25 from IPython.external.decorator import decorator
25 from decorator import decorator
26 26
27 27 from IPython.parallel import error
28 28 from IPython.parallel import Client
@@ -28,7 +28,7 b' import zmq'
28 28 from zmq.log import handlers
29 29
30 30 from IPython.utils.log import get_logger
31 from IPython.external.decorator import decorator
31 from decorator import decorator
32 32
33 33 from IPython.config.application import Application
34 34 from IPython.utils.localinterfaces import localhost, is_public_ip, public_ips
@@ -62,7 +62,7 b' def stop_console(p, pexpect, t):'
62 62
63 63 def start_console():
64 64 "Start `ipython console` using pexpect"
65 from IPython.external import pexpect
65 import pexpect
66 66
67 67 args = ['-m', 'IPython', 'console', '--colors=NoColor']
68 68 cmd = sys.executable
@@ -60,7 +60,7 b' def test_ipython_embed():'
60 60 @skip_win32
61 61 def test_nest_embed():
62 62 """test that `IPython.embed()` is nestable"""
63 from IPython.external import pexpect
63 import pexpect
64 64 ipy_prompt = r']:' #ansi color codes give problems matching beyond this
65 65
66 66
@@ -52,7 +52,7 b' import unittest'
52 52 # Third-party imports
53 53
54 54 # This is Michele Simionato's decorator module, kept verbatim.
55 from IPython.external.decorator import decorator
55 from decorator import decorator
56 56
57 57 # Expose the unittest-driven decorators
58 58 from .ipunittest import ipdoctest, ipdocstring
@@ -42,12 +42,6 b' from IPython.external.decorators import KnownFailure, knownfailureif'
42 42
43 43 pjoin = path.join
44 44
45
46 #-----------------------------------------------------------------------------
47 # Globals
48 #-----------------------------------------------------------------------------
49
50
51 45 #-----------------------------------------------------------------------------
52 46 # Warnings control
53 47 #-----------------------------------------------------------------------------
@@ -127,7 +121,7 b' have = {}'
127 121 have['curses'] = test_for('_curses')
128 122 have['matplotlib'] = test_for('matplotlib')
129 123 have['numpy'] = test_for('numpy')
130 have['pexpect'] = test_for('IPython.external.pexpect')
124 have['pexpect'] = test_for('pexpect')
131 125 have['pymongo'] = test_for('pymongo')
132 126 have['pygments'] = test_for('pygments')
133 127 have['qt'] = test_for('IPython.external.qt')
@@ -21,7 +21,7 b' import os'
21 21 import subprocess as sp
22 22 import sys
23 23
24 from IPython.external import pexpect
24 import pexpect
25 25
26 26 # Our own
27 27 from ._process_common import getoutput, arg_split
@@ -1,26 +1,11 b''
1 1 # encoding: utf-8
2 2 """Generic functions for extending IPython.
3 3
4 See http://cheeseshop.python.org/pypi/simplegeneric.
4 See http://pypi.python.org/pypi/simplegeneric.
5 5 """
6 6
7 #-----------------------------------------------------------------------------
8 # Copyright (C) 2008-2011 The IPython Development Team
9 #
10 # Distributed under the terms of the BSD License. The full license is in
11 # the file COPYING, distributed as part of this software.
12 #-----------------------------------------------------------------------------
13
14 #-----------------------------------------------------------------------------
15 # Imports
16 #-----------------------------------------------------------------------------
17
18 7 from IPython.core.error import TryNext
19 from IPython.external.simplegeneric import generic
20
21 #-----------------------------------------------------------------------------
22 # Imports
23 #-----------------------------------------------------------------------------
8 from simplegeneric import generic
24 9
25 10
26 11 @generic
@@ -8,42 +8,21 b' Inheritance diagram:'
8 8 :parts: 3
9 9 """
10 10
11 #-----------------------------------------------------------------------------
12 # Copyright (C) 2008-2011 The IPython Development Team
13 #
14 # Distributed under the terms of the BSD License. The full license is in
15 # the file COPYING, distributed as part of this software.
16 #-----------------------------------------------------------------------------
17
18 #-----------------------------------------------------------------------------
19 # Imports
20 #-----------------------------------------------------------------------------
21
22 11 import os
23 12 import re
24 13 import sys
25 14 import textwrap
26 15 from string import Formatter
27 16
28 from IPython.external.path import path
29 17 from IPython.testing.skipdoctest import skip_doctest_py3, skip_doctest
30 18 from IPython.utils import py3compat
31 19
32 #-----------------------------------------------------------------------------
33 # Declarations
34 #-----------------------------------------------------------------------------
35
36 20 # datetime.strftime date format for ipython
37 21 if sys.platform == 'win32':
38 22 date_format = "%B %d, %Y"
39 23 else:
40 24 date_format = "%B %-d, %Y"
41 25
42
43 #-----------------------------------------------------------------------------
44 # Code
45 #-----------------------------------------------------------------------------
46
47 26 class LSString(str):
48 27 """String derivative with a special access attributes.
49 28
@@ -52,7 +31,7 b' class LSString(str):'
52 31 .l (or .list) : value as list (split on newlines).
53 32 .n (or .nlstr): original value (the string itself).
54 33 .s (or .spstr): value as whitespace-separated string.
55 .p (or .paths): list of path objects
34 .p (or .paths): list of path objects (requires path.py package)
56 35
57 36 Any values which require transformations are computed only once and
58 37 cached.
@@ -84,6 +63,7 b' class LSString(str):'
84 63 n = nlstr = property(get_nlstr)
85 64
86 65 def get_paths(self):
66 from path import path
87 67 try:
88 68 return self.__paths
89 69 except AttributeError:
@@ -113,7 +93,7 b' class SList(list):'
113 93 * .l (or .list) : value as list (the list itself).
114 94 * .n (or .nlstr): value as a string, joined on newlines.
115 95 * .s (or .spstr): value as a string, joined on spaces.
116 * .p (or .paths): list of path objects
96 * .p (or .paths): list of path objects (requires path.py package)
117 97
118 98 Any values which require transformations are computed only once and
119 99 cached."""
@@ -142,6 +122,7 b' class SList(list):'
142 122 n = nlstr = property(get_nlstr)
143 123
144 124 def get_paths(self):
125 from path import path
145 126 try:
146 127 return self.__paths
147 128 except AttributeError:
@@ -63,7 +63,7 b' from setupbase import ('
63 63 find_entry_points,
64 64 build_scripts_entrypt,
65 65 find_data_files,
66 check_for_dependencies,
66 check_for_readline,
67 67 git_prebuild,
68 68 check_submodule_status,
69 69 update_submodules,
@@ -78,7 +78,6 b' from setupbase import ('
78 78 install_scripts_for_symlink,
79 79 unsymlink,
80 80 )
81 from setupext import setupext
82 81
83 82 isfile = os.path.isfile
84 83 pjoin = os.path.join
@@ -268,14 +267,22 b' if sys.version_info < (3, 3):'
268 267 extras_require['notebook'].extend(extras_require['nbformat'])
269 268 extras_require['nbconvert'].extend(extras_require['nbformat'])
270 269
271 install_requires = []
270 install_requires = [
271 'decorator',
272 'pickleshare',
273 'simplegeneric>0.8',
274 ]
272 275
273 # add readline
276 # add platform-specific dependencies
274 277 if sys.platform == 'darwin':
275 if 'bdist_wheel' in sys.argv[1:] or not setupext.check_for_readline():
278 install_requires.append('appnope')
279 if 'bdist_wheel' in sys.argv[1:] or not check_for_readline():
276 280 install_requires.append('gnureadline')
277 elif sys.platform.startswith('win'):
281
282 if sys.platform.startswith('win'):
278 283 extras_require['terminal'].append('pyreadline>=2.0')
284 else:
285 install_requires.append('pexpect')
279 286
280 287 everything = set()
281 288 for deps in extras_require.values():
@@ -317,13 +324,6 b" if 'setuptools' in sys.modules:"
317 324 "ipython_win_post_install.py"}}
318 325
319 326 else:
320 # If we are installing without setuptools, call this function which will
321 # check for dependencies an inform the user what is needed. This is
322 # just to make life easy for users.
323 for install_cmd in ('install', 'symlink'):
324 if install_cmd in sys.argv:
325 check_for_dependencies()
326 break
327 327 # scripts has to be a non-empty list, or install_scripts isn't called
328 328 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
329 329
@@ -490,37 +490,23 b' class install_scripts_for_symlink(install_scripts):'
490 490 # Verify all dependencies
491 491 #---------------------------------------------------------------------------
492 492
493 def check_for_dependencies():
494 """Check for IPython's dependencies.
495
496 This function should NOT be called if running under setuptools!
497 """
498 from setupext.setupext import (
499 print_line, print_raw, print_status,
500 check_for_sphinx, check_for_pygments,
501 check_for_nose, check_for_pexpect,
502 check_for_pyzmq, check_for_readline,
503 check_for_jinja2, check_for_tornado
504 )
505 print_line()
506 print_raw("BUILDING IPYTHON")
507 print_status('python', sys.version)
508 print_status('platform', sys.platform)
509 if sys.platform == 'win32':
510 print_status('Windows version', sys.getwindowsversion())
511
512 print_raw("")
513 print_raw("OPTIONAL DEPENDENCIES")
514
515 check_for_sphinx()
516 check_for_pygments()
517 check_for_nose()
518 if os.name == 'posix':
519 check_for_pexpect()
520 check_for_pyzmq()
521 check_for_tornado()
522 check_for_readline()
523 check_for_jinja2()
493 def check_for_readline():
494 """Check for GNU readline"""
495 try:
496 import gnureadline as readline
497 except ImportError:
498 pass
499 else:
500 return True
501 try:
502 import readline
503 except ImportError:
504 return False
505 else:
506 if sys.platform == 'darwin' and 'libedit' in readline.__doc__:
507 print("Ignoring readline linked to libedit", file=sys.stderr)
508 return False
509 return True
524 510
525 511 #---------------------------------------------------------------------------
526 512 # VCS related
@@ -670,7 +656,7 b' def get_bdist_wheel():'
670 656 if found:
671 657 lis.pop(idx)
672 658
673 for pkg in ("gnureadline", "pyreadline", "mock", "terminado"):
659 for pkg in ("gnureadline", "pyreadline", "mock", "terminado", "appnope", "pexpect"):
674 660 _remove_startswith(requires, pkg)
675 661 requires.append("gnureadline; sys.platform == 'darwin' and platform.python_implementation == 'CPython'")
676 662 requires.append("terminado (>=0.3.3); extra == 'notebook' and sys.platform != 'win32'")
@@ -678,6 +664,8 b' def get_bdist_wheel():'
678 664 requires.append("pyreadline (>=2.0); extra == 'terminal' and sys.platform == 'win32' and platform.python_implementation == 'CPython'")
679 665 requires.append("pyreadline (>=2.0); extra == 'all' and sys.platform == 'win32' and platform.python_implementation == 'CPython'")
680 666 requires.append("mock; extra == 'test' and python_version < '3.3'")
667 requires.append("appnope; sys.platform == 'darwin'")
668 requires.append("pexpect; sys.platform != 'win32'")
681 669 for r in requires:
682 670 pkg_info['Requires-Dist'] = r
683 671 write_pkg_info(metadata_path, pkg_info)
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (1267 lines changed) Show them Hide them
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (2123 lines changed) Show them Hide them
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now