From ee29ad54819430017a3f5e64386e35931b6d4429 Mon Sep 17 00:00:00 2001 From: eddiebergman Date: Wed, 8 Dec 2021 12:23:34 +0100 Subject: [PATCH 1/3] Added versioning for sphinx, docutils - introduced by sphinxtoolbox --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e355c0d1ec..ac284efcf6 100644 --- a/setup.py +++ b/setup.py @@ -42,11 +42,12 @@ "seaborn", ], "docs": [ - "sphinx", - "sphinx-gallery<=0.10.0", + "sphinx<4.3", + "sphinx-gallery", "sphinx_bootstrap_theme", "numpydoc", "sphinx_toolbox", + "docutils==0.16" ], } From 701b7c63cd00fd32dddffae9699d064000e52d93 Mon Sep 17 00:00:00 2001 From: eddiebergman Date: Wed, 8 Dec 2021 13:37:14 +0100 Subject: [PATCH 2/3] Fixed bug with config value for `plot_gallery` in doc makefile --- doc/Makefile | 2 +- doc/conf.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 3683cf45a8..71d0317ddc 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -60,7 +60,7 @@ html: @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." html-noexamples: - $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html + SPHINX_GALLERY_PLOT=False $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/doc/conf.py b/doc/conf.py index a7bfae8cd9..47d78c46f2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -68,6 +68,22 @@ if "dev" in autosklearn.__version__: binder_branch = "development" +# Getting issues with the `-D plot_gallery=0` for sphinx gallery, this is a workaround +# We do this by setting an evironment variable we check and modifying the python config +# object. +# We have this extra processing as it enters as a raw string and we need a boolean value +gallery_env_var ="SPHINX_GALLERY_PLOT" + +sphinx_plot_gallery_flag = True +if gallery_env_var in os.environ: + value = os.environ[gallery_env_var] + if value in ["False", "false", "0"]: + sphinx_plot_gallery_flag = False + elif value in ["True", "true", "1"]: + sphinx_plot_gallery_flag = True + else: + raise ValueError(f'Env variable {gallery_env_var} must be set to "false" or "true"') + sphinx_gallery_conf = { # path to the examples 'examples_dirs': '../examples', @@ -78,6 +94,7 @@ #'reference_url': { # 'autosklearn': None #}, + 'plot_gallery': sphinx_plot_gallery_flag, 'backreferences_dir': None, 'filename_pattern': 'example.*.py$', 'ignore_pattern': r'custom_metrics\.py|__init__\.py', From 8d578e4fefb2a12313273270b08fcdf22f8c15e3 Mon Sep 17 00:00:00 2001 From: eddiebergman Date: Wed, 8 Dec 2021 14:55:06 +0100 Subject: [PATCH 3/3] Update linkcheck command as well --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 71d0317ddc..24165e787b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -167,7 +167,7 @@ changes: @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: - $(SPHINXBUILD) -D plot_gallery=0 -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + SPHINX_GALLERY_PLOT=False $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt."