Skip to content

Instantly share code, notes, and snippets.

@g547315
Forked from m158261/README.md
Last active January 5, 2024 11:43
Show Gist options
  • Save g547315/23c8c4aa917578ab817b9fa20be05516 to your computer and use it in GitHub Desktop.
Save g547315/23c8c4aa917578ab817b9fa20be05516 to your computer and use it in GitHub Desktop.
Link JupyterLab and Lumino

Link JupyterLab and Lumino in a single Binder instance

This link can be shared so anyone can interact with JupyterLab - Binder

This Gist allows users to link JupyterLab and Lumino branches together from any public repository. This means issues with fixes that span the two repositories can be tested together.

Getting started

  • Fork this Gist (button on top right of page).
  • Edit lines 11 and 16 in postBuild to point towards your repository and branches you want to link i.e.
git clone https://github.com/<Insert repository name or GitHub username here>/lumino.git --branch <Insert branch here> --single-branch
  • Update the binder link in the README.md with your username and the ID of your Gist which can be found in the URL of this page.

gist id binder id

  • Save the changes by clicking update public gist button at bottom of page.
  • Click the Binder link in the README.md

Updating after code changes

As Binder is pointing towards the Gist and not your branches, any code changes in the branches will not be seen by Binder and it won't update the docker image. To force Binder to update the docker image you need to update your Gist. This can be done by adding a line to the README.

Credit is given to Michał Krassowski for help with this solution.

name: jupyterlab-dev
channels:
- conda-forge
- nodefaults
dependencies:
# runtimes
- nodejs >=18,<19
- python =3.11
# package managers
- pip
- yarn >=3,<4
# build
- hatch-jupyter-builder >=0.3.2
- hatchling >=1.5.0
# run
- async-lru >=1.0.0
- ipykernel
- jinja2 >=3.0.3
- jupyter_core
- jupyter_server >=2.4.0,<3
- jupyter-lsp >=2.0.0
- jupyterlab_server >=2.19.0,<3
- packaging
- tornado >=6.2.0
- traitlets >=5.10.1
# dev
- black-jupyter
- hatch
- pytest-cov
- python-build
- pip:
# can't be installed with `conda` in binder, due to `jupyterlab-link-share``
- jupyter-collaboration ==1.2.0
#!/bin/bash
# ensure no surprises from binder's "half" activation
source activate ${NB_PYTHON_PREFIX}
# use strict and verbose shell settings
set -euxo pipefail
# create log folder, named to appear at the top of the file browser
mkdir _reports_
git clone https://github.com/g547315/lumino.git --allow-mapping-to-mod-keys --single-branch
cd lumino
jlpm && jlpm build
cd ..
git clone https://github.com/g547315/jupyterlab.git --branch dispaly-overlay-and-shortcut-number --single-branch
cd jupyterlab
jlpm link ../lumino --all
(time jlpm build:dev) 2>&1 | tee ../_reports_/01_build.txt
(time pip install -v -e . --no-build-isolation) 2>&1 | tee ../_reports_/02_pip_install.txt
cd ..
# clean up egregious wastes of space
rm -rf \
~/.cache \
dev_mode/stats.json \
node_modules/@stdlib
#!/bin/bash
echo $@
exec jupyter-lab --dev-mode "${@:4}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment