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

Add a devcontainer #637

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
link in the jupyter lab dev env
  • Loading branch information
gwincr11 committed Nov 21, 2022
commit 5c87e8627316f8cc694754956b1874327bf436a2
13 changes: 10 additions & 3 deletions .devcontainer/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
pip install .
vidartf marked this conversation as resolved.
Show resolved Hide resolved
vidartf marked this conversation as resolved.
Show resolved Hide resolved
python setup.py build

sudo mkdir /usr/local/share/jupyter
sudo chown vscode /usr/local/share/jupyter
jupyter labextension develop . --overwrite
# sudo mkdir /usr/local/share/jupyter
# sudo chown vscode /usr/local/share/jupyter
# jupyter labextension develop . --overwrite --no-build
jupyter server extension enable nbdime # if developing for jupyter lab or nbclassic

jupyter nbextension install --py nbdime --sys-prefix [--sym-link]
jupyter nbextension enable --py nbdime --sys-prefix

jupyter labextension link ./packages/nbdime --no-build
jupyter labextension install ./packages/labextension
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vidartf This codespace now includes Jupyter Lab, this will allow people starting up the codespace to have a pre-install Jupyter Lab to develop against.

However I am not sure the best way to link the local version of nbdime to the JupyterLab server.

This works, but I am not sure how to get changes to show up, I need to rebuild the docker container every time which is not great.

Is there some sort of script I could put together to automatically update Jupyter Lab? Thanks..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to use this command

jupyter labextension develop --overwrite .

But it was not working as I would expect. I wonder if there is some prereq I am not aware of that the cookie cutter does?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jupyter labextension develop . --overwrite is correct, but not sufficient on its own. If you change some code in the nbdime package, you would then need to

  • build the nbdime code (npm run build in packages/nbdime)
  • build typescript code of tha labextension, and then bundle it into the prebuilt extension (both covered by command npm run build:dev in packages/labextension)

To have it build automatically (and quicker), you can set up watchers:

  • npm run watch in packages/nbdime
  • npm run watch in packages/labextension
  • jupyter labextension watch ? This one currently doesn't work for me, so might be worth asking lab devs about if there is a good watch command..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks. I will dig into this