Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Code Style & Organization
- Order method, fields and properties, first by accessibility and then by alphabetical order.
- Don't add the Microsoft copyright header to new files.
- Use `Uri.joinPath()` for constructing file paths to ensure platform-correct path separators (e.g., `Uri.joinPath(venvPath, 'share', 'jupyter', 'kernels')` instead of string concatenation with `/`)

## Testing
- Unit tests use Mocha/Chai framework with `.unit.test.ts` extension
Expand Down
15 changes: 13 additions & 2 deletions src/kernels/deepnote/deepnoteToolkitInstaller.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
const venvPath = this.getVenvPath(deepnoteFileUri);
const venvKey = venvPath.fsPath;

logger.info(`Ensuring virtual environment at ${venvKey}`);

// Wait for any pending installation for this venv to complete
const pendingInstall = this.pendingInstallations.get(venvKey);
if (pendingInstall) {
Expand Down Expand Up @@ -210,6 +212,7 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
logger.info('deepnote-toolkit installed successfully in venv');

// Install kernel spec so the kernel uses this venv's Python
// Install into the venv itself (not --user) so the Deepnote server can discover it
logger.info('Installing kernel spec for venv...');
try {
// Reuse the process service with system environment
Expand All @@ -219,15 +222,23 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
'-m',
'ipykernel',
'install',
'--user',
'--prefix',
venvPath.fsPath,
'--name',
`deepnote-venv-${this.getVenvHash(deepnoteFileUri)}`,
'--display-name',
`Deepnote (${this.getDisplayName(deepnoteFileUri)})`
],
{ throwOnStdErr: false }
);
logger.info('Kernel spec installed successfully');
const kernelSpecPath = Uri.joinPath(
venvPath,
'share',
'jupyter',
'kernels',
`deepnote-venv-${this.getVenvHash(deepnoteFileUri)}`
);
logger.info(`Kernel spec installed successfully to ${kernelSpecPath.fsPath}`);
} catch (ex) {
logger.warn(`Failed to install kernel spec: ${ex}`);
// Don't fail the entire installation if kernel spec creation fails
Expand Down