Skip to content

Commit 8a09659

Browse files
committed
Fixed dependancies warnings introduced by sphinx_toolbox (#1339)
* Added versioning for sphinx, docutils - introduced by sphinxtoolbox * Fixed bug with config value for `plot_gallery` in doc makefile * Update linkcheck command as well
1 parent bc3a736 commit 8a09659

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ html:
6060
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
6161

6262
html-noexamples:
63-
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
63+
SPHINX_GALLERY_PLOT=False $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
6464
@echo
6565
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
6666

@@ -167,7 +167,7 @@ changes:
167167
@echo "The overview file is in $(BUILDDIR)/changes."
168168

169169
linkcheck:
170-
$(SPHINXBUILD) -D plot_gallery=0 -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
170+
SPHINX_GALLERY_PLOT=False $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
171171
@echo
172172
@echo "Link check complete; look for any errors in the above output " \
173173
"or in $(BUILDDIR)/linkcheck/output.txt."

doc/conf.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@
6868
if "dev" in autosklearn.__version__:
6969
binder_branch = "development"
7070

71+
# Getting issues with the `-D plot_gallery=0` for sphinx gallery, this is a workaround
72+
# We do this by setting an evironment variable we check and modifying the python config
73+
# object.
74+
# We have this extra processing as it enters as a raw string and we need a boolean value
75+
gallery_env_var ="SPHINX_GALLERY_PLOT"
76+
77+
sphinx_plot_gallery_flag = True
78+
if gallery_env_var in os.environ:
79+
value = os.environ[gallery_env_var]
80+
if value in ["False", "false", "0"]:
81+
sphinx_plot_gallery_flag = False
82+
elif value in ["True", "true", "1"]:
83+
sphinx_plot_gallery_flag = True
84+
else:
85+
raise ValueError(f'Env variable {gallery_env_var} must be set to "false" or "true"')
86+
7187
sphinx_gallery_conf = {
7288
# path to the examples
7389
'examples_dirs': '../examples',
@@ -78,6 +94,7 @@
7894
#'reference_url': {
7995
# 'autosklearn': None
8096
#},
97+
'plot_gallery': sphinx_plot_gallery_flag,
8198
'backreferences_dir': None,
8299
'filename_pattern': 'example.*.py$',
83100
'ignore_pattern': r'custom_metrics\.py|__init__\.py|example_parallel_manual_spawning_python.py',

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@
4242
"seaborn",
4343
],
4444
"docs": [
45-
"sphinx",
46-
"sphinx-gallery<=0.10.0",
45+
"sphinx<4.3",
46+
"sphinx-gallery",
4747
"sphinx_bootstrap_theme",
4848
"numpydoc",
4949
"sphinx_toolbox",
50+
"docutils==0.16"
5051
],
5152
}
5253

0 commit comments

Comments
 (0)