From 7e177e72db86363217f7d801cb72dc1bcfa76ad5 Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 5 Feb 2024 15:38:26 +0100 Subject: [PATCH 1/5] MAINT: Upgrade jupyter-book to version 1.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 203597c6..afd25c63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -160,7 +160,7 @@ all = [ webrtc-voice-detector]""", ] docs = [ - "jupyter-book==0.15.*", + "jupyter-book==1.0.*,", "matplotlib", "pandas>=1.4", "spacy>=3.4", From 346d0b91b1afda9b5c075b213379a10ba84733f6 Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 5 Feb 2024 15:38:55 +0100 Subject: [PATCH 2/5] DOC: Fix download of French corpus --- docs/examples/spacy/spacy_io.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/examples/spacy/spacy_io.md b/docs/examples/spacy/spacy_io.md index c52ebaa7..90c38682 100644 --- a/docs/examples/spacy/spacy_io.md +++ b/docs/examples/spacy/spacy_io.md @@ -24,7 +24,8 @@ For this example, you should download the french spacy model. You can download i ```{code-cell} ipython3 :tags: [remove-output] -!python -m spacy download fr_core_news_sm +import spacy.cli +spacy.cli.download("fr_core_news_sm") ``` Consider the following spacy document: From 857f59611d161d257ca16e66573edc2418ba47ef Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 5 Feb 2024 15:53:54 +0100 Subject: [PATCH 3/5] MAINT: Do not refresh config when building or serving the docs --- pyproject.toml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index afd25c63..b28c345a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -214,14 +214,8 @@ python = "3.10" [tool.hatch.envs.docs.scripts] config = "jupyter-book config sphinx docs/" -build = [ - "config", - "sphinx-build docs/ {args:docs/_build/html}", -] -serve = [ - "config", - "sphinx-autobuild docs/ {args:docs/_build/html}", -] +build = "sphinx-build docs/ {args:docs/_build/html}" +serve = "sphinx-autobuild docs/ {args:docs/_build/html}" [tool.coverage.run] source_pkgs = ["medkit", "tests"] From f6a05c0e4c5fbf4873c3eb439ade12a16577979a Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 5 Feb 2024 15:54:50 +0100 Subject: [PATCH 4/5] STY: Add missing white space in displacy call --- docs/examples/spacy/spacy_io.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/examples/spacy/spacy_io.md b/docs/examples/spacy/spacy_io.md index 90c38682..bc4b5e97 100644 --- a/docs/examples/spacy/spacy_io.md +++ b/docs/examples/spacy/spacy_io.md @@ -74,8 +74,7 @@ displacy.render(spacy_doc, style="ent") --- ```{code-cell} ipython3 -displacy.render(spacy_doc, style="span",options={"spans_key": "SECTION"}) - +displacy.render(spacy_doc, style="span", options={"spans_key": "SECTION"}) ``` The spacy document has **2** entities and **1** span group called `SECTION`. From eee2a8f25ac7520bc601046f3b42ecb29e144112 Mon Sep 17 00:00:00 2001 From: Ghislain Vaillant Date: Mon, 5 Feb 2024 16:20:46 +0100 Subject: [PATCH 5/5] CI: Fix generated Sphinx config by Jupyter Book See https://github.com/executablebooks/jupyter-book/pull/2111 --- .readthedocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1ac87da4..6d5e1ffd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,3 +12,4 @@ build: - pip install -e ".[docs,metrics-ner,nlstruct,srt-io-converter,webrtc-voice-detector]" pre_build: - jupyter-book config sphinx docs/ + - sed "s/'sphinx_book_theme',//" docs/conf.py # See https://github.com/executablebooks/jupyter-book/pull/2111