diff --git a/HISTORY.rst b/HISTORY.rst index db95f0b22..9c08663a0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,13 @@ Release History --------------- +0.8.6 (2018-11-??) +++++++++++++++++++++++ + +**Improvements** + +- The ``language_info`` section is not part of the default header any more. Language information is now taken from metadata ``kernelspec.language``. (#105). + 0.8.5 (2018-11-13) ++++++++++++++++++++++ diff --git a/README.md b/README.md index 2ff831edf..325f0a483 100755 --- a/README.md +++ b/README.md @@ -293,7 +293,7 @@ Also, you may want some cells to be active only in the Python, or R Markdown rep The text representation of the notebook focuses on the part of the notebook that you have written. That is also the part of the notebook that should go under version control. Outputs and metadata that are (re)-constructed automatically when the notebook is executed do not need to enter the text representation. -To that aim, cell metadata `autoscroll`, `collapsed`, `scrolled`, `trusted` and `ExecuteTime` are not included in the text representation. And only the required notebook metadata: `kernelspec`, `language_info` and `jupytext` are saved when a notebook is exported as text. +To that aim, cell metadata `autoscroll`, `collapsed`, `scrolled`, `trusted` and `ExecuteTime` are not included in the text representation. And only the required notebook metadata: `kernelspec` and `jupytext` are saved when a notebook is exported as text. When a paired notebook is loaded, Jupytext reconstructs the filtered metadata using the `.ipynb` file. Please keep in mind that the `.ipynb` file is typically not distributed accross contributors, and that the cell metadata may be lost when an input cell changes (cells are matched according to their contents). Thus, if some cell or notebook metadata are important to your notebook, you should preserve it in the text version. Change the default metadata filtering as follows: - If you want no YAML header in your script, then set a notebook metadata diff --git a/jupytext/contentsmanager.py b/jupytext/contentsmanager.py index b5302146b..0bc167386 100644 --- a/jupytext/contentsmanager.py +++ b/jupytext/contentsmanager.py @@ -29,7 +29,7 @@ def kernelspec_from_language(language): try: for name in find_kernel_specs(): ks = get_kernel_spec(name) - if ks.language == language: + if ks.language == language or (language == 'c++' and ks.language.startswith('C++')): return {'name': name, 'language': language, 'display_name': ks.display_name} except (KeyError, ValueError): pass diff --git a/jupytext/header.py b/jupytext/header.py index 84ca3d40c..a96585a0b 100644 --- a/jupytext/header.py +++ b/jupytext/header.py @@ -22,8 +22,8 @@ _DEFAULT_NOTEBOOK_METADATA = ','.join([ # Preserve Jupytext section 'jupytext', - # Preserve kernel specs and language_info - 'kernelspec', 'language_info', + # Preserve kernel specs + 'kernelspec', # Kernel_info found in Nteract notebooks 'kernel_info']) diff --git a/jupytext/languages.py b/jupytext/languages.py index 8779520c6..d882617a2 100644 --- a/jupytext/languages.py +++ b/jupytext/languages.py @@ -19,15 +19,21 @@ def default_language_from_metadata_and_ext(notebook, ext): from the given file extension""" default_from_ext = _SCRIPT_EXTENSIONS.get(ext, {}).get('language', 'python') - return (notebook.metadata.get('language_info', {}).get('name') - or notebook.metadata.get('jupytext', {}).get('main_language') or default_from_ext) + language = (notebook.metadata.get('kernelspec', {}).get('language') + or notebook.metadata.get('jupytext', {}).get('main_language') + or default_from_ext) + + if language.startswith('C++'): + language = 'c++' + + return language def set_main_and_cell_language(metadata, cells, ext): """Set main language for the given collection of cells, and use magics for cells that use other languages""" default_from_ext = _SCRIPT_EXTENSIONS.get(ext, {}).get('language', 'python') - main_language = (metadata.get('language_info', {}).get('name') or + main_language = (metadata.get('kernelspec', {}).get('language') or metadata.get('jupytext', {}).get('main_language')) if main_language is None: languages = {default_from_ext: 0.5} @@ -38,8 +44,8 @@ def set_main_and_cell_language(metadata, cells, ext): main_language = max(languages, key=languages.get) - # save main language when not kernel is set - if 'name' not in metadata.get('language_info', {}): + # save main language when no kernel is set + if 'language' not in metadata.get('kernelspec', {}): metadata.setdefault('jupytext', {})['main_language'] = main_language # Remove 'language' meta data and add a magic if not main language diff --git a/jupytext/version.py b/jupytext/version.py index 4dcf642b0..ad478317f 100644 --- a/jupytext/version.py +++ b/jupytext/version.py @@ -1,3 +1,3 @@ """Jupytext's version number""" -__version__ = '0.8.5' +__version__ = '0.8.6' diff --git a/tests/notebooks/Rmd/chunk_options.Rmd b/tests/notebooks/Rmd/chunk_options.Rmd index c0458560f..4ad14b42f 100644 --- a/tests/notebooks/Rmd/chunk_options.Rmd +++ b/tests/notebooks/Rmd/chunk_options.Rmd @@ -3,8 +3,10 @@ title: "Test chunk options in Rmd/Jupyter conversion" author: "Marc Wouts" date: "June 16, 2018" jupyter: - language_info: - name: python + kernelspec: + display_name: Python + language: python + name: python3 --- ```{r knitr_setup, include=FALSE} diff --git a/tests/notebooks/mirror/Rmd_to_ipynb/R_sample.ipynb b/tests/notebooks/mirror/Rmd_to_ipynb/R_sample.ipynb index 2186eba9b..1eee5ac89 100644 --- a/tests/notebooks/mirror/Rmd_to_ipynb/R_sample.ipynb +++ b/tests/notebooks/mirror/Rmd_to_ipynb/R_sample.ipynb @@ -41,7 +41,9 @@ } ], "metadata": { - "main_language": "R" + "jupytext": { + "main_language": "R" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/Rmd_to_ipynb/chunk_options.ipynb b/tests/notebooks/mirror/Rmd_to_ipynb/chunk_options.ipynb index bf9929eae..96a1d2089 100644 --- a/tests/notebooks/mirror/Rmd_to_ipynb/chunk_options.ipynb +++ b/tests/notebooks/mirror/Rmd_to_ipynb/chunk_options.ipynb @@ -59,8 +59,10 @@ } ], "metadata": { - "language_info": { - "name": "python" + "kernelspec": { + "display_name": "Python", + "language": "python", + "name": "python3" } }, "nbformat": 4, diff --git a/tests/notebooks/mirror/Rmd_to_ipynb/ioslides.ipynb b/tests/notebooks/mirror/Rmd_to_ipynb/ioslides.ipynb index 0e5a8cd0d..c11ce213a 100644 --- a/tests/notebooks/mirror/Rmd_to_ipynb/ioslides.ipynb +++ b/tests/notebooks/mirror/Rmd_to_ipynb/ioslides.ipynb @@ -87,7 +87,9 @@ } ], "metadata": { - "main_language": "python" + "jupytext": { + "main_language": "python" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/Rmd_to_ipynb/knitr-spin.ipynb b/tests/notebooks/mirror/Rmd_to_ipynb/knitr-spin.ipynb index 666e51a0a..d0f284290 100644 --- a/tests/notebooks/mirror/Rmd_to_ipynb/knitr-spin.ipynb +++ b/tests/notebooks/mirror/Rmd_to_ipynb/knitr-spin.ipynb @@ -172,7 +172,9 @@ } ], "metadata": { - "main_language": "R" + "jupytext": { + "main_language": "R" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/Rmd_to_ipynb/markdown.ipynb b/tests/notebooks/mirror/Rmd_to_ipynb/markdown.ipynb index fc5f8d301..aac2d8d0b 100644 --- a/tests/notebooks/mirror/Rmd_to_ipynb/markdown.ipynb +++ b/tests/notebooks/mirror/Rmd_to_ipynb/markdown.ipynb @@ -34,7 +34,9 @@ } ], "metadata": { - "main_language": "python" + "jupytext": { + "main_language": "python" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/Notebook with many hash signs.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/Notebook with many hash signs.Rmd index 4902fa2bb..19851bff8 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/Notebook with many hash signs.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/Notebook with many hash signs.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ################################################################## diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/Notebook_with_R_magic.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/Notebook_with_R_magic.Rmd index 92ffd4745..5edc7e8bb 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/Notebook_with_R_magic.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/Notebook_with_R_magic.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 2 language: python name: python2 - language_info: - codemirror_mode: - name: ipython - version: 2 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython2 - version: 2.7.11 --- # A notebook with R cells diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/World population.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/World population.Rmd index 46af96969..ec3250cc0 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/World population.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/World population.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- # A quick insight at world population diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/convert_to_py_then_test_with_update83.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/convert_to_py_then_test_with_update83.Rmd index 6d651541a..13b6da7ff 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/convert_to_py_then_test_with_update83.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/convert_to_py_then_test_with_update83.Rmd @@ -7,16 +7,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.5.3 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/frozen_cell.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/frozen_cell.Rmd index a36ce65ab..eeb50ce55 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/frozen_cell.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/frozen_cell.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.7.0 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/ir_notebook.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/ir_notebook.Rmd index c3378bf58..52fc8e30d 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/ir_notebook.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/ir_notebook.Rmd @@ -4,13 +4,6 @@ jupyter: display_name: R language: R name: ir - language_info: - codemirror_mode: r - file_extension: .r - mimetype: text/x-r-source - name: R - pygments_lexer: r - version: 3.5.0 --- This is a jupyter notebook that uses the IR kernel. diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/julia_benchmark_plotly_barchart.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/julia_benchmark_plotly_barchart.Rmd index 56f16283e..7fe87686b 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/julia_benchmark_plotly_barchart.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/julia_benchmark_plotly_barchart.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter.Rmd index 59fed66b9..fee429e87 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.4 --- # Jupyter notebook diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_again.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_again.Rmd index 1b7c48cf0..b78087cf3 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_again.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_again.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.5 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_in_body.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_in_body.Rmd index 67acb9c43..4d09b654e 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_in_body.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_in_body.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_on_top.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_on_top.Rmd index 69e82c3ea..1c4f2f58b 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_on_top.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/jupyter_with_raw_cell_on_top.Rmd @@ -11,16 +11,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.5 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/notebook_with_complex_metadata.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/notebook_with_complex_metadata.Rmd index 875041fc2..d945e9435 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/notebook_with_complex_metadata.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/notebook_with_complex_metadata.Rmd @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.5.1 --- ```{python} diff --git a/tests/notebooks/mirror/ipynb_to_Rmd/nteract_with_parameter.Rmd b/tests/notebooks/mirror/ipynb_to_Rmd/nteract_with_parameter.Rmd index f196f944b..2c6c9758f 100644 --- a/tests/notebooks/mirror/ipynb_to_Rmd/nteract_with_parameter.Rmd +++ b/tests/notebooks/mirror/ipynb_to_Rmd/nteract_with_parameter.Rmd @@ -6,16 +6,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ```{python outputHidden=FALSE, inputHidden=FALSE, tags=c("parameters")} diff --git a/tests/notebooks/mirror/ipynb_to_md/Notebook with many hash signs.md b/tests/notebooks/mirror/ipynb_to_md/Notebook with many hash signs.md index 075bb798c..82be8de31 100644 --- a/tests/notebooks/mirror/ipynb_to_md/Notebook with many hash signs.md +++ b/tests/notebooks/mirror/ipynb_to_md/Notebook with many hash signs.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ################################################################## diff --git a/tests/notebooks/mirror/ipynb_to_md/World population.md b/tests/notebooks/mirror/ipynb_to_md/World population.md index cd5ca9096..3328426b5 100644 --- a/tests/notebooks/mirror/ipynb_to_md/World population.md +++ b/tests/notebooks/mirror/ipynb_to_md/World population.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- # A quick insight at world population diff --git a/tests/notebooks/mirror/ipynb_to_md/convert_to_py_then_test_with_update83.md b/tests/notebooks/mirror/ipynb_to_md/convert_to_py_then_test_with_update83.md index ed52db763..fdb0349dd 100644 --- a/tests/notebooks/mirror/ipynb_to_md/convert_to_py_then_test_with_update83.md +++ b/tests/notebooks/mirror/ipynb_to_md/convert_to_py_then_test_with_update83.md @@ -7,16 +7,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.5.3 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_md/ir_notebook.md b/tests/notebooks/mirror/ipynb_to_md/ir_notebook.md index 13a4e112f..b7c82c4e2 100644 --- a/tests/notebooks/mirror/ipynb_to_md/ir_notebook.md +++ b/tests/notebooks/mirror/ipynb_to_md/ir_notebook.md @@ -4,13 +4,6 @@ jupyter: display_name: R language: R name: ir - language_info: - codemirror_mode: r - file_extension: .r - mimetype: text/x-r-source - name: R - pygments_lexer: r - version: 3.5.0 --- This is a jupyter notebook that uses the IR kernel. diff --git a/tests/notebooks/mirror/ipynb_to_md/julia_benchmark_plotly_barchart.md b/tests/notebooks/mirror/ipynb_to_md/julia_benchmark_plotly_barchart.md index 9d348fb1f..7c8a0e604 100644 --- a/tests/notebooks/mirror/ipynb_to_md/julia_benchmark_plotly_barchart.md +++ b/tests/notebooks/mirror/ipynb_to_md/julia_benchmark_plotly_barchart.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_md/jupyter.md b/tests/notebooks/mirror/ipynb_to_md/jupyter.md index e78045026..6eb87dd13 100644 --- a/tests/notebooks/mirror/ipynb_to_md/jupyter.md +++ b/tests/notebooks/mirror/ipynb_to_md/jupyter.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.4 --- # Jupyter notebook diff --git a/tests/notebooks/mirror/ipynb_to_md/jupyter_again.md b/tests/notebooks/mirror/ipynb_to_md/jupyter_again.md index eb2dd2210..6249a7fcb 100644 --- a/tests/notebooks/mirror/ipynb_to_md/jupyter_again.md +++ b/tests/notebooks/mirror/ipynb_to_md/jupyter_again.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.5 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md b/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md index d265f87f0..1f3953bbd 100644 --- a/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md +++ b/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_on_top.md b/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_on_top.md index a3276dce8..227adf1ad 100644 --- a/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_on_top.md +++ b/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_on_top.md @@ -11,16 +11,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.5 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_md/notebook_with_complex_metadata.md b/tests/notebooks/mirror/ipynb_to_md/notebook_with_complex_metadata.md index a82e6fce1..9e7eacd78 100644 --- a/tests/notebooks/mirror/ipynb_to_md/notebook_with_complex_metadata.md +++ b/tests/notebooks/mirror/ipynb_to_md/notebook_with_complex_metadata.md @@ -4,16 +4,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.5.1 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_md/nteract_with_parameter.md b/tests/notebooks/mirror/ipynb_to_md/nteract_with_parameter.md index 1c68e24bb..e1341eab9 100644 --- a/tests/notebooks/mirror/ipynb_to_md/nteract_with_parameter.md +++ b/tests/notebooks/mirror/ipynb_to_md/nteract_with_parameter.md @@ -6,16 +6,6 @@ jupyter: display_name: Python 3 language: python name: python3 - language_info: - codemirror_mode: - name: ipython - version: 3 - file_extension: .py - mimetype: text/x-python - name: python - nbconvert_exporter: python - pygments_lexer: ipython3 - version: 3.6.6 --- ```python diff --git a/tests/notebooks/mirror/ipynb_to_percent/Notebook with many hash signs.py b/tests/notebooks/mirror/ipynb_to_percent/Notebook with many hash signs.py index c987502f5..6eb61ac4e 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/Notebook with many hash signs.py +++ b/tests/notebooks/mirror/ipynb_to_percent/Notebook with many hash signs.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/Notebook_with_R_magic.py b/tests/notebooks/mirror/ipynb_to_percent/Notebook_with_R_magic.py index 0c38acb1d..816bb977d 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/Notebook_with_R_magic.py +++ b/tests/notebooks/mirror/ipynb_to_percent/Notebook_with_R_magic.py @@ -4,16 +4,6 @@ # display_name: Python 2 # language: python # name: python2 -# language_info: -# codemirror_mode: -# name: ipython -# version: 2 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython2 -# version: 2.7.11 # --- # %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/Reference Guide for Calysto Scheme.ss b/tests/notebooks/mirror/ipynb_to_percent/Reference Guide for Calysto Scheme.ss index bfa24fbf0..f0b527eb1 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/Reference Guide for Calysto Scheme.ss +++ b/tests/notebooks/mirror/ipynb_to_percent/Reference Guide for Calysto Scheme.ss @@ -5,12 +5,6 @@ ;; display_name: Calysto Scheme (Python) ;; language: scheme ;; name: calysto_scheme -;; language_info: -;; codemirror_mode: -;; name: scheme -;; mimetype: text/x-scheme -;; name: scheme -;; pygments_lexer: scheme ;; --- ;; %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/World population.py b/tests/notebooks/mirror/ipynb_to_percent/World population.py index fe186785c..5fb638892 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/World population.py +++ b/tests/notebooks/mirror/ipynb_to_percent/World population.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/convert_to_py_then_test_with_update83.py b/tests/notebooks/mirror/ipynb_to_percent/convert_to_py_then_test_with_update83.py index 56cb143ab..8300b7c11 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/convert_to_py_then_test_with_update83.py +++ b/tests/notebooks/mirror/ipynb_to_percent/convert_to_py_then_test_with_update83.py @@ -7,16 +7,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.5.3 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/frozen_cell.py b/tests/notebooks/mirror/ipynb_to_percent/frozen_cell.py index 2d4a2786c..3f4975f3f 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/frozen_cell.py +++ b/tests/notebooks/mirror/ipynb_to_percent/frozen_cell.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.7.0 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.R b/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.R index e8ec06ca9..daa60011f 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.R +++ b/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.R @@ -4,13 +4,6 @@ # display_name: R # language: R # name: ir -# language_info: -# codemirror_mode: r -# file_extension: .r -# mimetype: text/x-r-source -# name: R -# pygments_lexer: r -# version: 3.5.0 # --- # %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.low.r b/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.low.r index e8ec06ca9..daa60011f 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.low.r +++ b/tests/notebooks/mirror/ipynb_to_percent/ir_notebook.low.r @@ -4,13 +4,6 @@ # display_name: R # language: R # name: ir -# language_info: -# codemirror_mode: r -# file_extension: .r -# mimetype: text/x-r-source -# name: R -# pygments_lexer: r -# version: 3.5.0 # --- # %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/julia_benchmark_plotly_barchart.jl b/tests/notebooks/mirror/ipynb_to_percent/julia_benchmark_plotly_barchart.jl index 689dbc827..83492565d 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/julia_benchmark_plotly_barchart.jl +++ b/tests/notebooks/mirror/ipynb_to_percent/julia_benchmark_plotly_barchart.jl @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/jupyter.py b/tests/notebooks/mirror/ipynb_to_percent/jupyter.py index 724d74bb0..734cf539b 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/jupyter.py +++ b/tests/notebooks/mirror/ipynb_to_percent/jupyter.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.4 # --- # %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_percent/jupyter_again.py b/tests/notebooks/mirror/ipynb_to_percent/jupyter_again.py index 5a071ba4c..6cdee6b74 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/jupyter_again.py +++ b/tests/notebooks/mirror/ipynb_to_percent/jupyter_again.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.5 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_in_body.py b/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_in_body.py index b06404fa8..3b23dd0de 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_in_body.py +++ b/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_in_body.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_on_top.py b/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_on_top.py index 235e61716..d893cde9f 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_on_top.py +++ b/tests/notebooks/mirror/ipynb_to_percent/jupyter_with_raw_cell_on_top.py @@ -11,16 +11,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.5 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/notebook_with_complex_metadata.py b/tests/notebooks/mirror/ipynb_to_percent/notebook_with_complex_metadata.py index 84d4b2dd4..8906bb6f8 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/notebook_with_complex_metadata.py +++ b/tests/notebooks/mirror/ipynb_to_percent/notebook_with_complex_metadata.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.5.1 # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/nteract_with_parameter.py b/tests/notebooks/mirror/ipynb_to_percent/nteract_with_parameter.py index d068ca02c..4f9ba3209 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/nteract_with_parameter.py +++ b/tests/notebooks/mirror/ipynb_to_percent/nteract_with_parameter.py @@ -6,16 +6,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # %% {"outputHidden": false, "inputHidden": false, "tags": ["parameters"]} diff --git a/tests/notebooks/mirror/ipynb_to_percent/sample_bash_notebook.sh b/tests/notebooks/mirror/ipynb_to_percent/sample_bash_notebook.sh index ddd3275fb..b6c7d3d63 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/sample_bash_notebook.sh +++ b/tests/notebooks/mirror/ipynb_to_percent/sample_bash_notebook.sh @@ -4,11 +4,6 @@ # display_name: Bash # language: bash # name: bash -# language_info: -# codemirror_mode: shell -# file_extension: .sh -# mimetype: text/x-sh -# name: bash # --- # %% diff --git a/tests/notebooks/mirror/ipynb_to_percent/sample_rise_notebook_66.py b/tests/notebooks/mirror/ipynb_to_percent/sample_rise_notebook_66.py index 8b6d08ed9..07c0bced1 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/sample_rise_notebook_66.py +++ b/tests/notebooks/mirror/ipynb_to_percent/sample_rise_notebook_66.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # %% [markdown] {"slideshow": {"slide_type": "slide"}} diff --git a/tests/notebooks/mirror/ipynb_to_percent/xcpp_by_quantstack.cpp b/tests/notebooks/mirror/ipynb_to_percent/xcpp_by_quantstack.cpp index 1862841de..249ccf6eb 100644 --- a/tests/notebooks/mirror/ipynb_to_percent/xcpp_by_quantstack.cpp +++ b/tests/notebooks/mirror/ipynb_to_percent/xcpp_by_quantstack.cpp @@ -4,12 +4,6 @@ // display_name: C++14 // language: C++14 // name: xeus-cling-cpp14 -// language_info: -// codemirror_mode: text/x-c++src -// file_extension: .cpp -// mimetype: text/x-c++src -// name: c++ -// version: -std=c++14 // --- // %% [markdown] diff --git a/tests/notebooks/mirror/ipynb_to_script/Notebook with many hash signs.py b/tests/notebooks/mirror/ipynb_to_script/Notebook with many hash signs.py index ebbb58f64..52bef030f 100644 --- a/tests/notebooks/mirror/ipynb_to_script/Notebook with many hash signs.py +++ b/tests/notebooks/mirror/ipynb_to_script/Notebook with many hash signs.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # ################################################################## diff --git a/tests/notebooks/mirror/ipynb_to_script/Notebook_with_R_magic.py b/tests/notebooks/mirror/ipynb_to_script/Notebook_with_R_magic.py index a34b7fccb..84fdda2cd 100644 --- a/tests/notebooks/mirror/ipynb_to_script/Notebook_with_R_magic.py +++ b/tests/notebooks/mirror/ipynb_to_script/Notebook_with_R_magic.py @@ -4,16 +4,6 @@ # display_name: Python 2 # language: python # name: python2 -# language_info: -# codemirror_mode: -# name: ipython -# version: 2 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython2 -# version: 2.7.11 # --- # # A notebook with R cells diff --git a/tests/notebooks/mirror/ipynb_to_script/Reference Guide for Calysto Scheme.ss b/tests/notebooks/mirror/ipynb_to_script/Reference Guide for Calysto Scheme.ss index fcaee317d..ba044c3bd 100644 --- a/tests/notebooks/mirror/ipynb_to_script/Reference Guide for Calysto Scheme.ss +++ b/tests/notebooks/mirror/ipynb_to_script/Reference Guide for Calysto Scheme.ss @@ -5,12 +5,6 @@ ;; display_name: Calysto Scheme (Python) ;; language: scheme ;; name: calysto_scheme -;; language_info: -;; codemirror_mode: -;; name: scheme -;; mimetype: text/x-scheme -;; name: scheme -;; pygments_lexer: scheme ;; --- ;; diff --git a/tests/notebooks/mirror/ipynb_to_script/World population.py b/tests/notebooks/mirror/ipynb_to_script/World population.py index 097732a47..f86edd830 100644 --- a/tests/notebooks/mirror/ipynb_to_script/World population.py +++ b/tests/notebooks/mirror/ipynb_to_script/World population.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # # A quick insight at world population diff --git a/tests/notebooks/mirror/ipynb_to_script/convert_to_py_then_test_with_update83.py b/tests/notebooks/mirror/ipynb_to_script/convert_to_py_then_test_with_update83.py index be9e4d1cf..ab75b713d 100644 --- a/tests/notebooks/mirror/ipynb_to_script/convert_to_py_then_test_with_update83.py +++ b/tests/notebooks/mirror/ipynb_to_script/convert_to_py_then_test_with_update83.py @@ -7,16 +7,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.5.3 # --- # + diff --git a/tests/notebooks/mirror/ipynb_to_script/frozen_cell.py b/tests/notebooks/mirror/ipynb_to_script/frozen_cell.py index 4e64efdb3..f461d20c2 100644 --- a/tests/notebooks/mirror/ipynb_to_script/frozen_cell.py +++ b/tests/notebooks/mirror/ipynb_to_script/frozen_cell.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.7.0 # --- # This is an unfrozen cell. Works as usual. diff --git a/tests/notebooks/mirror/ipynb_to_script/ir_notebook.R b/tests/notebooks/mirror/ipynb_to_script/ir_notebook.R index 642d0bf7c..30d996f3c 100644 --- a/tests/notebooks/mirror/ipynb_to_script/ir_notebook.R +++ b/tests/notebooks/mirror/ipynb_to_script/ir_notebook.R @@ -4,13 +4,6 @@ #' display_name: R #' language: R #' name: ir -#' language_info: -#' codemirror_mode: r -#' file_extension: .r -#' mimetype: text/x-r-source -#' name: R -#' pygments_lexer: r -#' version: 3.5.0 #' --- #' This is a jupyter notebook that uses the IR kernel. diff --git a/tests/notebooks/mirror/ipynb_to_script/ir_notebook.low.r b/tests/notebooks/mirror/ipynb_to_script/ir_notebook.low.r index 642d0bf7c..30d996f3c 100644 --- a/tests/notebooks/mirror/ipynb_to_script/ir_notebook.low.r +++ b/tests/notebooks/mirror/ipynb_to_script/ir_notebook.low.r @@ -4,13 +4,6 @@ #' display_name: R #' language: R #' name: ir -#' language_info: -#' codemirror_mode: r -#' file_extension: .r -#' mimetype: text/x-r-source -#' name: R -#' pygments_lexer: r -#' version: 3.5.0 #' --- #' This is a jupyter notebook that uses the IR kernel. diff --git a/tests/notebooks/mirror/ipynb_to_script/julia_benchmark_plotly_barchart.jl b/tests/notebooks/mirror/ipynb_to_script/julia_benchmark_plotly_barchart.jl index e67f1849a..9cf238605 100644 --- a/tests/notebooks/mirror/ipynb_to_script/julia_benchmark_plotly_barchart.jl +++ b/tests/notebooks/mirror/ipynb_to_script/julia_benchmark_plotly_barchart.jl @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # + diff --git a/tests/notebooks/mirror/ipynb_to_script/jupyter.py b/tests/notebooks/mirror/ipynb_to_script/jupyter.py index 521bb00c0..29e36a642 100644 --- a/tests/notebooks/mirror/ipynb_to_script/jupyter.py +++ b/tests/notebooks/mirror/ipynb_to_script/jupyter.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.4 # --- # # Jupyter notebook diff --git a/tests/notebooks/mirror/ipynb_to_script/jupyter_again.py b/tests/notebooks/mirror/ipynb_to_script/jupyter_again.py index d3ba2477f..3b302a9fe 100644 --- a/tests/notebooks/mirror/ipynb_to_script/jupyter_again.py +++ b/tests/notebooks/mirror/ipynb_to_script/jupyter_again.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.5 # --- c = ''' diff --git a/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_in_body.py b/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_in_body.py index a06594270..c8248ba47 100644 --- a/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_in_body.py +++ b/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_in_body.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- 1+2+3 diff --git a/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_on_top.py b/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_on_top.py index 31c89a80f..4049201a5 100644 --- a/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_on_top.py +++ b/tests/notebooks/mirror/ipynb_to_script/jupyter_with_raw_cell_on_top.py @@ -11,16 +11,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.5 # --- 1+2+3 diff --git a/tests/notebooks/mirror/ipynb_to_script/notebook_with_complex_metadata.py b/tests/notebooks/mirror/ipynb_to_script/notebook_with_complex_metadata.py index fcbe6a1d1..2fb286b5c 100644 --- a/tests/notebooks/mirror/ipynb_to_script/notebook_with_complex_metadata.py +++ b/tests/notebooks/mirror/ipynb_to_script/notebook_with_complex_metadata.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.5.1 # --- diff --git a/tests/notebooks/mirror/ipynb_to_script/nteract_with_parameter.py b/tests/notebooks/mirror/ipynb_to_script/nteract_with_parameter.py index 5fbbe718e..569b856ab 100644 --- a/tests/notebooks/mirror/ipynb_to_script/nteract_with_parameter.py +++ b/tests/notebooks/mirror/ipynb_to_script/nteract_with_parameter.py @@ -6,16 +6,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # + {"outputHidden": false, "inputHidden": false, "tags": ["parameters"]} diff --git a/tests/notebooks/mirror/ipynb_to_script/sample_bash_notebook.sh b/tests/notebooks/mirror/ipynb_to_script/sample_bash_notebook.sh index 34250cd85..f765cfc87 100644 --- a/tests/notebooks/mirror/ipynb_to_script/sample_bash_notebook.sh +++ b/tests/notebooks/mirror/ipynb_to_script/sample_bash_notebook.sh @@ -4,11 +4,6 @@ # display_name: Bash # language: bash # name: bash -# language_info: -# codemirror_mode: shell -# file_extension: .sh -# mimetype: text/x-sh -# name: bash # --- ls diff --git a/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py b/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py index 40b2afe2b..08533c806 100644 --- a/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py +++ b/tests/notebooks/mirror/ipynb_to_script/sample_rise_notebook_66.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- # + {"slideshow": {"slide_type": "slide"}, "cell_type": "markdown"} diff --git a/tests/notebooks/mirror/ipynb_to_script/xcpp_by_quantstack.cpp b/tests/notebooks/mirror/ipynb_to_script/xcpp_by_quantstack.cpp index 8311e5c3a..9e1361399 100644 --- a/tests/notebooks/mirror/ipynb_to_script/xcpp_by_quantstack.cpp +++ b/tests/notebooks/mirror/ipynb_to_script/xcpp_by_quantstack.cpp @@ -4,12 +4,6 @@ // display_name: C++14 // language: C++14 // name: xeus-cling-cpp14 -// language_info: -// codemirror_mode: text/x-c++src -// file_extension: .cpp -// mimetype: text/x-c++src -// name: c++ -// version: -std=c++14 // --- // [![xeus-cling](images/xeus-cling.png)](https://github.com/QuantStack/xeus-cling/) diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/World population.py b/tests/notebooks/mirror/ipynb_to_sphinx/World population.py index 7defb7a69..420b86e43 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/World population.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/World population.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- """ diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/convert_to_py_then_test_with_update83.py b/tests/notebooks/mirror/ipynb_to_sphinx/convert_to_py_then_test_with_update83.py index 273fe3f08..53230a2b8 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/convert_to_py_then_test_with_update83.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/convert_to_py_then_test_with_update83.py @@ -7,16 +7,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.5.3 # --- # %%time diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/jupyter.py b/tests/notebooks/mirror/ipynb_to_sphinx/jupyter.py index 3487e2499..a3de5148a 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/jupyter.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/jupyter.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.4 # --- """ diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/jupyter_again.py b/tests/notebooks/mirror/ipynb_to_sphinx/jupyter_again.py index 4b54be066..f2640162f 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/jupyter_again.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/jupyter_again.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.5 # --- c = ''' diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/notebook_with_complex_metadata.py b/tests/notebooks/mirror/ipynb_to_sphinx/notebook_with_complex_metadata.py index fcbe6a1d1..2fb286b5c 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/notebook_with_complex_metadata.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/notebook_with_complex_metadata.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.5.1 # --- diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/nteract_with_parameter.py b/tests/notebooks/mirror/ipynb_to_sphinx/nteract_with_parameter.py index 9212a2ef7..a812683a6 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/nteract_with_parameter.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/nteract_with_parameter.py @@ -6,16 +6,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- param = 4 diff --git a/tests/notebooks/mirror/ipynb_to_sphinx/sample_rise_notebook_66.py b/tests/notebooks/mirror/ipynb_to_sphinx/sample_rise_notebook_66.py index 62549fee1..7de7c1af4 100644 --- a/tests/notebooks/mirror/ipynb_to_sphinx/sample_rise_notebook_66.py +++ b/tests/notebooks/mirror/ipynb_to_sphinx/sample_rise_notebook_66.py @@ -4,16 +4,6 @@ # display_name: Python 3 # language: python # name: python3 -# language_info: -# codemirror_mode: -# name: ipython -# version: 3 -# file_extension: .py -# mimetype: text/x-python -# name: python -# nbconvert_exporter: python -# pygments_lexer: ipython3 -# version: 3.6.6 # --- """ diff --git a/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.R b/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.R index 642d0bf7c..30d996f3c 100644 --- a/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.R +++ b/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.R @@ -4,13 +4,6 @@ #' display_name: R #' language: R #' name: ir -#' language_info: -#' codemirror_mode: r -#' file_extension: .r -#' mimetype: text/x-r-source -#' name: R -#' pygments_lexer: r -#' version: 3.5.0 #' --- #' This is a jupyter notebook that uses the IR kernel. diff --git a/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.low.r b/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.low.r index 642d0bf7c..30d996f3c 100644 --- a/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.low.r +++ b/tests/notebooks/mirror/ipynb_to_spin/ir_notebook.low.r @@ -4,13 +4,6 @@ #' display_name: R #' language: R #' name: ir -#' language_info: -#' codemirror_mode: r -#' file_extension: .r -#' mimetype: text/x-r-source -#' name: R -#' pygments_lexer: r -#' version: 3.5.0 #' --- #' This is a jupyter notebook that uses the IR kernel. diff --git a/tests/notebooks/mirror/script_to_ipynb/hydrogen.ipynb b/tests/notebooks/mirror/script_to_ipynb/hydrogen.ipynb index 5cbd532f8..ab346f5ad 100644 --- a/tests/notebooks/mirror/script_to_ipynb/hydrogen.ipynb +++ b/tests/notebooks/mirror/script_to_ipynb/hydrogen.ipynb @@ -38,7 +38,9 @@ } ], "metadata": { - "main_language": "python" + "jupytext": { + "main_language": "python" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/script_to_ipynb/julia_sample_script.ipynb b/tests/notebooks/mirror/script_to_ipynb/julia_sample_script.ipynb index 882b87795..39776bcbd 100644 --- a/tests/notebooks/mirror/script_to_ipynb/julia_sample_script.ipynb +++ b/tests/notebooks/mirror/script_to_ipynb/julia_sample_script.ipynb @@ -78,9 +78,9 @@ ], "metadata": { "jupytext": { - "encoding": "# -*- coding: utf-8 -*-" - }, - "main_language": "julia" + "encoding": "# -*- coding: utf-8 -*-", + "main_language": "julia" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/script_to_ipynb/knitr-spin.ipynb b/tests/notebooks/mirror/script_to_ipynb/knitr-spin.ipynb index 666e51a0a..d0f284290 100644 --- a/tests/notebooks/mirror/script_to_ipynb/knitr-spin.ipynb +++ b/tests/notebooks/mirror/script_to_ipynb/knitr-spin.ipynb @@ -172,7 +172,9 @@ } ], "metadata": { - "main_language": "R" + "jupytext": { + "main_language": "R" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/script_to_ipynb/light_sample.ipynb b/tests/notebooks/mirror/script_to_ipynb/light_sample.ipynb index 50fcb5d72..d1445c9ff 100644 --- a/tests/notebooks/mirror/script_to_ipynb/light_sample.ipynb +++ b/tests/notebooks/mirror/script_to_ipynb/light_sample.ipynb @@ -22,12 +22,12 @@ "metadata": { "jupytext": { "formats": "ipynb,py", + "main_language": "python", "text_representation": { "format_name": "light", "format_version": "1.2" } - }, - "main_language": "python" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/script_to_ipynb/python_notebook_sample.ipynb b/tests/notebooks/mirror/script_to_ipynb/python_notebook_sample.ipynb index d8e964b48..f1932999b 100644 --- a/tests/notebooks/mirror/script_to_ipynb/python_notebook_sample.ipynb +++ b/tests/notebooks/mirror/script_to_ipynb/python_notebook_sample.ipynb @@ -168,7 +168,9 @@ } ], "metadata": { - "main_language": "python" + "jupytext": { + "main_language": "python" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/notebooks/mirror/sphinx_to_ipynb/plot_notebook.ipynb b/tests/notebooks/mirror/sphinx_to_ipynb/plot_notebook.ipynb index ac1024fc2..57684e08a 100644 --- a/tests/notebooks/mirror/sphinx_to_ipynb/plot_notebook.ipynb +++ b/tests/notebooks/mirror/sphinx_to_ipynb/plot_notebook.ipynb @@ -123,8 +123,7 @@ { "cell_type": "markdown", "metadata": { - "cell_marker": "##########################################################################", - "lines_to_next_cell": 2 + "cell_marker": "##########################################################################" }, "source": [ "There's some subtle differences between rendered html rendered comment\n", @@ -141,6 +140,7 @@ "metadata": {}, "outputs": [], "source": [ + "\n", "def dummy():\n", " \"\"\"Dummy function to make sure docstrings don't get rendered as text\"\"\"\n", " pass\n", @@ -210,9 +210,9 @@ ], "metadata": { "jupytext": { - "encoding": "# -*- coding: utf-8 -*-" - }, - "main_language": "python" + "encoding": "# -*- coding: utf-8 -*-", + "main_language": "python" + } }, "nbformat": 4, "nbformat_minor": 2 diff --git a/tests/test_compare.py b/tests/test_compare.py index 8cfea3a8c..b4d245d1e 100644 --- a/tests/test_compare.py +++ b/tests/test_compare.py @@ -7,8 +7,10 @@ def test_raise_on_different_metadata(): - ref = new_notebook(metadata={'language_info': {'name': 'python'}}, cells=[new_markdown_cell('Cell one')]) - test = new_notebook(metadata={'language_info': {'name': 'R'}}, cells=[new_markdown_cell('Cell one')]) + ref = new_notebook(metadata={'kernelspec': {'language': 'python', 'name': 'python', 'display_name': 'Python'}}, + cells=[new_markdown_cell('Cell one')]) + test = new_notebook(metadata={'kernelspec': {'language': 'R', 'name': 'R', 'display_name': 'R'}}, + cells=[new_markdown_cell('Cell one')]) with pytest.raises(NotebookDifference): compare_notebooks(ref, test, ext='.md') diff --git a/tests/test_contentsmanager.py b/tests/test_contentsmanager.py index 257cb7dbf..15189b73a 100644 --- a/tests/test_contentsmanager.py +++ b/tests/test_contentsmanager.py @@ -534,7 +534,7 @@ def test_save_in_pct_and_lgt_auto_extensions(nb_file, tmpdir): assert read_format_from_metadata(stream.read(), '.lgt' + auto_ext) == 'light' -@pytest.mark.parametrize('nb_file', list_notebooks('ipynb')) +@pytest.mark.parametrize('nb_file', list_notebooks('ipynb', skip='magic')) def test_metadata_filter_is_effective(nb_file, tmpdir): nb = jupytext.readf(nb_file) tmp_ipynb = 'notebook.ipynb' @@ -550,7 +550,7 @@ def test_metadata_filter_is_effective(nb_file, tmpdir): # set config cm.default_jupytext_formats = 'ipynb, py' - cm.default_notebook_metadata_filter = 'language_info,jupytext,-all' + cm.default_notebook_metadata_filter = 'jupytext,-all' cm.default_cell_metadata_filter = '-all' # load notebook @@ -558,7 +558,7 @@ def test_metadata_filter_is_effective(nb_file, tmpdir): nb = cm.get(tmp_ipynb)['content'] assert nb.metadata['jupytext']['metadata_filter']['cells'] == {'excluded': 'all'} - assert nb.metadata['jupytext']['metadata_filter']['notebook'] == {'additional': ['language_info', 'jupytext'], + assert nb.metadata['jupytext']['metadata_filter']['notebook'] == {'additional': ['jupytext'], 'excluded': 'all'} # save notebook again @@ -570,7 +570,7 @@ def test_metadata_filter_is_effective(nb_file, tmpdir): nb2 = jupytext.readf(str(tmpdir.join(tmp_script))) # test no metadata - assert set(nb2.metadata.keys()) <= {'language_info', 'jupytext'} + assert set(nb2.metadata.keys()) <= {'jupytext'} for cell in nb2.cells: assert not cell.metadata