https://pantsbuild.org/ logo
#general
Title
# general
s

silly-queen-7197

05/01/2023, 9:38 PM
Have folks had any luck with
pants-jupyter-plugin
in VS code? If I run a regular notebook the following commands work
Copy code
%load_ext pants_jupyter_plugin
%pants_repo ../
%pants_load item-rank
but if I try to use the notebook integration in VS code it seems to just hang (specifically `%pants_load item-rank)
b

busy-vase-39202

05/01/2023, 9:50 PM
I believe @thankful-solstice-57670 worked on that, so may be able to give insight on that.
s

silly-queen-7197

05/01/2023, 10:00 PM
This only seems to happen on a remote (via remote-ssh) vs code instance. I just checked against vs code installed locally and it appears to work. What's odd is on the remote instance I don't get the dropdown boxes that are displayed on https://www.pantsbuild.org/docs/jupyter
After running
rm -fr  ~/.cache/pants_jupyter_plugin/
I see the little CLI box now
I see
Copy code
JavaScript output is disabled in JupyterLab
$ cd /home/yjabri/archipelago/notebooks/.. && ./pants --pants-distdir='/home/yjabri/archipelago/notebooks/../dist/tmp3hjon5il' package item-rank
22:27:23.57 [INFO] Initialization options changed: reinitializing scheduler...
22:27:23.92 [INFO] Scheduler initialized.
22:27:26.58 [INFO] Wrote notebooks/../dist/tmp3hjon5il/item-rank/cli.pex

Successfully built /home/yjabri/archipelago/notebooks/../dist/tmp3hjon5il/item-rank/cli.pex
When this works, usually there's a second box with text [Bootstrap] cli.pex but that's not showing up
t

thankful-solstice-57670

05/02/2023, 3:13 AM
hmm, not sure if it's been explicitly tested within VS Code but if you can repro the breakage then it'd be good to file a github issue. the plugin does depend on ipywidgets to function in the the typical jupyter environment, which usually needs to be explicitly installed in the python env; so maybe that's the bit that's missing?
s

silly-queen-7197

05/02/2023, 7:04 PM
Thanks I'll see how that goes and report back