From 03608cd1ee462b4b82e087cd437cb3917bcd2017 2015-05-08 18:38:38 From: Min RK Date: 2015-05-08 18:38:38 Subject: [PATCH] ipython_kernel is now ipykernel --- diff --git a/IPython/__init__.py b/IPython/__init__.py index 8c000f7..6179b2c 100644 --- a/IPython/__init__.py +++ b/IPython/__init__.py @@ -86,7 +86,7 @@ def embed_kernel(module=None, local_ns=None, **kwargs): local_ns = caller_locals # Only import .zmq when we really need it - from ipython_kernel.embed import embed_kernel as real_embed_kernel + from ipykernel.embed import embed_kernel as real_embed_kernel real_embed_kernel(module=module, local_ns=local_ns, **kwargs) def start_ipython(argv=None, **kwargs): diff --git a/IPython/core/display.py b/IPython/core/display.py index e353af2..2934bee 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -932,7 +932,7 @@ def set_matplotlib_formats(*formats, **kwargs): from IPython.core.pylabtools import select_figure_formats # build kwargs, starting with InlineBackend config kw = {} - from ipython_kernel.pylab.config import InlineBackend + from ipykernel.pylab.config import InlineBackend cfg = InlineBackend.instance() kw.update(cfg.print_figure_kwargs) kw.update(**kwargs) @@ -961,7 +961,7 @@ def set_matplotlib_close(close=True): Should all matplotlib figures be automatically closed after each cell is run? """ - from ipython_kernel.pylab.config import InlineBackend + from ipykernel.pylab.config import InlineBackend cfg = InlineBackend.instance() cfg.close_figures = close diff --git a/IPython/core/profileapp.py b/IPython/core/profileapp.py index 7a7abe0..c8a33dc 100644 --- a/IPython/core/profileapp.py +++ b/IPython/core/profileapp.py @@ -261,7 +261,7 @@ class ProfileCreate(BaseIPythonApplication): from IPython.terminal.ipapp import TerminalIPythonApp apps = [TerminalIPythonApp] for app_path in ( - 'ipython_kernel.kernelapp.IPKernelApp', + 'ipykernel.kernelapp.IPKernelApp', ): app = self._import_app(app_path) if app is not None: diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index c95e221..687486c 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -23,7 +23,7 @@ backends = {'tk': 'TkAgg', 'osx': 'MacOSX', 'nbagg': 'nbAgg', 'notebook': 'nbAgg', - 'inline' : 'module://ipython_kernel.pylab.backend_inline'} + 'inline' : 'module://ipykernel.pylab.backend_inline'} # We also need a reverse backends2guis mapping that will properly choose which # GUI support to activate based on the desired matplotlib backend. For the @@ -182,7 +182,7 @@ def select_figure_formats(shell, formats, **kwargs): Extra keyword arguments to be passed to fig.canvas.print_figure. """ from matplotlib.figure import Figure - from ipython_kernel.pylab import backend_inline + from ipykernel.pylab import backend_inline svg_formatter = shell.display_formatter.formatters['image/svg+xml'] png_formatter = shell.display_formatter.formatters['image/png'] @@ -233,7 +233,7 @@ def find_gui_and_backend(gui=None, gui_select=None): Returns ------- A tuple of (gui, backend) where backend is one of ('TkAgg','GTKAgg', - 'WXAgg','Qt4Agg','module://ipython_kernel.pylab.backend_inline'). + 'WXAgg','Qt4Agg','module://ipykernel.pylab.backend_inline'). """ import matplotlib @@ -334,7 +334,7 @@ def configure_inline_support(shell, backend): # continuing (such as in terminal-only shells in environments without # zeromq available). try: - from ipython_kernel.pylab.backend_inline import InlineBackend + from ipykernel.pylab.backend_inline import InlineBackend except ImportError: return from matplotlib import pyplot @@ -345,7 +345,7 @@ def configure_inline_support(shell, backend): shell.configurables.append(cfg) if backend == backends['inline']: - from ipython_kernel.pylab.backend_inline import flush_figures + from ipykernel.pylab.backend_inline import flush_figures shell.events.register('post_execute', flush_figures) # Save rcParams that will be overwrittern @@ -355,7 +355,7 @@ def configure_inline_support(shell, backend): # load inline_rc pyplot.rcParams.update(cfg.rc) else: - from ipython_kernel.pylab.backend_inline import flush_figures + from ipykernel.pylab.backend_inline import flush_figures try: shell.events.unregister('post_execute', flush_figures) except ValueError: diff --git a/IPython/core/tests/test_display.py b/IPython/core/tests/test_display.py index fca6963..e95a81c 100644 --- a/IPython/core/tests/test_display.py +++ b/IPython/core/tests/test_display.py @@ -60,7 +60,7 @@ def test_image_filename_defaults(): nt.assert_is_none(img._repr_jpeg_()) def _get_inline_config(): - from ipython_kernel.pylab.config import InlineBackend + from ipykernel.pylab.config import InlineBackend return InlineBackend.instance() @dec.skip_without('matplotlib') diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index b5e61a2..ddb86f7 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -609,7 +609,7 @@ class TestModules(unittest.TestCase, tt.TempFileMixin): self.mktmp("import sys\n" "print('numpy' in sys.modules)\n" "print('ipyparallel' in sys.modules)\n" - "print('ipython_kernel' in sys.modules)\n" + "print('ipykernel' in sys.modules)\n" ) out = "False\nFalse\nFalse\n" tt.ipexec_validate(self.fname, out) diff --git a/IPython/kernel/__init__.py b/IPython/kernel/__init__.py index 3630d80..4dd2041 100644 --- a/IPython/kernel/__init__.py +++ b/IPython/kernel/__init__.py @@ -8,7 +8,7 @@ import sys from warnings import warn warn("The `IPython.kernel` package has been deprecated. " - "You should import from ipython_kernel or jupyter_client instead.") + "You should import from ipykernel or jupyter_client instead.") from IPython.utils.shimmodule import ShimModule @@ -17,19 +17,19 @@ from IPython.utils.shimmodule import ShimModule sys.modules['IPython.kernel.zmq.session'] = ShimModule( src='IPython.kernel.zmq.session', mirror='jupyter_client.session') sys.modules['IPython.kernel.zmq'] = ShimModule( - src='IPython.kernel.zmq', mirror='ipython_kernel') + src='IPython.kernel.zmq', mirror='ipykernel') for pkg in ('comm', 'inprocess'): src = 'IPython.kernel.%s' % pkg - sys.modules[src] = ShimModule(src=src, mirror='ipython_kernel.%s' % pkg) + sys.modules[src] = ShimModule(src=src, mirror='ipykernel.%s' % pkg) for pkg in ('ioloop', 'blocking'): src = 'IPython.kernel.%s' % pkg sys.modules[src] = ShimModule(src=src, mirror='jupyter_client.%s' % pkg) # required for `from IPython.kernel import PKG` -from ipython_kernel import comm, inprocess +from ipykernel import comm, inprocess from jupyter_client import ioloop, blocking # public API -from ipython_kernel.connect import * +from ipykernel.connect import * from jupyter_client import * diff --git a/IPython/kernel/__main__.py b/IPython/kernel/__main__.py index 4b8d4ef..d1f0cf5 100644 --- a/IPython/kernel/__main__.py +++ b/IPython/kernel/__main__.py @@ -1,3 +1,3 @@ if __name__ == '__main__': - from ipython_kernel import kernelapp as app + from ipykernel import kernelapp as app app.launch_new_instance() diff --git a/IPython/kernel/connect.py b/IPython/kernel/connect.py index a1686ba..5b6d40a 100644 --- a/IPython/kernel/connect.py +++ b/IPython/kernel/connect.py @@ -1,2 +1,2 @@ -from ipython_kernel.connect import * +from ipykernel.connect import * from jupyter_client.connect import * diff --git a/IPython/lib/kernel.py b/IPython/lib/kernel.py index 38d2ce3..d48c43b 100644 --- a/IPython/lib/kernel.py +++ b/IPython/lib/kernel.py @@ -8,5 +8,5 @@ warnings.warn("IPython.lib.kernel moved to IPython.kernel.connect in IPython 1.0 DeprecationWarning ) -from ipython_kernel.connect import * +from ipykernel.connect import * diff --git a/IPython/terminal/ipapp.py b/IPython/terminal/ipapp.py index 75ba104..bdfa24c 100755 --- a/IPython/terminal/ipapp.py +++ b/IPython/terminal/ipapp.py @@ -216,7 +216,7 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): profile = ("IPython.core.profileapp.ProfileApp", "Create and manage IPython profiles." ), - kernel = ("ipython_kernel.kernelapp.IPKernelApp", + kernel = ("ipykernel.kernelapp.IPKernelApp", "Start a kernel without an attached frontend." ), console=('jupyter_console.app.ZMQTerminalIPythonApp', diff --git a/IPython/utils/pickleutil.py b/IPython/utils/pickleutil.py index dd1f733..665ff09 100644 --- a/IPython/utils/pickleutil.py +++ b/IPython/utils/pickleutil.py @@ -1,5 +1,5 @@ from warnings import warn -warn("IPython.utils.pickleutil has moved to ipython_kernel.pickleutil") +warn("IPython.utils.pickleutil has moved to ipykernel.pickleutil") -from ipython_kernel.pickleutil import * +from ipykernel.pickleutil import * diff --git a/setup.py b/setup.py index f3211ef..fcdfdbb 100755 --- a/setup.py +++ b/setup.py @@ -206,7 +206,7 @@ extras_require = dict( doc = ['Sphinx>=1.1', 'numpydoc'], test = ['nose>=0.10.1', 'requests'], terminal = [], - kernel = ['ipython_kernel'], + kernel = ['ipykernel'], nbformat = ['jupyter_nbformat'], notebook = ['jupyter_notebook'], nbconvert = ['jupyter_nbconvert']