diff --git a/myst_nb/core/read.py b/myst_nb/core/read.py index 6951f34a..8fc2bb67 100644 --- a/myst_nb/core/read.py +++ b/myst_nb/core/read.py @@ -68,7 +68,7 @@ def create_nb_reader( # we check suffixes ordered by longest first, to ensure we get the "closest" match iterator = sorted(readers.items(), key=lambda x: len(x[0]), reverse=True) for suffix, (reader, reader_kwargs, commonmark_only) in iterator: - if Path(path).suffix == suffix: + if str(Path(path)).endswith(suffix): if isinstance(reader, str): # attempt to load the reader as an object path reader = import_object(reader) diff --git a/tests/conftest.py b/tests/conftest.py index 7d8f6436..7c73e640 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -39,6 +39,20 @@ def build_matplotlib_font_cache(): FontManager() +def _split_ext(conf, sphinx_params): + if custom_formats := conf.get("nb_custom_formats"): + split_files = [ + file.rstrip(k) + for file in sphinx_params["files"] + for k in custom_formats.keys() + if file.endswith(k) + ] + else: + split_files = [os.path.splitext(file)[0] for file in sphinx_params["files"]] + + return split_files[0], split_files + + @pytest.fixture() def get_test_path(): def _get_test_path(name): @@ -55,7 +69,7 @@ class SphinxFixture: def __init__(self, app, filenames): self.app = app self.env = app.env - self.files = [os.path.splitext(ff) for ff in filenames] + self.files = filenames self.software_versions = ( f".sphinx{sphinx.version_info[0]}" # software version tracking for fixtures ) @@ -79,26 +93,26 @@ def warnings(self): def invalidate_files(self): """Invalidate the files, such that it will be flagged for a re-read.""" - for name, _ in self.files: + for name in self.files: self.env.all_docs.pop(name) def get_resolved_doctree(self, docname=None): """Load and return the built docutils.document, after post-transforms.""" - docname = docname or self.files[0][0] + docname = docname or self.files[0] doctree = self.env.get_and_resolve_doctree(docname, self.app.builder) doctree["source"] = docname return doctree def get_doctree(self, docname=None): """Load and return the built docutils.document.""" - docname = docname or self.files[0][0] + docname = docname or self.files[0] doctree = self.env.get_doctree(docname) doctree["source"] = docname return doctree def get_html(self, index=0): """Return the built HTML file.""" - name = self.files[index][0] + name = self.files[index] _path = self.app.outdir / (name + ".html") if not _path.exists(): pytest.fail("html not output") @@ -106,7 +120,7 @@ def get_html(self, index=0): def get_nb(self, index=0): """Return the output notebook (after any execution).""" - name = self.files[index][0] + name = self.files[index] _path = self.app.srcdir / "_build" / "jupyter_execute" / (name + ".ipynb") if not _path.exists(): pytest.fail("notebook not output") @@ -114,7 +128,7 @@ def get_nb(self, index=0): def get_report_file(self, index=0): """Return the report file for a failed execution.""" - name = self.files[index][0] + name = self.files[index] _path = self.app.outdir / "reports" / (name + ".err.log") if not _path.exists(): pytest.fail("report log not output") @@ -153,9 +167,11 @@ def sphinx_run(sphinx_params, make_app, tmp_path): conf = sphinx_params.get("conf", {}) buildername = sphinx_params.get("buildername", "html") + master_doc, split_files = _split_ext(conf, sphinx_params) + confoverrides = { "extensions": ["myst_nb"], - "master_doc": os.path.splitext(sphinx_params["files"][0])[0], + "master_doc": master_doc, "exclude_patterns": ["_build"], "nb_execution_show_tb": True, } @@ -199,7 +215,7 @@ def sphinx_run(sphinx_params, make_app, tmp_path): buildername=buildername, srcdir=app_srcdir, confoverrides=confoverrides ) - yield SphinxFixture(app, sphinx_params["files"]) + yield SphinxFixture(app, split_files) # reset working directory os.chdir(current_dir) diff --git a/tests/notebooks/custom-formats2.extra.exnt b/tests/notebooks/custom-formats2.extra.exnt new file mode 100644 index 00000000..4cd2f178 --- /dev/null +++ b/tests/notebooks/custom-formats2.extra.exnt @@ -0,0 +1,21 @@ +--- +title: "Test chunk options in Rmd/Jupyter conversion" +author: "Marc Wouts" +date: "June 16, 2018" +jupyter: + kernelspec: + display_name: Python + language: python + name: python3 +--- + +# Custom Formats + +```{python echo=TRUE} +import pandas as pd +x = pd.Series({'A':1, 'B':3, 'C':2}) +``` + +```{python bar_plot, echo=FALSE, fig.height=5, fig.width=8} +x.plot(kind='bar', title='Sample plot') +``` diff --git a/tests/test_execute.py b/tests/test_execute.py index f39d1df0..9597182a 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -365,3 +365,47 @@ def test_custom_convert_cache(sphinx_run, file_regression, check_nbs): assert data assert data["method"] == "cache" assert data["succeeded"] is True + + +@pytest.mark.sphinx_params( + "custom-formats2.extra.exnt", + conf={ + "nb_execution_mode": "auto", + "nb_custom_formats": {".extra.exnt": ["jupytext.reads", {"fmt": "Rmd"}]}, + }, +) +def test_custom_convert_multiple_extensions_auto( + sphinx_run, file_regression, check_nbs +): + """The outputs should be populated.""" + sphinx_run.build() + assert sphinx_run.warnings() == "" + regress_nb_doc(file_regression, sphinx_run, check_nbs) + + assert NbMetadataCollector.new_exec_data(sphinx_run.env) + data = NbMetadataCollector.get_exec_data(sphinx_run.env, "custom-formats2") + assert data + assert data["method"] == "auto" + assert data["succeeded"] is True + + +@pytest.mark.sphinx_params( + "custom-formats2.extra.exnt", + conf={ + "nb_execution_mode": "cache", + "nb_custom_formats": {".extra.exnt": ["jupytext.reads", {"fmt": "Rmd"}]}, + }, +) +def test_custom_convert_multiple_extensions_cache( + sphinx_run, file_regression, check_nbs +): + """The outputs should be populated.""" + sphinx_run.build() + assert sphinx_run.warnings() == "" + regress_nb_doc(file_regression, sphinx_run, check_nbs) + + assert NbMetadataCollector.new_exec_data(sphinx_run.env) + data = NbMetadataCollector.get_exec_data(sphinx_run.env, "custom-formats2") + assert data + assert data["method"] == "cache" + assert data["succeeded"] is True diff --git a/tests/test_execute/test_custom_convert_multiple_extensions_auto.ipynb b/tests/test_execute/test_custom_convert_multiple_extensions_auto.ipynb new file mode 100644 index 00000000..f4a29043 --- /dev/null +++ b/tests/test_execute/test_custom_convert_multiple_extensions_auto.ipynb @@ -0,0 +1,102 @@ +{ + "cells": [ + { + "cell_type": "raw", + "id": "d0aefb9b", + "metadata": {}, + "source": [ + "---\n", + "title: \"Test chunk options in Rmd/Jupyter conversion\"\n", + "author: \"Marc Wouts\"\n", + "date: \"June 16, 2018\"\n", + "---" + ] + }, + { + "cell_type": "markdown", + "id": "c67b3701", + "metadata": {}, + "source": [ + "# Custom Formats" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "ef881a36", + "metadata": { + "echo": true + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "x = pd.Series({'A':1, 'B':3, 'C':2})" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "f7710843", + "metadata": { + "fig.height": 5, + "fig.width": 8, + "name": "bar_plot", + "tags": [ + "remove_input" + ] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGvCAYAAACJsNWPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuNSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/xnp5ZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAi3UlEQVR4nO3de1DVdf7H8ddB5eAFUDduIqGNhuIFFW/YTJqh6BJJs5Vr00CmjGtguezkLG6rabNz3MxLmxdiC5mtdXS18n5J8bYFrXkrbSdaLwEVoK56QCpo4fv7o/HU+QnqQfQj8HzMfGc83/P98n0f9uzy3O/5nnNslmVZAgAAMMTL9AAAAKBlI0YAAIBRxAgAADCKGAEAAEYRIwAAwChiBAAAGEWMAAAAo4gRAABgFDECAACMIkYAGGWz2fTiiy/e9uPm5OTIZrPpyy+/vO3HBuCOGAGagePHj+vRRx9VeHi4fHx8FBoaqjFjxui1114zPVqztHr1ai1dutT0GECzQYwATVxeXp4GDx6sTz75RCkpKVq2bJmmTp0qLy8vvfrqq6bHa5aIEaBxtTY9AICb86c//Un+/v76+OOP1bFjR7f7zp49a2YoAPAAZ0aAJu7UqVPq06fPVSEiSYGBgW63V61apdGjRyswMFB2u12RkZFauXLlVft169ZNDz30kPbt26fBgwerbdu26tevn/bt2ydJevfdd9WvXz/5+PgoOjpaR48eddv/qaeeUocOHXT69GnFxcWpffv26tKli+bPn68b+aLwr7/+Wk8//bSCgoJkt9vVp08fZWdn39Dvw2azKS0tTX//+98VERHhmvHAgQM3tP+KFSvUp08f2e12denSRampqbp06ZLr/lGjRmnr1q0qLCyUzWaTzWZTt27dbuhnA6gbZ0aAJi48PFz5+fk6ceKE+vbte81tV65cqT59+ujhhx9W69attXnzZj3zzDOqra1Vamqq27YnT57UE088oWnTpunJJ5/UK6+8ooSEBGVmZmr27Nl65plnJEkOh0OPP/64CgoK5OX10/+/qamp0bhx4zR8+HC9/PLL2rFjh+bOnav//e9/mj9/fr0zlpWVafjw4a6oCAgI0Pbt2zVlyhSVl5dr5syZ1/2d7N+/X2vXrtWzzz4ru92uFStWaNy4cTp48OA1f0cvvvii5s2bp9jYWE2fPl0FBQVauXKlPv74Y3344Ydq06aN/vCHP8jpdOqrr77SkiVLJEkdOnS47kwArsEC0KS9//77VqtWraxWrVpZMTEx1qxZs6ydO3da1dXVV2377bffXrUuLi7Ouueee9zWhYeHW5KsvLw817qdO3dakqy2bdtahYWFrvWvv/66Jcnau3eva11ycrIlyZoxY4ZrXW1trRUfH295e3tb586dc62XZM2dO9d1e8qUKVZISIh1/vx5t5l+/etfW/7+/nU+hp+TZEmyDh065FpXWFho+fj4WI888ohr3apVqyxJ1pkzZyzLsqyzZ89a3t7e1tixY62amhrXdsuWLbMkWdnZ2a518fHxVnh4+DXnAHDjeJkGaOLGjBmj/Px8Pfzww/rkk0/08ssvKy4uTqGhodq0aZPbtm3btnX92+l06vz58xo5cqROnz4tp9Pptm1kZKRiYmJct4cNGyZJGj16tO6+++6r1p8+ffqq2dLS0lz/vnKmo7q6Wrt3767zsViWpXfeeUcJCQmyLEvnz593LXFxcXI6nTpy5Mh1fycxMTGKjo523b777rs1YcIE7dy5UzU1NXXus3v3blVXV2vmzJluZ3hSUlLk5+enrVu3Xve4ABqGGAGagSFDhujdd9/VxYsXdfDgQWVkZKiiokKPPvqo/v3vf7u2+/DDDxUbG6v27durY8eOCggI0OzZsyXpqhj5eXBIkr+/vyQpLCyszvUXL150W+/l5aV77rnHbd29994rSfV+tse5c+d06dIlZWVlKSAgwG2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rMpLi5Oy5cvd8Uybh1ipIWpqanR5s2blZ2dTYzgtps8efINbbdq1apbPAlwtYsXL+rkyZOyLEs9e/Z0ewkRtxYxAgAAjOICVgAAYBQxAgAAjCJGAACAUcQIAAAwihgBAABGESMAAMAoYgQAABhFjAAAAKP+D22J+/qTJEVoAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "x.plot(kind='bar', title='Sample plot')" + ] + } + ], + "metadata": { + "jupytext": { + "text_representation": { + "extension": ".Rmd", + "format_name": "rmarkdown" + } + }, + "kernelspec": { + "display_name": "Python", + "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.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tests/test_execute/test_custom_convert_multiple_extensions_auto.xml b/tests/test_execute/test_custom_convert_multiple_extensions_auto.xml new file mode 100644 index 00000000..b59e6cd5 --- /dev/null +++ b/tests/test_execute/test_custom_convert_multiple_extensions_auto.xml @@ -0,0 +1,21 @@ + +
+ + Custom Formats + <container cell_index="2" cell_metadata="{'echo': True}" classes="cell" exec_count="1" nb_element="cell_code"> + <container classes="cell_input" nb_element="cell_code_source"> + <literal_block language="ipython3" xml:space="preserve"> + import pandas as pd + x = pd.Series({'A':1, 'B':3, 'C':2}) + <container cell_index="3" cell_metadata="{'name': 'bar_plot', 'tags': ['remove_input'], 'fig.height': 5, 'fig.width': 8}" classes="cell tag_remove_input" exec_count="2" nb_element="cell_code"> + <container classes="cell_output" nb_element="cell_code_output"> + <container nb_element="mime_bundle"> + <container mime_type="text/plain"> + <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> + <Axes: title={'center': 'Sample plot'}> + <container nb_element="mime_bundle"> + <container mime_type="text/plain"> + <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> + <Figure size 640x480 with 1 Axes> + <container mime_type="image/png"> + <image candidates="{'*': '_build/jupyter_execute/a2e637020dfe58f670ba2c942d7a55e49ba48bed09312569ee15a84f5ac680cb.png'}" uri="_build/jupyter_execute/a2e637020dfe58f670ba2c942d7a55e49ba48bed09312569ee15a84f5ac680cb.png"> diff --git a/tests/test_execute/test_custom_convert_multiple_extensions_cache.ipynb b/tests/test_execute/test_custom_convert_multiple_extensions_cache.ipynb new file mode 100644 index 00000000..04936e48 --- /dev/null +++ b/tests/test_execute/test_custom_convert_multiple_extensions_cache.ipynb @@ -0,0 +1,102 @@ +{ + "cells": [ + { + "cell_type": "raw", + "id": "e22c2f16", + "metadata": {}, + "source": [ + "---\n", + "title: \"Test chunk options in Rmd/Jupyter conversion\"\n", + "author: \"Marc Wouts\"\n", + "date: \"June 16, 2018\"\n", + "---" + ] + }, + { + "cell_type": "markdown", + "id": "cb24d589", + "metadata": {}, + "source": [ + "# Custom Formats" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "d8eca9cd", + "metadata": { + "echo": true + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "x = pd.Series({'A':1, 'B':3, 'C':2})" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "ba6eb697", + "metadata": { + "fig.height": 5, + "fig.width": 8, + "name": "bar_plot", + "tags": [ + "remove_input" + ] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "<Axes: title={'center': 'Sample plot'}>" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGvCAYAAACJsNWPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuNSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/xnp5ZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAi3UlEQVR4nO3de1DVdf7H8ddB5eAFUDduIqGNhuIFFW/YT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pBlKSEhQRESEPv30Uy1dulTffPONXnvtNdNjAZo1a5b69eunAwcOaNSoUXrooYcUHx8vp9Opixcvatq0aVqwYIHpMdGClJWVqU2bNvXe37p1a507d+42TtQyefxx8Ljzbd++Xc8++6ymT5+unj17mh4HcPn444+1Z88e9e/fX1FRUcrKytIzzzzj+gqJGTNmaPjw4YanREsSGhqqEydOqEePHnXe/+mnnyokJOQ2T9XycGakGfrggw9UUVGh6OhoDRs2TMuWLdP58+dNjwXowoULCg4OliR16NBB7du3V6dOnVz3d+rUSRUVFabGQwv0y1/+Un/84x/1/fffX3Xfd999p7lz5+qhhx4yMFnLwjUjzVhlZaXWrl2r7OxsHTx4UDU1NVq8eLGefvpp+fr6mh4PLZCXl5fKysoUEBAgSfL19dWnn36q7t27S/rxlHmXLl1UU1Njcky0IGVlZRo0aJBatWqltLQ0RURESPrxWpHly5erpqZGR44ccX0ZLG4NYqSFKCgo0Jtvvqm33npLly5d0pgxY7Rp0ybTY6GF8fLy0vjx411fPrZ582aNHj1a7du3l/TjF5Tt2LGDGMFtVVhYqOnTp2vnzp268ifRZrMpLi5Oy5cvd8Uybh1ipIWpqanR5s2blZ2dTYzgtps8efINbbdq1apbPAlwtYsXL+rkyZOyLEs9e/Z0ewkRtxYxAgAAjOICVgAAYBQxAgAAjCJGAACAUcQIAAAwihgBAABGESMAAMAoYgQAABhFjAAAAKP+D22J+/qTJEVoAAAAAElFTkSuQmCC", + "text/plain": [ + "<Figure size 640x480 with 1 Axes>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "x.plot(kind='bar', title='Sample plot')" + ] + } + ], + "metadata": { + "jupytext": { + "text_representation": { + "extension": ".Rmd", + "format_name": "rmarkdown" + } + }, + "kernelspec": { + "display_name": "Python", + "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.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/tests/test_execute/test_custom_convert_multiple_extensions_cache.xml b/tests/test_execute/test_custom_convert_multiple_extensions_cache.xml new file mode 100644 index 00000000..b59e6cd5 --- /dev/null +++ b/tests/test_execute/test_custom_convert_multiple_extensions_cache.xml @@ -0,0 +1,21 @@ +<document source="custom-formats2"> + <section ids="custom-formats" names="custom\ formats"> + <title> + Custom Formats + <container cell_index="2" cell_metadata="{'echo': True}" classes="cell" exec_count="1" nb_element="cell_code"> + <container classes="cell_input" nb_element="cell_code_source"> + <literal_block language="ipython3" xml:space="preserve"> + import pandas as pd + x = pd.Series({'A':1, 'B':3, 'C':2}) + <container cell_index="3" cell_metadata="{'name': 'bar_plot', 'tags': ['remove_input'], 'fig.height': 5, 'fig.width': 8}" classes="cell tag_remove_input" exec_count="2" nb_element="cell_code"> + <container classes="cell_output" nb_element="cell_code_output"> + <container nb_element="mime_bundle"> + <container mime_type="text/plain"> + <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> + <Axes: title={'center': 'Sample plot'}> + <container nb_element="mime_bundle"> + <container mime_type="text/plain"> + <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> + <Figure size 640x480 with 1 Axes> + <container mime_type="image/png"> + <image candidates="{'*': '_build/jupyter_execute/a2e637020dfe58f670ba2c942d7a55e49ba48bed09312569ee15a84f5ac680cb.png'}" uri="_build/jupyter_execute/a2e637020dfe58f670ba2c942d7a55e49ba48bed09312569ee15a84f5ac680cb.png">