Skip to content
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

Support all Jupyter Paths when loading static resources #10722

Closed
DonJayamanne opened this issue Jul 7, 2022 · 3 comments · Fixed by #10726
Closed

Support all Jupyter Paths when loading static resources #10722

DonJayamanne opened this issue Jul 7, 2022 · 3 comments · Fixed by #10726
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues ipywidgets Rendering, loading, saving, anything to do with IPyWidgets verified Verification succeeded
Milestone

Comments

@DonJayamanne
Copy link
Contributor

We recently updated IPyWidgets to load static resources from a couple of different places,
however Jupyter has a pre-defined & documented list

Today we load static resources from just 2 places, however jupyter has more than that.
E.g. if you look at the isntallation of pythreejs, if user installs widgets into --system, then they will not work in VS Code.
We don't load widgets from the --system location.

Todo:

  • Load static resources from all directories that Jupyter loads from
  • Use the same priority that Jupyter uses

Ref

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug debt Code quality issues ipywidgets Rendering, loading, saving, anything to do with IPyWidgets and removed bug Issue identified by VS Code Team member as probable bug labels Jul 7, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jul 7, 2022
@DonJayamanne
Copy link
Contributor Author

Order of priority:

  • ~/Library/Jupyter -> /Users/donjayamanne/Library/Jupyter/nbextensions
  • <sys-prefix>/share/jupyter -> /Users/donjayamanne/crap/.venvPythreeJs/share/jupyter/nbextensions
  • /usr/local/share/jupyter/nbextensions
  • /usr/share/jupyter/nbextensions

Basically its exactly as defined in JUPYTER_PATH section

@DonJayamanne DonJayamanne self-assigned this Jul 7, 2022
@greazer greazer added bug Issue identified by VS Code Team member as probable bug and removed triage-needed Issue needs to be triaged labels Jul 7, 2022
@DonJayamanne DonJayamanne added this to the July 2022 milestone Jul 11, 2022
@connor4312
Copy link
Member

Are there repro steps for this?

@connor4312 connor4312 added the verification-steps-needed Steps to verify are needed for verification label Jul 27, 2022
@DonJayamanne
Copy link
Contributor Author

DonJayamanne commented Jul 28, 2022

  • Create python virtual env
  • Install pythreejs into virtual env python -m pip install pythreejs
  • Then run python -m jupyter nbextension uninstall --sys-prefix --py pythreejs // uninstall js scripts for virtual env
  • Then run python -m jupyter nbextension install --user --py pythreejs // install js scripts into global location
  • Ensure the temp/tmp file directories in Jupyter extension folder have been deleted
  • Create a notebook and run the following cell (ensuring you have selected the virtual env) & verify the widget is displayed
from pythreejs import *
from IPython.display import display
from math import pi

# Reduce repo churn for examples with embedded state:
from pythreejs._example_helper import use_example_model_ids
use_example_model_ids()

BoxGeometry(
    width=5,
    height=10,
    depth=15,
    widthSegments=5,
    heightSegments=10,
    depthSegments=15)

@DonJayamanne DonJayamanne removed the verification-steps-needed Steps to verify are needed for verification label Jul 28, 2022
@rzhao271 rzhao271 added the verified Verification succeeded label Jul 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues ipywidgets Rendering, loading, saving, anything to do with IPyWidgets verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants