8000 Update notebook modifications for dev docs · scikit-learn/scikit-learn@ddacd76 · GitHub
[go: up one dir, main page]

Skip to content

Commit ddacd76

Browse files
Update notebook modifications for dev docs
1 parent aecc218 commit ddacd76

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/conf.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,22 @@ def notebook_modification_function(notebook_content, notebook_filename):
682682
# imports inside functions
683683
code_lines.extend(["import matplotlib", "import pandas"])
684684

685+
# Work around https://github.com/jupyterlite/pyodide-kernel/issues/166
686+
# and https://github.com/pyodide/micropip/issues/223 by installing the
687+
# dependencies first, and then scikit-learn from Anaconda.org.
688+
if "dev" in release:
689+
dev_docs_specific_code = [
690+
"import micropip",
691+
"await micropip.install(['joblib', 'threadpoolctl', 'scipy'])",
692+
"await micropip.install(\n"
693+
" 'scikit-learn',\n"
694+
" index_urls='https://pypi.anaconda.org/scientific-python-nightly-wheels/simple',\n"
695+
" pre=True,\n"
696+
")",
697+
]
698+
699+
code_lines.extend(dev_docs_specific_code)
700+
685701
if code_lines:
686702
code_lines = ["# JupyterLite-specific code"] + code_lines
687703
code = "\n".join(code_lines)

0 commit comments

Comments
 (0)
0