8000 DOC Use nightly WASM wheels for JupyterLite in the dev documentation by agriyakhetarpal · Pull Request #31085 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Use nightly WASM wheels for JupyterLite in the dev documentation #31085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,23 @@ def notebook_modification_function(notebook_content, notebook_filename):
# imports inside functions
code_lines.extend(["import matplotlib", "import pandas"])

# Work around https://github.com/jupyterlite/pyodide-kernel/issues/166
# and https://github.com/pyodide/micropip/issues/223 by installing the
# dependencies first, and then scikit-learn from Anaconda.org.
if "dev" in release:
dev_docs_specific_code = [
"import piplite",
"import joblib",
"import threadpoolctl",
"import scipy",
"await piplite.install(\n"
f" 'scikit-learn=={release}',\n"
" index_urls='https://pypi.anaconda.org/scientific-python-nightly-wheels/simple',\n"
")",
]

code_lines.extend(dev_docs_specific_code)

if code_lines:
code_lines = ["# JupyterLite-specific code"] + code_lines
code = "\n".join(code_lines)
Expand Down
0