Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16fd1e3

Browse files
committed
remove ipython_kernel.zmq sub-pkg
1 parent ad9f42c commit 16fd1e3

31 files changed

Lines changed: 35 additions & 44 deletions

IPython/kernel/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@
1313

1414
from IPython.utils.shimmodule import ShimModule
1515

16-
# session moved relative to top-level
16+
# zmq subdir is gone
1717
sys.modules['IPython.kernel.zmq.session'] = ShimModule('session', mirror='jupyter_client.session')
18+
sys.modules['IPython.kernel.zmq'] = ShimModule('zmq', mirror='ipython_kernel')
1819

19-
for pkg in ('comm', 'inprocess', 'resources', 'zmq'):
20+
for pkg in ('comm', 'inprocess', 'resources'):
2021
sys.modules['IPython.kernel.%s' % pkg] = ShimModule(pkg, mirror='ipython_kernel.%s' % pkg)
22+
2123
for pkg in ('ioloop', 'blocking'):
2224
sys.modules['IPython.kernel.%s' % pkg] = ShimModule(pkg, mirror='jupyter_client.%s' % pkg)
2325

2426
# required for `from IPython.kernel import PKG`
25-
from ipython_kernel import comm, inprocess, resources, zmq
27+
from ipython_kernel import comm, inprocess, resources
2628
from jupyter_client import ioloop, blocking
2729
# public API
2830
from ipython_kernel.connect import *

IPython/testing/iptest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,10 @@ def will_run(self):
232232
# The in-process kernel tests are done in a separate section
233233
sec.exclude('inprocess')
234234
# importing gtk sets the default encoding, which we want to avoid
235-
sec.exclude('zmq.gui.gtkembed')
236-
sec.exclude('zmq.gui.gtk3embed')
235+
sec.exclude('gui.gtkembed')
236+
sec.exclude('gui.gtk3embed')
237237
if not have['matplotlib']:
238-
sec.exclude('zmq.pylab')
238+
sec.exclude('pylab')
239239

240240
# kernel.inprocess:
241241
test_sections['kernel.inprocess'].requires('zmq')

ipython_kernel/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
if __name__ == '__main__':
2-
from ipython_kernel.zmq import kernelapp as app
2+
from ipython_kernel import kernelapp as app
33
app.launch_new_instance()

ipython_kernel/comm/comm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from zmq.eventloop.ioloop import IOLoop
1010

1111
from IPython.config import LoggingConfigurable
12-
from ipython_kernel.zmq.kernelbase import Kernel
12+
from ipython_kernel.kernelbase import Kernel
1313

1414
from IPython.utils.jsonutil import json_clean
1515
from IPython.utils.traitlets import Instance, Unicode, Bytes, Bool, Dict, Any
@@ -20,15 +20,15 @@ class Comm(LoggingConfigurable):
2020
# If this is instantiated by a non-IPython kernel, shell will be None
2121
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
2222
allow_none=True)
23-
kernel = Instance('ipython_kernel.zmq.kernelbase.Kernel')
23+
kernel = Instance('ipython_kernel.kernelbase.Kernel')
2424
def _kernel_default(self):
2525
if Kernel.initialized():
2626
return Kernel.instance()
2727

2828
iopub_socket = Any()
2929
def _iopub_socket_default(self):
3030
return self.kernel.iopub_socket
31-
session = Instance('ipython_kernel.zmq.session.Session')
31+
session = Instance('ipython_kernel.session.Session')
3232
def _session_default(self):
3333
if self.kernel is not None:
3434
return self.kernel.session

ipython_kernel/comm/manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class CommManager(LoggingConfigurable):
3131
# If this is instantiated by a non-IPython kernel, shell will be None
3232
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
3333
allow_none=True)
34-
kernel = Instance('ipython_kernel.zmq.kernelbase.Kernel')
34+
kernel = Instance('ipython_kernel.kernelbase.Kernel')
3535

3636
iopub_socket = Any()
3737
def _iopub_socket_default(self):
3838
return self.kernel.iopub_socket
39-
session = Instance('ipython_kernel.zmq.session.Session')
39+
session = Instance('ipython_kernel.session.Session')
4040
def _session_default(self):
4141
return self.kernel.session
4242

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from ipython_kernel.inprocess.socket import SocketABC
1717
from IPython.utils.jsonutil import json_clean
1818
from IPython.utils.traitlets import Instance, Dict, CBytes
19-
from ipython_kernel.zmq.serialize import serialize_object
20-
from ipython_kernel.zmq.session import Session, extract_header
19+
from ipython_kernel.serialize import serialize_object
20+
from ipython_kernel.session import Session, extract_header
2121

2222
#-----------------------------------------------------------------------------
2323
# Code
@@ -66,5 +66,5 @@ def publish_data(data):
6666
data : dict
6767
The data to be published. Think of it as a namespace.
6868
"""
69-
from ipython_kernel.zmq.zmqshell import ZMQInteractiveShell
69+
from ipython_kernel.zmqshell import ZMQInteractiveShell
7070
ZMQInteractiveShell.instance().data_pub.publish_data(data)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def register_integration(*toolkitnames):
4949
instance, arrange for the event loop to call ``kernel.do_one_iteration()``
5050
at least every ``kernel._poll_interval`` seconds, and start the event loop.
5151
52-
:mod:`ipython_kernel.zmq.eventloops` provides and registers such functions
52+
:mod:`ipython_kernel.eventloops` provides and registers such functions
5353
for a few common event loops.
5454
"""
5555
def decorator(func):

0 commit comments

Comments
 (0)