Show More
@@ -2689,7 +2689,7 b' class InteractiveShell(SingletonConfigurable):' | |||||
2689 | def get_cells(): |
|
2689 | def get_cells(): | |
2690 | """generator for sequence of code blocks to run""" |
|
2690 | """generator for sequence of code blocks to run""" | |
2691 | if fname.endswith('.ipynb'): |
|
2691 | if fname.endswith('.ipynb'): | |
2692 |
from |
|
2692 | from nbformat import read | |
2693 | with io_open(fname) as f: |
|
2693 | with io_open(fname) as f: | |
2694 | nb = read(f, as_version=4) |
|
2694 | nb = read(f, as_version=4) | |
2695 | if not nb.cells: |
|
2695 | if not nb.cells: |
@@ -596,7 +596,7 b' Defaulting color scheme to \'NoColor\'"""' | |||||
596 | """ |
|
596 | """ | |
597 | args = magic_arguments.parse_argstring(self.notebook, s) |
|
597 | args = magic_arguments.parse_argstring(self.notebook, s) | |
598 |
|
598 | |||
599 |
from |
|
599 | from nbformat import write, v4 | |
600 | args.filename = unquote_filename(args.filename) |
|
600 | args.filename = unquote_filename(args.filename) | |
601 | if args.export: |
|
601 | if args.export: | |
602 | cells = [] |
|
602 | cells = [] |
@@ -619,7 +619,7 b' def test_extension():' | |||||
619 | tmpdir.cleanup() |
|
619 | tmpdir.cleanup() | |
620 |
|
620 | |||
621 |
|
621 | |||
622 |
@dec.skip_without(' |
|
622 | @dec.skip_without('nbformat') | |
623 | def test_notebook_export_json(): |
|
623 | def test_notebook_export_json(): | |
624 | _ip = get_ipython() |
|
624 | _ip = get_ipython() | |
625 | _ip.history_manager.reset() # Clear any existing history. |
|
625 | _ip.history_manager.reset() # Clear any existing history. |
@@ -375,10 +375,10 b' tclass.py: deleting object: C-third' | |||||
375 | with tt.AssertNotPrints('SystemExit'): |
|
375 | with tt.AssertNotPrints('SystemExit'): | |
376 | _ip.magic('run -e %s' % self.fname) |
|
376 | _ip.magic('run -e %s' % self.fname) | |
377 |
|
377 | |||
378 |
@dec.skip_without(' |
|
378 | @dec.skip_without('nbformat') # Requires jsonschema | |
379 | def test_run_nb(self): |
|
379 | def test_run_nb(self): | |
380 | """Test %run notebook.ipynb""" |
|
380 | """Test %run notebook.ipynb""" | |
381 |
from |
|
381 | from nbformat import v4, writes | |
382 | nb = v4.new_notebook( |
|
382 | nb = v4.new_notebook( | |
383 | cells=[ |
|
383 | cells=[ | |
384 | v4.new_markdown_cell("The Ultimate Question of Everything"), |
|
384 | v4.new_markdown_cell("The Ultimate Question of Everything"), |
@@ -8,7 +8,7 b' import sys' | |||||
8 | from warnings import warn |
|
8 | from warnings import warn | |
9 |
|
9 | |||
10 | warn("The `IPython.nbformat` package has been deprecated. " |
|
10 | warn("The `IPython.nbformat` package has been deprecated. " | |
11 |
"You should import from |
|
11 | "You should import from nbformat instead.") | |
12 |
|
12 | |||
13 | from IPython.utils.shimmodule import ShimModule |
|
13 | from IPython.utils.shimmodule import ShimModule | |
14 |
|
14 | |||
@@ -16,4 +16,4 b' from IPython.utils.shimmodule import ShimModule' | |||||
16 | # trigger the custom attribute access above |
|
16 | # trigger the custom attribute access above | |
17 |
|
17 | |||
18 | sys.modules['IPython.nbformat'] = ShimModule( |
|
18 | sys.modules['IPython.nbformat'] = ShimModule( | |
19 |
src='IPython.nbformat', mirror=' |
|
19 | src='IPython.nbformat', mirror='nbformat') |
@@ -231,7 +231,7 b' class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp):' | |||||
231 | nbconvert=('nbconvert.nbconvertapp.NbConvertApp', |
|
231 | nbconvert=('nbconvert.nbconvertapp.NbConvertApp', | |
232 | "DEPRECATED: Convert notebooks to/from other formats." |
|
232 | "DEPRECATED: Convert notebooks to/from other formats." | |
233 | ), |
|
233 | ), | |
234 |
trust=(' |
|
234 | trust=('nbformat.sign.TrustNotebookApp', | |
235 | "DEPRECATED: Sign notebooks to trust their potentially unsafe contents at load." |
|
235 | "DEPRECATED: Sign notebooks to trust their potentially unsafe contents at load." | |
236 | ), |
|
236 | ), | |
237 | kernelspec=('jupyter_client.kernelspecapp.KernelSpecApp', |
|
237 | kernelspec=('jupyter_client.kernelspecapp.KernelSpecApp', |
@@ -25,6 +25,6 b' def test_locate_help():' | |||||
25 | def test_locate_profile_help(): |
|
25 | def test_locate_profile_help(): | |
26 | tt.help_all_output_test("locate profile") |
|
26 | tt.help_all_output_test("locate profile") | |
27 |
|
27 | |||
28 |
@skip_without(' |
|
28 | @skip_without('nbformat') # Requires jsonschema to be installed | |
29 | def test_trust_help(): |
|
29 | def test_trust_help(): | |
30 | tt.help_all_output_test("trust") |
|
30 | tt.help_all_output_test("trust") |
@@ -207,7 +207,7 b' extras_require = dict(' | |||||
207 | test = ['nose>=0.10.1', 'requests', 'testpath'], |
|
207 | test = ['nose>=0.10.1', 'requests', 'testpath'], | |
208 | terminal = [], |
|
208 | terminal = [], | |
209 | kernel = ['ipykernel'], |
|
209 | kernel = ['ipykernel'], | |
210 |
nbformat = [' |
|
210 | nbformat = ['nbformat'], | |
211 | notebook = ['jupyter_notebook'], |
|
211 | notebook = ['jupyter_notebook'], | |
212 | nbconvert = ['nbconvert'], |
|
212 | nbconvert = ['nbconvert'], | |
213 | ) |
|
213 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now