mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.65k stars 386 forks source link

A few tests fail in the CI when Quarto is installed #1255

Open mwouts opened 4 months ago

mwouts commented 4 months ago

See for instance https://github.com/mwouts/jupytext/actions/runs/9826548787/job/27128181702

mwouts commented 4 months ago

I can reproduce the failures locally with quarto==1.5.54.

The failing tests are

FAILED tests/external/contents_manager/test_contentsmanager_external.py::test_save_load_paired_qmd_notebook[ipynb_py/cat_variable.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/contents_manager/test_contentsmanager_external.py::test_save_load_paired_qmd_notebook[ipynb_py/frozen_cell.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/contents_manager/test_contentsmanager_external.py::test_save_load_paired_qmd_notebook[ipynb_julia/julia_benchmark_plotly_barchart.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/simple_external_notebooks/test_read_simple_quarto.py::test_qmd_to_ipynb - jupytext.compare.NotebookDifference: Notebook metadata differ: 
FAILED tests/external/contents_manager/test_contentsmanager_external.py::test_save_load_paired_qmd_notebook[ipynb_py/Notebook_with_more_R_magic_111.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/round_trip/test_mirror_external.py::test_ipynb_to_quarto[ipynb_py/cat_variable.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/round_trip/test_mirror_external.py::test_ipynb_to_quarto[ipynb_julia/julia_benchmark_plotly_barchart.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/round_trip/test_mirror_external.py::test_ipynb_to_quarto[ipynb_py/frozen_cell.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
FAILED tests/external/round_trip/test_mirror_external.py::test_ipynb_to_quarto[ipynb_py/Notebook_with_more_R_magic_111.ipynb] - jupytext.compare.NotebookDifference: Unexpected cell type 'markdown' for code cell #1:
mwouts commented 4 months ago

The test tests/external/simple_external_notebooks/test_read_simple_quarto.py::test_qmd_to_ipynb highlights a difference on the kernelspecs. I am not sure what might cause this:

>               raise NotebookDifference(f"Notebook metadata differ: {str(error)}")
E               jupytext.compare.NotebookDifference: Notebook metadata differ: 
E               --- expected
E               +++ actual
E               @@ -1,7 +1,8 @@
E                {
E                 "kernelspec": {
E               -  "display_name": "python_kernel",
E               +  "display_name": "Python 3 (ipykernel)",
E                  "language": "python",
E               -  "name": "python_kernel"
E               +  "name": "python3",
E               +  "path": "/home/marc/.local/share/jupyter/kernels/python3"
E                 }
E                }
mwouts commented 4 months ago

Looking into tests/external/round_trip/test_mirror_external.py::test_ipynb_to_quarto[ipynb_py/cat_variable.ipynb], I see that the notebook now gets an extra markdown cell with this content:

{'cell_type': 'markdown', 'metadata': {}, 'source': '---\njupyter: python3\n---'}