Repository navigation
fix(notebook): launch UI with current Python interpreter - #982
sivakumar-mahalingam wants to merge 2 commits into
Conversation
enekoreto
left a comment
There was a problem hiding this comment.
The fix looks right to me. I checked out the branch (343de50): both new tests fail on main (8bfd726, the command starts with 'python') and pass here. I also started the UI for real with launch_ui_jupyter() from a venv whose path has a space and isn't on PATH. On main it fails with FileNotFoundError: ... 'python' (my Mac only has python3), and with this change the server comes up and answers (from a source checkout, so with BURR_SERVE_STATIC=false).
But I think the new test file will break CI: the test job installs .[tests,tracking-client,tracking-server,graphviz], which doesn't include IPython, and burr.integrations.notebook imports it at module level. With CI's test command the run stops at collection (ModuleNotFoundError: No module named 'IPython', Interrupted: 1 error during collection), so no tests run at all.
Adding pytest.importorskip("IPython") before the import, like test_bip0042_bedrock.py does for boto3, fixed it for me: without IPython the file is skipped and CI's command passes, and with IPython both tests still pass. Adding ipython to the test job's install should also work, if you'd rather have these tests run in CI.
I ran this on Python 3.13 on macOS, and the new tests also on 3.10.
|
Thanks for catching this @enekoreto I added IPython to dependencies so the notebook tests are collected and executed in CI rather than skipped. |
|
Thanks! Rechecked at e6817ff: with |
Fixes #981
The
%burr_uinotebook integration launched its server subprocess using the literalpythoncommand. In notebook environments wherepythonresolves to a different installation—or is unavailable—the server could fail even though Burr was installed in the active kernel.Changes
sys.executablewhen launching the Burr UI from Jupyter.sys.executablewhen launching the Burr UI from Google Colab.How I tested this
pytest tests/integrations/test_notebook.py -v— 2 passed.python -m compileallpassed for the changed files.git diff --checkpassed.npxis unavailable in the test environment. No frontend files were changed.Notes
No public API changes or documentation updates are required. The notebook UI now consistently uses the same Python environment as the active notebook kernel.
Checklist