Skip to content

Commit ed98354

Browse files
Edit README
Signed-off-by: Andy Jakubowski <hello@andyjakubowski.com>
1 parent df228c5 commit ed98354

File tree

1 file changed

+52
-11
lines changed

1 file changed

+52
-11
lines changed

README.md

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,62 @@ jupyter labextension list
5050

5151
Note: You will need NodeJS to build the extension package.
5252

53+
Use any Python environment and dependency manager you like, for example [uv](https://docs.astral.sh/uv/getting-started/installation/):
54+
55+
```shell
56+
curl -LsSf https://astral.sh/uv/install.sh | sh
57+
```
58+
59+
Create a Python environment in the project directory:
60+
61+
```shell
62+
uv venv --python 3.12 --managed-python
63+
```
64+
65+
Activate the Python environment:
66+
67+
```shell
68+
source .venv/bin/activate
69+
```
70+
71+
Install `jupyterlab`. The extension package itself doesn’t depend on `jupyterlab`, you just need `jupyterlab` in the environment where you will be testing the extension.
72+
73+
```shell
74+
uv pip install jupyterlab
75+
```
76+
77+
Install the extension package in editable mode. It installs the package’s dependencies, too:
78+
79+
```shell
80+
uv pip install --editable . --verbose
81+
```
82+
83+
Link your development version of the extension with JupyterLab:
84+
85+
```shell
86+
jupyter labextension develop . --overwrite
87+
```
88+
89+
Enable the extension in Jupyter Server:
90+
91+
```shell
92+
jupyter server extension enable jupyterlab_deepnote
93+
```
94+
95+
Rebuild the extension’s Typescript source after making changes:
96+
97+
```shell
98+
jlpm run watch
99+
```
100+
53101
The `jlpm` command is JupyterLab's pinned version of
54102
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
55103
`yarn` or `npm` in lieu of `jlpm` below.
56104

57-
```bash
58-
# Clone the repo to your local environment
59-
# Change directory to the jupyterlab_deepnote directory
60-
# Install package in development mode
61-
pip install -e ".[test]"
62-
# Link your development version of the extension with JupyterLab
63-
jupyter labextension develop . --overwrite
64-
# Server extension must be manually installed in develop mode
65-
jupyter server extension enable jupyterlab_deepnote
66-
# Rebuild extension Typescript source after making changes
67-
jlpm build
105+
In a separate terminal, run `jupyter lab` with the `--config` option to register our custom file contents manager for the `.deepnote` extension. The `--debug` option lets you see HTTP requests in the logs, which is helpful for debugging.
106+
107+
```shell
108+
jupyter lab --debug --config="$(pwd)/jupyter-config/server-config/jupyter_server_config.json"
68109
```
69110

70111
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

0 commit comments

Comments
 (0)