Skip to content

Commit b67da89

Browse files
committed
fix: add pip upgrading to deepnote toolkit installation
1 parent c35f414 commit b67da89

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

src/kernels/deepnote/deepnoteToolkitInstaller.node.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,31 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
158158
return undefined;
159159
}
160160

161+
// Use undefined as resource to get full system environment (including git in PATH)
162+
const venvProcessService = await this.processServiceFactory.create(undefined);
163+
164+
// Upgrade pip in the venv to the latest version
165+
logger.info('Upgrading pip in venv to latest version...');
166+
this.outputChannel.appendLine('Upgrading pip...');
167+
const pipUpgradeResult = await venvProcessService.exec(
168+
venvInterpreter.uri.fsPath,
169+
['-m', 'pip', 'install', '--upgrade', 'pip'],
170+
{ throwOnStdErr: false }
171+
);
172+
173+
if (pipUpgradeResult.stdout) {
174+
logger.info(`pip upgrade output: ${pipUpgradeResult.stdout}`);
175+
}
176+
if (pipUpgradeResult.stderr) {
177+
logger.info(`pip upgrade stderr: ${pipUpgradeResult.stderr}`);
178+
}
179+
180+
Cancellation.throwIfCanceled(token);
181+
161182
// Install deepnote-toolkit and ipykernel in venv
162183
logger.info(`Installing deepnote-toolkit and ipykernel in venv from ${DEEPNOTE_TOOLKIT_WHEEL_URL}`);
163184
this.outputChannel.appendLine('Installing deepnote-toolkit and ipykernel...');
164185

165-
// Use undefined as resource to get full system environment (including git in PATH)
166-
const venvProcessService = await this.processServiceFactory.create(undefined);
167186
const installResult = await venvProcessService.exec(
168187
venvInterpreter.uri.fsPath,
169188
[
@@ -174,7 +193,7 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
174193
`deepnote-toolkit[server] @ ${DEEPNOTE_TOOLKIT_WHEEL_URL}`,
175194
'ipykernel'
176195
],
177-
{ throwOnStdErr: true }
196+
{ throwOnStdErr: false }
178197
);
179198

180199
Cancellation.throwIfCanceled(token);

0 commit comments

Comments
 (0)