Skip to content

Commit 371c921

Browse files
authored
MAINT make sphinx conf more lenient towards missing jupyterlite (scikit-learn#26705)
1 parent ee5d94e commit 371c921

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

build_tools/circle/doc_min_dependencies_environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies:
2323
- memory_profiler
2424
- compilers
2525
- sphinx=6.0.0 # min
26-
- sphinx-gallery=0.7.0 # min
26+
- sphinx-gallery=0.10.1 # min
2727
- sphinx-copybutton=0.5.2 # min
2828
- numpydoc=1.2.0 # min
2929
- sphinx-prompt=1.3.0 # min

build_tools/circle/doc_min_dependencies_linux-64_conda.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generated by conda-lock.
22
# platform: linux-64
3-
# input_hash: bd03405f744d4d5d0c59edd290d1e4245873b8593fcd3bbc3efdf8654a283161
3+
# input_hash: d465abb23248872aed411e2f2f7293a661f0b783f1a84420ffa5431229814cab
44
@EXPLICIT
55
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
66
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2023.5.7-hbcca054_0.conda#f5c65075fc34438d5b456c7f3f5ab695
@@ -100,7 +100,7 @@ https://conda.anaconda.org/conda-forge/linux-64/markupsafe-2.1.3-py38h01eb140_0.
100100
https://conda.anaconda.org/conda-forge/noarch/networkx-3.1-pyhd8ed1ab_0.conda#254f787d5068bc89f578bf63893ce8b4
101101
https://conda.anaconda.org/conda-forge/noarch/packaging-23.1-pyhd8ed1ab_0.conda#91cda59e66e1e4afe9476f8ef98f5c30
102102
https://conda.anaconda.org/conda-forge/linux-64/pillow-9.4.0-py38hde6dc18_1.conda#3de5619d3f556f966189e5251a266125
103-
https://conda.anaconda.org/conda-forge/noarch/pluggy-1.0.0-pyhd8ed1ab_5.tar.bz2#7d301a0d25f424d96175f810935f0da9
103+
https://conda.anaconda.org/conda-forge/noarch/pluggy-1.2.0-pyhd8ed1ab_0.conda#7263924c642d22e311d9e59b839f1b33
104104
https://conda.anaconda.org/conda-forge/linux-64/psutil-5.9.5-py38h1de0b5d_0.conda#92e899e7b0ed27c793014d1fa54f9b7b
105105
https://conda.anaconda.org/conda-forge/noarch/py-1.11.0-pyh6c4a22f_0.tar.bz2#b4613d7e7a493916d867842a6a148054
106106
https://conda.anaconda.org/conda-forge/noarch/pygments-2.15.1-pyhd8ed1ab_0.conda#d316679235612869eba305aa7d41d9bf
@@ -138,15 +138,15 @@ https://conda.anaconda.org/conda-forge/noarch/memory_profiler-0.61.0-pyhd8ed1ab_
138138
https://conda.anaconda.org/conda-forge/noarch/partd-1.4.0-pyhd8ed1ab_0.conda#721dab5803ea92ce02ddc4ee50aa0c48
139139
https://conda.anaconda.org/conda-forge/noarch/pip-23.1.2-pyhd8ed1ab_0.conda#7288da0d36821349cf1126e8670292df
140140
https://conda.anaconda.org/conda-forge/noarch/plotly-5.14.0-pyhd8ed1ab_0.conda#6a7bcc42ef58dd6cf3da9333ea102433
141-
https://conda.anaconda.org/conda-forge/noarch/pytest-7.3.2-pyhd8ed1ab_1.conda#f2465696f4396245eca4613f6e924796
141+
https://conda.anaconda.org/conda-forge/noarch/pytest-7.4.0-pyhd8ed1ab_0.conda#3cfe9b9e958e7238a386933c75d190db
142142
https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.8.2-pyhd8ed1ab_0.tar.bz2#dd999d1cc9f79e67dbb855c8924c7984
143143
https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.6.3-hd8ed1ab_0.conda#3876f650ed7d0f95d70fa4b647621909
144144
https://conda.anaconda.org/conda-forge/noarch/urllib3-2.0.3-pyhd8ed1ab_0.conda#ae465d0fbf9f1979cb2d8d4043d885e2
145145
https://conda.anaconda.org/conda-forge/linux-64/gst-plugins-base-1.14.5-h0935bb2_2.tar.bz2#eb125ee86480e00a4a1ed45a577c3311
146146
https://conda.anaconda.org/conda-forge/noarch/importlib_metadata-6.7.0-hd8ed1ab_0.conda#27a4cec373ec84d1c1aa02a1e37f8eaf
147147
https://conda.anaconda.org/conda-forge/linux-64/liblapacke-3.8.0-20_mkl.tar.bz2#8274dc30518af9df1de47f5d9e73165c
148148
https://conda.anaconda.org/conda-forge/linux-64/numpy-1.17.3-py38h95a1406_0.tar.bz2#bc0cbf611fe2f86eab29b98e51404f5e
149-
https://conda.anaconda.org/conda-forge/noarch/platformdirs-3.6.0-pyhd8ed1ab_0.conda#741384b21c1b512617f4ee4ea8457c5d
149+
https://conda.anaconda.org/conda-forge/noarch/platformdirs-3.8.0-pyhd8ed1ab_0.conda#3e4aca765371893ad848397794600632
150150
https://conda.anaconda.org/conda-forge/noarch/pytest-forked-1.6.0-pyhd8ed1ab_0.conda#a46947638b6e005b63d2d6271da529b0
151151
https://conda.anaconda.org/conda-forge/noarch/requests-2.31.0-pyhd8ed1ab_0.conda#a30144e4156cdbb236f99ebb49828f8b
152152
https://conda.anaconda.org/conda-forge/linux-64/blas-2.20-mkl.tar.bz2#e7d09a07f5413e53dca5282b8fa50bed
@@ -167,7 +167,7 @@ https://conda.anaconda.org/conda-forge/linux-64/pyqt-5.12.3-py38ha8c2ead_3.tar.b
167167
https://conda.anaconda.org/conda-forge/linux-64/scikit-image-0.16.2-py38hb3f55d8_0.tar.bz2#468b398fefac8884cd6e6513af66549b
168168
https://conda.anaconda.org/conda-forge/noarch/seaborn-base-0.12.2-pyhd8ed1ab_0.conda#cf88f3a1c11536bc3c10c14ad00ccc42
169169
https://conda.anaconda.org/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_0.conda#ac832cc43adc79118cf6e23f1f9b8995
170-
https://conda.anaconda.org/conda-forge/noarch/sphinx-gallery-0.7.0-py_0.tar.bz2#80bad3f857ecc86a4ab73f3e57addd13
170+
https://conda.anaconda.org/conda-forge/noarch/sphinx-gallery-0.10.1-pyhd8ed1ab_0.tar.bz2#4918585fe5e5341740f7e63c61743efb
171171
https://conda.anaconda.org/conda-forge/noarch/sphinx-prompt-1.3.0-py_0.tar.bz2#9363002e2a134a287af4e32ff0f26cdc
172172
https://conda.anaconda.org/conda-forge/linux-64/matplotlib-3.1.3-py38_0.tar.bz2#1992ab91bbff86ded8d99d1f488d8e8b
173173
https://conda.anaconda.org/conda-forge/linux-64/statsmodels-0.12.2-py38h5c078b8_0.tar.bz2#33787719ad03d33cffc4e2e3ea82bc9e

doc/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,15 @@
7272
import jupyterlite_sphinx # noqa: F401
7373

7474
extensions.append("jupyterlite_sphinx")
75+
with_jupyterlite = True
7576
except ImportError:
7677
# In some cases we don't want to require jupyterlite_sphinx to be installed,
7778
# e.g. the doc-min-dependencies build
7879
warnings.warn(
7980
"jupyterlite_sphinx is not installed, you need to install it "
8081
"if you want JupyterLite links to appear in each example"
8182
)
83+
with_jupyterlite = False
8284

8385
# Produce `plot::` directives for examples that contain `import matplotlib` or
8486
# `from matplotlib import`.
@@ -525,13 +527,16 @@ def reset_sklearn_config(gallery_conf, fname):
525527
"dependencies": "./binder/requirements.txt",
526528
"use_jupyter_lab": True,
527529
},
528-
"jupyterlite": {"notebook_modification_function": notebook_modification_function},
529530
# avoid generating too many cross links
530531
"inspect_global_variables": False,
531532
"remove_config_comments": True,
532533
"plot_gallery": "True",
533534
"reset_modules": ("matplotlib", "seaborn", reset_sklearn_config),
534535
}
536+
if with_jupyterlite:
537+
sphinx_gallery_conf["jupyterlite"] = {
538+
"notebook_modification_function": notebook_modification_function
539+
}
535540

536541

537542
# The following dictionary contains the information used to create the

sklearn/_min_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"pyarrow": ("12.0.0", "tests"),
4545
"sphinx": ("6.0.0", "docs"),
4646
"sphinx-copybutton": ("0.5.2", "docs"),
47-
"sphinx-gallery": ("0.7.0", "docs"),
47+
"sphinx-gallery": ("0.10.1", "docs"),
4848
"numpydoc": ("1.2.0", "docs, tests"),
4949
"Pillow": ("7.1.2", "docs"),
5050
"pooch": ("1.6.0", "docs, examples, tests"),

0 commit comments

Comments
 (0)