You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEEPNOTE_KERNEL_IMPLEMENTATION.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ This implementation adds automatic kernel selection and startup for `.deepnote`
26
26
- Creates a dedicated virtual environment per `.deepnote` file
27
27
- Checks if `deepnote-toolkit` is installed in the venv
28
28
- Installs the toolkit and `ipykernel` from the hardcoded S3 wheel URL
29
-
-**Registers a kernel spec** that points to the venv's Python interpreter
29
+
-**Registers a kernel spec**using `ipykernel install --user --name deepnote-venv-<hash>`that points to the venv's Python interpreter
30
30
- This ensures packages installed via `pip` are available to the kernel
31
31
- Outputs installation progress to the output channel
32
32
- Verifies successful installation
@@ -72,7 +72,7 @@ This implementation adds automatic kernel selection and startup for `.deepnote`
72
72
- Activation service that listens for notebook open events and controller selection changes
73
73
- Automatically selects Deepnote kernel for `.deepnote` files
74
74
- Queries the Deepnote server for available kernel specs
75
-
-**Prefers the venv kernel spec** (`deepnote-venv-<hash>`) that uses the venv's Python interpreter
75
+
-**Prefers the venv kernel spec** (`deepnote-venv-<hash>`) that was registered by the installer and uses the venv's Python interpreter
76
76
- This ensures the kernel uses the same environment where packages are installed
77
77
- Falls back to other Python kernel specs if venv kernel not found
78
78
- Registers the server with the server provider
@@ -294,13 +294,13 @@ The implementation uses VSCode's Jupyter server provider API to properly integra
294
294
295
295
### Kernel Spec Resolution
296
296
297
-
Instead of creating custom kernel specs, the implementation:
297
+
The implementation uses a hybrid approach:
298
298
299
-
1.Connects to the running Deepnote server using `JupyterLabHelper`
300
-
2. Queries the server for available kernel specs via `getKernelSpecs()`
301
-
3.Selects the first Python kernel spec (or falls back to `python3-venv`)
302
-
4.Uses this existing spec when creating the kernel connection metadata
303
-
5. This ensures compatibility with the Deepnote server's kernel configuration
299
+
1.**Registers per-venv kernel specs**: The installer registers kernel specs using `ipykernel install --user --name deepnote-venv-<hash>` that point to each venv's Python interpreter
300
+
2.**Queries server for available specs**: Connects to the running Deepnote server using `JupyterLabHelper` and queries available kernel specs via `getKernelSpecs()`
301
+
3.**Prefers venv kernel specs**: Looks for the registered venv kernel spec (`deepnote-venv-<hash>`) first
302
+
4.**Falls back gracefully**: Falls back to other Python kernel specs (like `python3-venv`) if the venv kernel spec is not found
303
+
5.**Uses server-compatible specs**: This ensures compatibility with the Deepnote server's kernel configuration while maintaining venv isolation
304
304
305
305
### Virtual Environment Path Handling
306
306
@@ -378,8 +378,8 @@ These changes ensure that Deepnote notebooks can execute cells reliably by:
0 commit comments