From e549d87b4a4b6e0716664d3a2d52db2afdc42e8b 2015-05-08 22:15:51 From: Min RK Date: 2015-05-08 22:15:51 Subject: [PATCH] jupyter_nbformat is now nbformat --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 5594283..2bcb4e6 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2689,7 +2689,7 @@ class InteractiveShell(SingletonConfigurable): def get_cells(): """generator for sequence of code blocks to run""" if fname.endswith('.ipynb'): - from jupyter_nbformat import read + from nbformat import read with io_open(fname) as f: nb = read(f, as_version=4) if not nb.cells: diff --git a/IPython/core/magics/basic.py b/IPython/core/magics/basic.py index aa91dc6..d786b86 100644 --- a/IPython/core/magics/basic.py +++ b/IPython/core/magics/basic.py @@ -596,7 +596,7 @@ Defaulting color scheme to 'NoColor'""" """ args = magic_arguments.parse_argstring(self.notebook, s) - from jupyter_nbformat import write, v4 + from nbformat import write, v4 args.filename = unquote_filename(args.filename) if args.export: cells = [] diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index c5dc30e..a9f9392 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -619,7 +619,7 @@ def test_extension(): tmpdir.cleanup() -@dec.skip_without('jupyter_nbformat') +@dec.skip_without('nbformat') def test_notebook_export_json(): _ip = get_ipython() _ip.history_manager.reset() # Clear any existing history. diff --git a/IPython/core/tests/test_run.py b/IPython/core/tests/test_run.py index a521f37..6f73f73 100644 --- a/IPython/core/tests/test_run.py +++ b/IPython/core/tests/test_run.py @@ -375,10 +375,10 @@ tclass.py: deleting object: C-third with tt.AssertNotPrints('SystemExit'): _ip.magic('run -e %s' % self.fname) - @dec.skip_without('jupyter_nbformat') # Requires jsonschema + @dec.skip_without('nbformat') # Requires jsonschema def test_run_nb(self): """Test %run notebook.ipynb""" - from jupyter_nbformat import v4, writes + from nbformat import v4, writes nb = v4.new_notebook( cells=[ v4.new_markdown_cell("The Ultimate Question of Everything"), diff --git a/IPython/nbformat.py b/IPython/nbformat.py index 5d866ed..af551a8 100644 --- a/IPython/nbformat.py +++ b/IPython/nbformat.py @@ -8,7 +8,7 @@ import sys from warnings import warn warn("The `IPython.nbformat` package has been deprecated. " - "You should import from jupyter_nbformat instead.") + "You should import from nbformat instead.") from IPython.utils.shimmodule import ShimModule @@ -16,4 +16,4 @@ from IPython.utils.shimmodule import ShimModule # trigger the custom attribute access above sys.modules['IPython.nbformat'] = ShimModule( - src='IPython.nbformat', mirror='jupyter_nbformat') + src='IPython.nbformat', mirror='nbformat') diff --git a/IPython/terminal/ipapp.py b/IPython/terminal/ipapp.py index 7e53b64..fca1881 100755 --- a/IPython/terminal/ipapp.py +++ b/IPython/terminal/ipapp.py @@ -231,7 +231,7 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): nbconvert=('nbconvert.nbconvertapp.NbConvertApp', "DEPRECATED: Convert notebooks to/from other formats." ), - trust=('jupyter_nbformat.sign.TrustNotebookApp', + trust=('nbformat.sign.TrustNotebookApp', "DEPRECATED: Sign notebooks to trust their potentially unsafe contents at load." ), kernelspec=('jupyter_client.kernelspecapp.KernelSpecApp', diff --git a/IPython/terminal/tests/test_help.py b/IPython/terminal/tests/test_help.py index 0280f08..9f92942 100644 --- a/IPython/terminal/tests/test_help.py +++ b/IPython/terminal/tests/test_help.py @@ -25,6 +25,6 @@ def test_locate_help(): def test_locate_profile_help(): tt.help_all_output_test("locate profile") -@skip_without('jupyter_nbformat') # Requires jsonschema to be installed +@skip_without('nbformat') # Requires jsonschema to be installed def test_trust_help(): tt.help_all_output_test("trust") diff --git a/setup.py b/setup.py index a44be0a..40d5af7 100755 --- a/setup.py +++ b/setup.py @@ -207,7 +207,7 @@ extras_require = dict( test = ['nose>=0.10.1', 'requests', 'testpath'], terminal = [], kernel = ['ipykernel'], - nbformat = ['jupyter_nbformat'], + nbformat = ['nbformat'], notebook = ['jupyter_notebook'], nbconvert = ['nbconvert'], )