To develop the extension locally, follow these steps to set up a dedicated Conda environment and build the extension from the cloned repository.
1. Environment Setup
Create and activate a Conda environment with the necessary dependencies:
conda create -n jupyterlab-ext --override-channels --strict-channel-priority -c conda-forge -c nodefaults jupyterlab=4 nodejs=18 git copier=7 jinja2-time
conda activate jupyterlab-ext
2. Clone and Prepare Repository
Clone the repository and navigate to the directory:
git clone https://github.com/jcoady/jupyterlab_vpython.git
cd jupyterlab_vpython
3. Install Dependencies and Build
Use jlpm to install required JupyterLab and Lumino packages, copy the necessary VPython library/data files, and run the build process:
jlpm install
jlpm add @jupyterlab/application
jlpm add @jupyterlab/apputils
jlpm add @jupyterlab/coreutils
jlpm add @jupyterlab/docregistry
jlpm add @jupyterlab/notebook
jlpm add @lumino/disposable
jlpm add file-loader
jlpm add plotly.js-dist-min
jlpm add script-loader
# Copy VPython libraries and data from the parent directory
cp -r ../../vpython/vpython_{libraries,data} .
jlpm run build
4. Install and Run
Install the extension in editable mode and launch JupyterLab:
pip install -ve .
# In a new terminal:
conda activate jupyterlab-ext
jupyter lab