Skip to content

Commit d349a16

Browse files
FIX: resolve JupyterLite notebook install errors in CircleCI preview
Two targeted fixes to doc/conf.py: 1. Clean dist_lite_dir before each wheel build so stale wheels from previous runs do not accumulate in the piplite all.json index. Previously each Sphinx build appended a new mne-9999.x.x wheel to the directory, causing all.json to grow across runs and contain multiple stale wheel entries. 2. Remove the hard version pin 'mne==9999.0.1' from the first_notebook_cell piplite.install call. The version 9999.0.1 is a local dev build that only exists in the generated all.json index. When the CircleCI artifact viewer loads a notebook, the Pyodide Web Worker cannot fetch the local all.json because CircleCI's authentication proxy blocks unauthenticated cross-origin requests from sandboxed Web Workers. piplite then silently falls back to public PyPI, where mne==9999.0.1 does not exist, causing a ValueError in every intro notebook. Removing the pin allows piplite to install the highest available version: the local dev wheel when all.json is reachable (production docs server), and the latest stable MNE release from PyPI when it is not (CircleCI preview). Both paths result in a working notebook instead of a traceback.
1 parent c41059a commit d349a16

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

doc/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@
534534
dist_lite_dir = os.path.join(
535535
os.path.abspath(os.path.dirname(__file__)), "_build", "dist_lite"
536536
)
537+
# Clean the directory first so stale wheels from previous runs do not
538+
# accumulate and pollute the piplite all.json index.
539+
shutil.rmtree(dist_lite_dir, ignore_errors=True)
537540
os.makedirs(dist_lite_dir, exist_ok=True)
538541

539542
pyproject_path = os.path.join(os.path.dirname(__file__), "..", "pyproject.toml")
@@ -565,7 +568,12 @@
565568
"first_notebook_cell": (
566569
"# 💡 This cell is automatically added to the start of each notebook.\n"
567570
"import piplite\n"
568-
"await piplite.install(['mne==9999.0.1', 'scikit-learn', 'joblib'])\n"
571+
"# Install mne without a version pin so piplite resolves the local\n"
572+
"# dev wheel from all.json when available, and falls back cleanly to\n"
573+
"# the latest stable release from PyPI in restricted preview\n"
574+
"# environments (e.g. CircleCI artifact viewer) where the local index\n"
575+
"# is blocked by the host's authentication proxy.\n"
576+
"await piplite.install(['mne', 'scikit-learn', 'joblib'])\n"
569577
"\n"
570578
"# Mock lzma since it is missing in Pyodide but required by pooch/joblib\n"
571579
"import sys\n"

0 commit comments

Comments
 (0)