Skip to content

Commit 07fe1fb

Browse files
igerberclaude
andcommitted
Fix notebook CI: add repo root to kernel Python path
PYTHONPATH=. only affects the shell, not the Jupyter kernel spawned by nbmake. Write a .pth file into site-packages so the kernel can import diff_diff. Also add ipykernel dependency and set DIFF_DIFF_BACKEND via env block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ccf9e7f commit 07fe1fb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/notebooks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@ jobs:
3434

3535
- name: Install dependencies
3636
run: |
37-
pip install numpy pandas scipy matplotlib nbmake pytest
37+
pip install numpy pandas scipy matplotlib nbmake pytest ipykernel
38+
# Add repo root to Python path so Jupyter kernels can import diff_diff
39+
python -c "import site; print(site.getsitepackages()[0])" | xargs -I{} sh -c 'echo "$PWD" > {}/diff_diff_dev.pth'
3840
3941
- name: Execute notebooks
42+
env:
43+
DIFF_DIFF_BACKEND: python
4044
run: |
41-
DIFF_DIFF_BACKEND=python PYTHONPATH=. pytest --nbmake docs/tutorials/ \
45+
pytest --nbmake docs/tutorials/ \
4246
--nbmake-timeout=300 \
4347
-v \
4448
--tb=short

0 commit comments

Comments
 (0)