From d1b0803fac07fa1008a52699b9bee7bc19c520b9 Mon Sep 17 00:00:00 2001 From: xadupre Date: Tue, 27 Sep 2022 13:11:57 +0200 Subject: [PATCH 1/3] Removes dependency on sphinxcontrib.imagesvg Signed-off-by: xadupre --- requirements-3.6.txt | 1 - requirements.txt | 1 - setup.py | 1 - src/pyquickhelper/helpgen/default_conf.py | 12 ++++++++---- src/pyquickhelper/sphinxext/__init__.py | 2 -- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/requirements-3.6.txt b/requirements-3.6.txt index 80a18c5f..195049fa 100644 --- a/requirements-3.6.txt +++ b/requirements-3.6.txt @@ -49,7 +49,6 @@ semantic_version setuptools Sphinx>=3.0 sphinx-gallery -sphinxcontrib-imagesvg sphinx_rtd_theme tabulate tqdm diff --git a/requirements.txt b/requirements.txt index 600a6690..15d6019e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,7 +49,6 @@ semantic_version setuptools Sphinx>=5.0 sphinx-gallery -sphinxcontrib-imagesvg sphinx_rtd_theme tabulate tqdm diff --git a/setup.py b/setup.py index 2e6f4176..cb3645e7 100644 --- a/setup.py +++ b/setup.py @@ -143,7 +143,6 @@ "semantic_version", "sphinx>=3.0", "sphinx-gallery", - "sphinxcontrib-imagesvg", "traitlets>=5.0", ], }, diff --git a/src/pyquickhelper/helpgen/default_conf.py b/src/pyquickhelper/helpgen/default_conf.py index 35a0ebba..d0054c00 100644 --- a/src/pyquickhelper/helpgen/default_conf.py +++ b/src/pyquickhelper/helpgen/default_conf.py @@ -313,12 +313,16 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, raise ValueError(f"Issue with sphinx-gallery.\n{e}") extensions.extend([ - 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', - 'sphinx.ext.extlinks', 'sphinx.ext.graphviz', 'sphinx.ext.ifconfig', - 'sphinx.ext.inheritance_diagram', 'sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', + 'sphinx.ext.coverage', + 'sphinx.ext.extlinks', + 'sphinx.ext.graphviz', + 'sphinx.ext.ifconfig', + 'sphinx.ext.inheritance_diagram', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax' if use_mathjax else 'sphinx.ext.imgmath', 'sphinx.ext.todo', - 'sphinxcontrib.imagesvg', 'jupyter_sphinx.execute', 'jupyter_sphinx.execute', 'pyquickhelper.sphinxext.sphinx_rst_builder', 'pyquickhelper.sphinxext.sphinx_md_builder', diff --git a/src/pyquickhelper/sphinxext/__init__.py b/src/pyquickhelper/sphinxext/__init__.py index 8862562b..d625d04e 100644 --- a/src/pyquickhelper/sphinxext/__init__.py +++ b/src/pyquickhelper/sphinxext/__init__.py @@ -12,7 +12,6 @@ import warnings from sphinx.ext.autodoc import setup as setup_autodoc from sphinx.ext.imgmath import setup as setup_imgmath -from sphinxcontrib.imagesvg import setup as setup_imagesvg from sphinx.ext.graphviz import setup as setup_graphviz from sphinx.ext.todo import setup as setup_todo @@ -155,7 +154,6 @@ def get_default_standard_extensions(use_mathjax=False): 'sphinx.ext.mathjax' if use_mathjax else 'sphinx.ext.imgmath', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'jupyter_sphinx.execute', - 'sphinxcontrib.imagesvg', 'matplotlib.sphinxext.plot_directive', ] From 066b533b446235d2509168cc873d36305ae2c502 Mon Sep 17 00:00:00 2001 From: xadupre Date: Tue, 27 Sep 2022 14:46:22 +0200 Subject: [PATCH 2/3] remove setup_imagesvg Signed-off-by: xadupre --- src/pyquickhelper/sphinxext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyquickhelper/sphinxext/__init__.py b/src/pyquickhelper/sphinxext/__init__.py index d625d04e..a817d726 100644 --- a/src/pyquickhelper/sphinxext/__init__.py +++ b/src/pyquickhelper/sphinxext/__init__.py @@ -123,7 +123,7 @@ def get_default_extensions(load_bokeh=False): # directives from sphinx setup_graphviz, setup_imgmath, setup_todo, # the rest of it - setup_autodoc, setup_imagesvg, + setup_autodoc, setup_plot, setup_image, setup_collapse, setup_gdot, setup_video, setup_simpleimage, setup_downloadlink, setup_quote, setup_gitlog] From 23522454ae9c5c8d26db9593fa94819edc719a3a Mon Sep 17 00:00:00 2001 From: xadupre Date: Tue, 27 Sep 2022 15:17:53 +0200 Subject: [PATCH 3/3] fix link --- src/pyquickhelper/helpgen/install_custom.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pyquickhelper/helpgen/install_custom.py b/src/pyquickhelper/helpgen/install_custom.py index 64c2ef62..3da38177 100644 --- a/src/pyquickhelper/helpgen/install_custom.py +++ b/src/pyquickhelper/helpgen/install_custom.py @@ -31,13 +31,14 @@ def download_revealjs(temp_folder=".", unzip_to=".", fLOG=print, reg = re.compile("href=\\\"(.*?[0-9.]+?[.]zip)\\\"") alls = reg.findall(page) if len(alls) == 0: - raise RuntimeError( # pragma: no cover - f"Unable to find a link on a .zip file on page:\n{page}") - - filename = alls[0].split("/")[-1] - filel = location.replace("releases", "").rstrip( - '/') + f"/archive/{filename}" - outfile = os.path.join(temp_folder, "reveal.js." + filename) + # Fall back to one release + filel = "https://github.com/hakimel/reveal.js/archive/refs/tags/4.3.1.zip" + outfile = os.path.join(temp_folder, "reveal.js.4.3.1.zip") + else: + filename = alls[0].split("/")[-1] + filel = location.replace("releases", "").rstrip( + '/') + f"/archive/{filename}" + outfile = os.path.join(temp_folder, "reveal.js." + filename) fLOG("download ", filel, "to", outfile) local = download(filel, temp_folder, fLOG=fLOG) fLOG("local file", local)