##// END OF EJS Templates
move IPython.inprocess to IPython.kernel.inprocess
MinRK -
Show More
@@ -81,5 +81,5 b' def embed_kernel(module=None, local_ns=None, **kwargs):'
81 local_ns = caller_locals
81 local_ns = caller_locals
82
82
83 # Only import .zmq when we really need it
83 # Only import .zmq when we really need it
84 from .zmq.embed import embed_kernel as real_embed_kernel
84 from IPython.kernel.zmq.embed import embed_kernel as real_embed_kernel
85 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
85 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
@@ -2,7 +2,7 b''
2 """
2 """
3
3
4 # Local imports.
4 # Local imports.
5 from IPython.inprocess.kernelmanager import \
5 from IPython.kernel.inprocess.kernelmanager import \
6 InProcessShellChannel, InProcessIOPubChannel, InProcessStdInChannel, \
6 InProcessShellChannel, InProcessIOPubChannel, InProcessStdInChannel, \
7 InProcessHBChannel, InProcessKernelManager
7 InProcessHBChannel, InProcessKernelManager
8 from IPython.utils.traitlets import Type
8 from IPython.utils.traitlets import Type
1 NO CONTENT: file renamed from IPython/inprocess/__init__.py to IPython/kernel/inprocess/__init__.py
NO CONTENT: file renamed from IPython/inprocess/__init__.py to IPython/kernel/inprocess/__init__.py
1 NO CONTENT: file renamed from IPython/inprocess/blockingkernelmanager.py to IPython/kernel/inprocess/blockingkernelmanager.py
NO CONTENT: file renamed from IPython/inprocess/blockingkernelmanager.py to IPython/kernel/inprocess/blockingkernelmanager.py
@@ -1,4 +1,4 b''
1 """ An in-process kernel. """
1 """An in-process kernel"""
2
2
3 #-----------------------------------------------------------------------------
3 #-----------------------------------------------------------------------------
4 # Copyright (C) 2012 The IPython Development Team
4 # Copyright (C) 2012 The IPython Development Team
@@ -16,14 +16,15 b' from contextlib import contextmanager'
16 import logging
16 import logging
17 import sys
17 import sys
18
18
19 # Local imports.
19 # Local imports
20 from IPython.core.interactiveshell import InteractiveShellABC
20 from IPython.core.interactiveshell import InteractiveShellABC
21 from IPython.inprocess.socket import DummySocket
22 from IPython.utils.jsonutil import json_clean
21 from IPython.utils.jsonutil import json_clean
23 from IPython.utils.traitlets import Any, Enum, Instance, List, Type
22 from IPython.utils.traitlets import Any, Enum, Instance, List, Type
24 from IPython.kernel.zmq.ipkernel import Kernel
23 from IPython.kernel.zmq.ipkernel import Kernel
25 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
24 from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
26
25
26 from .socket import DummySocket
27
27 #-----------------------------------------------------------------------------
28 #-----------------------------------------------------------------------------
28 # Main kernel class
29 # Main kernel class
29 #-----------------------------------------------------------------------------
30 #-----------------------------------------------------------------------------
@@ -36,7 +37,7 b' class InProcessKernel(Kernel):'
36
37
37 # The frontends connected to this kernel.
38 # The frontends connected to this kernel.
38 frontends = List(
39 frontends = List(
39 Instance('IPython.inprocess.kernelmanager.InProcessKernelManager'))
40 Instance('IPython.kernel.inprocess.kernelmanager.InProcessKernelManager'))
40
41
41 # The GUI environment that the kernel is running under. This need not be
42 # The GUI environment that the kernel is running under. This need not be
42 # specified for the normal operation for the kernel, but is required for
43 # specified for the normal operation for the kernel, but is required for
@@ -151,7 +152,7 b' class InProcessKernel(Kernel):'
151
152
152 class InProcessInteractiveShell(ZMQInteractiveShell):
153 class InProcessInteractiveShell(ZMQInteractiveShell):
153
154
154 kernel = Instance('IPython.inprocess.ipkernel.InProcessKernel')
155 kernel = Instance('IPython.kernel.inprocess.ipkernel.InProcessKernel')
155
156
156 #-------------------------------------------------------------------------
157 #-------------------------------------------------------------------------
157 # InteractiveShell interface
158 # InteractiveShell interface
@@ -13,7 +13,6 b''
13
13
14 # Local imports.
14 # Local imports.
15 from IPython.config.configurable import Configurable
15 from IPython.config.configurable import Configurable
16 from IPython.inprocess.socket import DummySocket
17 from IPython.utils.traitlets import Any, Instance, Type
16 from IPython.utils.traitlets import Any, Instance, Type
18 from IPython.kernel import (
17 from IPython.kernel import (
19 ShellChannelABC, IOPubChannelABC,
18 ShellChannelABC, IOPubChannelABC,
@@ -21,6 +20,8 b' from IPython.kernel import ('
21 KernelManagerABC
20 KernelManagerABC
22 )
21 )
23
22
23 from .socket import DummySocket
24
24 #-----------------------------------------------------------------------------
25 #-----------------------------------------------------------------------------
25 # Channel classes
26 # Channel classes
26 #-----------------------------------------------------------------------------
27 #-----------------------------------------------------------------------------
@@ -197,7 +198,7 b' class InProcessKernelManager(Configurable):'
197 return Session(config=self.config)
198 return Session(config=self.config)
198
199
199 # The kernel process with which the KernelManager is communicating.
200 # The kernel process with which the KernelManager is communicating.
200 kernel = Instance('IPython.inprocess.ipkernel.InProcessKernel')
201 kernel = Instance('IPython.kernel.inprocess.ipkernel.InProcessKernel')
201
202
202 # The classes to use for the various channels.
203 # The classes to use for the various channels.
203 shell_channel_class = Type(InProcessShellChannel)
204 shell_channel_class = Type(InProcessShellChannel)
@@ -272,7 +273,7 b' class InProcessKernelManager(Configurable):'
272 #--------------------------------------------------------------------------
273 #--------------------------------------------------------------------------
273
274
274 def start_kernel(self, **kwds):
275 def start_kernel(self, **kwds):
275 from IPython.inprocess.ipkernel import InProcessKernel
276 from IPython.kernel.inprocess.ipkernel import InProcessKernel
276 self.kernel = InProcessKernel()
277 self.kernel = InProcessKernel()
277 self.kernel.frontends.append(self)
278 self.kernel.frontends.append(self)
278
279
1 NO CONTENT: file renamed from IPython/inprocess/socket.py to IPython/kernel/inprocess/socket.py
NO CONTENT: file renamed from IPython/inprocess/socket.py to IPython/kernel/inprocess/socket.py
1 NO CONTENT: file renamed from IPython/inprocess/tests/__init__.py to IPython/kernel/inprocess/tests/__init__.py
NO CONTENT: file renamed from IPython/inprocess/tests/__init__.py to IPython/kernel/inprocess/tests/__init__.py
@@ -16,9 +16,9 b' import sys'
16 import unittest
16 import unittest
17
17
18 # Local imports
18 # Local imports
19 from IPython.inprocess.blockingkernelmanager import \
19 from IPython.kernel.inprocess.blockingkernelmanager import \
20 BlockingInProcessKernelManager
20 BlockingInProcessKernelManager
21 from IPython.inprocess.ipkernel import InProcessKernel
21 from IPython.kernel.inprocess.ipkernel import InProcessKernel
22 from IPython.testing.decorators import skipif_not_matplotlib
22 from IPython.testing.decorators import skipif_not_matplotlib
23 from IPython.utils.io import capture_output
23 from IPython.utils.io import capture_output
24 from IPython.utils import py3compat
24 from IPython.utils import py3compat
@@ -14,9 +14,9 b' from __future__ import print_function'
14 import unittest
14 import unittest
15
15
16 # Local imports
16 # Local imports
17 from IPython.inprocess.blockingkernelmanager import \
17 from IPython.kernel.inprocess.blockingkernelmanager import \
18 BlockingInProcessKernelManager
18 BlockingInProcessKernelManager
19 from IPython.inprocess.ipkernel import InProcessKernel
19 from IPython.kernel.inprocess.ipkernel import InProcessKernel
20
20
21 #-----------------------------------------------------------------------------
21 #-----------------------------------------------------------------------------
22 # Test case
22 # Test case
1 NO CONTENT: file renamed from IPython/kernel/zmq/tests/test_kernelmanager.py to IPython/kernel/tests/test_kernelmanager.py
NO CONTENT: file renamed from IPython/kernel/zmq/tests/test_kernelmanager.py to IPython/kernel/tests/test_kernelmanager.py
@@ -13,7 +13,7 b''
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14
14
15 from IPython.config import Configurable
15 from IPython.config import Configurable
16 from IPython.inprocess.socket import SocketABC
16 from IPython.kernel.inprocess.socket import SocketABC
17 from IPython.utils.jsonutil import json_clean
17 from IPython.utils.jsonutil import json_clean
18 from IPython.utils.traitlets import Instance, Dict, CBytes
18 from IPython.utils.traitlets import Instance, Dict, CBytes
19 from IPython.kernel.zmq.serialize import serialize_object
19 from IPython.kernel.zmq.serialize import serialize_object
@@ -2,7 +2,7 b' import __builtin__'
2 import sys
2 import sys
3
3
4 from IPython.core.displayhook import DisplayHook
4 from IPython.core.displayhook import DisplayHook
5 from IPython.inprocess.socket import SocketABC
5 from IPython.kernel.inprocess.socket import SocketABC
6 from IPython.utils.jsonutil import encode_images
6 from IPython.utils.jsonutil import encode_images
7 from IPython.utils.traitlets import Instance, Dict
7 from IPython.utils.traitlets import Instance, Dict
8 from session import extract_header, Session
8 from session import extract_header, Session
@@ -34,7 +34,7 b' from IPython.core.error import UsageError'
34 from IPython.core.magics import MacroToEdit, CodeMagics
34 from IPython.core.magics import MacroToEdit, CodeMagics
35 from IPython.core.magic import magics_class, line_magic, Magics
35 from IPython.core.magic import magics_class, line_magic, Magics
36 from IPython.core.payloadpage import install_payload_page
36 from IPython.core.payloadpage import install_payload_page
37 from IPython.inprocess.socket import SocketABC
37 from IPython.kernel.inprocess.socket import SocketABC
38 from IPython.kernel import (
38 from IPython.kernel import (
39 get_connection_file, get_connection_info, connect_qtconsole
39 get_connection_file, get_connection_info, connect_qtconsole
40 )
40 )
@@ -238,6 +238,9 b' def make_exclude():'
238 if not have['wx']:
238 if not have['wx']:
239 exclusions.append(ipjoin('lib', 'inputhookwx'))
239 exclusions.append(ipjoin('lib', 'inputhookwx'))
240
240
241 if 'IPython.kernel.inprocess' not in sys.argv:
242 exclusions.append(ipjoin('kernel', 'inprocess'))
243
241 # FIXME: temporarily disable autoreload tests, as they can produce
244 # FIXME: temporarily disable autoreload tests, as they can produce
242 # spurious failures in subsequent tests (cythonmagic).
245 # spurious failures in subsequent tests (cythonmagic).
243 exclusions.append(ipjoin('extensions', 'autoreload'))
246 exclusions.append(ipjoin('extensions', 'autoreload'))
@@ -246,7 +249,7 b' def make_exclude():'
246 # We do this unconditionally, so that the test suite doesn't import
249 # We do this unconditionally, so that the test suite doesn't import
247 # gtk, changing the default encoding and masking some unicode bugs.
250 # gtk, changing the default encoding and masking some unicode bugs.
248 exclusions.append(ipjoin('lib', 'inputhookgtk'))
251 exclusions.append(ipjoin('lib', 'inputhookgtk'))
249 exclusions.append(ipjoin('zmq', 'gui', 'gtkembed'))
252 exclusions.append(ipjoin('kernel', 'zmq', 'gui', 'gtkembed'))
250
253
251 # These have to be skipped on win32 because the use echo, rm, cd, etc.
254 # These have to be skipped on win32 because the use echo, rm, cd, etc.
252 # See ticket https://github.com/ipython/ipython/issues/87
255 # See ticket https://github.com/ipython/ipython/issues/87
@@ -261,7 +264,7 b' def make_exclude():'
261 ])
264 ])
262
265
263 if not have['zmq']:
266 if not have['zmq']:
264 exclusions.append(ipjoin('zmq'))
267 exclusions.append(ipjoin('kernel'))
265 exclusions.append(ipjoin('frontend', 'qt'))
268 exclusions.append(ipjoin('frontend', 'qt'))
266 exclusions.append(ipjoin('frontend', 'html'))
269 exclusions.append(ipjoin('frontend', 'html'))
267 exclusions.append(ipjoin('frontend', 'consoleapp.py'))
270 exclusions.append(ipjoin('frontend', 'consoleapp.py'))
@@ -277,7 +280,7 b' def make_exclude():'
277 if not have['matplotlib']:
280 if not have['matplotlib']:
278 exclusions.extend([ipjoin('core', 'pylabtools'),
281 exclusions.extend([ipjoin('core', 'pylabtools'),
279 ipjoin('core', 'tests', 'test_pylabtools'),
282 ipjoin('core', 'tests', 'test_pylabtools'),
280 ipjoin('zmq', 'pylab'),
283 ipjoin('kernel', 'zmq', 'pylab'),
281 ])
284 ])
282
285
283 if not have['cython']:
286 if not have['cython']:
@@ -430,11 +433,12 b' def make_runners(inc_slow=False):'
430 """
433 """
431
434
432 # Packages to be tested via nose, that only depend on the stdlib
435 # Packages to be tested via nose, that only depend on the stdlib
433 nose_pkg_names = ['config', 'core', 'extensions', 'frontend', 'kernel', 'lib',
436 nose_pkg_names = ['config', 'core', 'extensions', 'frontend', 'lib',
434 'testing', 'utils', 'nbformat', 'inprocess' ]
437 'testing', 'utils', 'nbformat' ]
435
438
436 if have['zmq']:
439 if have['zmq']:
437 nose_pkg_names.append('zmq')
440 nose_pkg_names.append('kernel')
441 nose_pkg_names.append('kernel.inprocess')
438 if inc_slow:
442 if inc_slow:
439 nose_pkg_names.append('parallel')
443 nose_pkg_names.append('parallel')
440
444
@@ -502,7 +506,7 b' def run_iptest():'
502 # assumptions about what needs to be a singleton and what doesn't (app
506 # assumptions about what needs to be a singleton and what doesn't (app
503 # objects should, individual shells shouldn't). But for now, this
507 # objects should, individual shells shouldn't). But for now, this
504 # workaround allows the test suite for the inprocess module to complete.
508 # workaround allows the test suite for the inprocess module to complete.
505 if not 'IPython.inprocess' in sys.argv:
509 if not 'IPython.kernel.inprocess' in sys.argv:
506 globalipapp.start_ipython()
510 globalipapp.start_ipython()
507
511
508 # Now nose can run
512 # Now nose can run
General Comments 0
You need to be logged in to leave comments. Login now