Skip to content

Commit 669d500

Browse files
authored
Merge branch 'main' into filipzitny/mar-253-contributing-guide-for-deepnotevscode-deepnote
2 parents abc7d89 + 5d7cb11 commit 669d500

29 files changed

+1199
-66
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,31 @@ jobs:
190190
- name: Run spell check
191191
run: npm run spell-check
192192

193+
package-lock-drift-check:
194+
name: Package Lock Drift Check
195+
runs-on: ubuntu-latest
196+
timeout-minutes: 5
197+
steps:
198+
- name: Checkout
199+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
200+
201+
- name: Setup Node.js
202+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
203+
with:
204+
cache: 'npm'
205+
node-version-file: '.nvmrc'
206+
registry-url: 'https://npm.pkg.github.com'
207+
scope: '@deepnote'
208+
209+
- name: Install dependencies
210+
run: npm install
211+
env:
212+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
213+
214+
- name: Check package lock drift
215+
run: |
216+
git diff --exit-code HEAD
217+
193218
audit-prod:
194219
name: Audit - Production
195220
runs-on: ubuntu-latest

package-lock.json

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vscode-deepnote",
33
"displayName": "Deepnote",
4-
"version": "0.2.0",
4+
"version": "0.3.0",
55
"description": "Deepnote notebook support.",
66
"publisher": "Deepnote",
77
"author": {
@@ -99,6 +99,12 @@
9999
"category": "Deepnote",
100100
"icon": "$(plug)"
101101
},
102+
{
103+
"command": "deepnote.openInDeepnote",
104+
"title": "Open in Deepnote",
105+
"category": "Deepnote",
106+
"icon": "$(globe)"
107+
},
102108
{
103109
"command": "deepnote.newProject",
104110
"title": "New project",
@@ -129,6 +135,12 @@
129135
"category": "Deepnote",
130136
"icon": "$(graph)"
131137
},
138+
{
139+
"command": "deepnote.addChartBlock",
140+
"title": "%deepnote.commands.addChartBlock.title%",
141+
"category": "Deepnote",
142+
"icon": "$(graph-line)"
143+
},
132144
{
133145
"command": "deepnote.addInputTextBlock",
134146
"title": "%deepnote.commands.addInputTextBlock.title%",
@@ -761,6 +773,11 @@
761773
"when": "editorFocus && editorLangId == python && jupyter.hascodecells && !notebookEditorFocused && isWorkspaceTrusted",
762774
"command": "jupyter.exportfileasnotebook",
763775
"group": "Jupyter3@2"
776+
},
777+
{
778+
"when": "resourceExtname == .deepnote",
779+
"command": "deepnote.openInDeepnote",
780+
"group": "navigation"
764781
}
765782
],
766783
"editor.interactiveWindow.context": [
@@ -850,6 +867,51 @@
850867
"group": "navigation@1",
851868
"when": "notebookType == 'deepnote'"
852869
},
870+
{
871+
"command": "deepnote.addChartBlock",
872+
"group": "navigation@2",
873+
"when": "notebookType == 'deepnote'"
874+
},
875+
{
876+
"command": "deepnote.addBigNumberChartBlock",
877+
"group": "navigation@3",
878+
"when": "notebookType == 'deepnote'"
879+
},
880+
{
881+
"command": "deepnote.addInputTextBlock",
882+
"group": "navigation@4",
883+
"when": "notebookType == 'deepnote'"
884+
},
885+
{
886+
"command": "deepnote.addInputTextareaBlock",
887+
"group": "navigation@5",
888+
"when": "notebookType == 'deepnote'"
889+
},
890+
{
891+
"command": "deepnote.addInputSelectBlock",
892+
"group": "navigation@6",
893+
"when": "notebookType == 'deepnote'"
894+
},
895+
{
896+
"command": "deepnote.addInputSliderBlock",
897+
"group": "navigation@7",
898+
"when": "notebookType == 'deepnote'"
899+
},
900+
{
901+
"command": "deepnote.addInputCheckboxBlock",
902+
"group": "navigation@8",
903+
"when": "notebookType == 'deepnote'"
904+
},
905+
{
906+
"command": "deepnote.addInputDateBlock",
907+
"group": "navigation@9",
908+
"when": "notebookType == 'deepnote'"
909+
},
910+
{
911+
"command": "deepnote.addInputDateRangeBlock",
912+
"group": "navigation@10",
913+
"when": "notebookType == 'deepnote'"
914+
},
853915
{
854916
"command": "jupyter.restartkernel",
855917
"group": "navigation/execute@5",
@@ -1377,7 +1439,7 @@
13771439
"view/item/context": [
13781440
{
13791441
"command": "deepnote.revealInExplorer",
1380-
"when": "view == deepnoteExplorer",
1442+
"when": "view == deepnoteExplorer && viewItem != loading",
13811443
"group": "inline@2"
13821444
}
13831445
]
@@ -1386,6 +1448,18 @@
13861448
"type": "object",
13871449
"title": "Deepnote",
13881450
"properties": {
1451+
"deepnote.domain": {
1452+
"type": "string",
1453+
"default": "deepnote.com",
1454+
"description": "Deepnote domain (e.g., 'deepnote.com' or 'ra-18838.deepnote-staging.com')",
1455+
"scope": "application"
1456+
},
1457+
"deepnote.disableSSLVerification": {
1458+
"type": "boolean",
1459+
"default": false,
1460+
"description": "Disable SSL certificate verification (for development only)",
1461+
"scope": "application"
1462+
},
13891463
"jupyter.experiments.enabled": {
13901464
"type": "boolean",
13911465
"default": true,
@@ -2027,7 +2101,8 @@
20272101
"viewsWelcome": [
20282102
{
20292103
"view": "deepnoteExplorer",
2030-
"contents": "Welcome to Deepnote for VS Code!\nExplore your data with SQL and Python. Build interactive notebooks, collaborate with your team, and share your insights.\n\n\n\n[$(new-file) New Project](command:deepnote.newProject)\n[$(folder-opened) Import Notebook](command:deepnote.importNotebook)"
2104+
"contents": "Welcome to Deepnote for VS Code!\nExplore your data with SQL and Python. Build interactive notebooks, collaborate with your team, and share your insights.\n\n\n\n[$(new-file) New Project](command:deepnote.newProject)\n[$(folder-opened) Import Notebook](command:deepnote.importNotebook)",
2105+
"when": "deepnote.explorerInitialScanComplete"
20312106
}
20322107
],
20332108
"debuggers": [

package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@
255255
"deepnote.commands.importNotebook.title": "Import Notebook",
256256
"deepnote.commands.importJupyterNotebook.title": "Import Jupyter Notebook",
257257
"deepnote.commands.addSqlBlock.title": "Add SQL Block",
258-
"deepnote.commands.addBigNumberChartBlock.title": "Add Big Number Chart Block",
258+
"deepnote.commands.addBigNumberChartBlock.title": "Add Big Number Block",
259+
"deepnote.commands.addChartBlock.title": "Add Chart Block",
259260
"deepnote.commands.addInputTextBlock.title": "Add Input Text Block",
260261
"deepnote.commands.addInputTextareaBlock.title": "Add Input Textarea Block",
261262
"deepnote.commands.addInputSelectBlock.title": "Add Input Select Block",

src/commands.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export interface ICommandNameArgumentTypeMapping {
188188
[DSCommands.ContinueEditSessionInCodespace]: [];
189189
[DSCommands.AddSqlBlock]: [];
190190
[DSCommands.AddBigNumberChartBlock]: [];
191+
[DSCommands.AddChartBlock]: [];
191192
[DSCommands.AddInputTextBlock]: [];
192193
[DSCommands.AddInputTextareaBlock]: [];
193194
[DSCommands.AddInputSelectBlock]: [];
@@ -197,4 +198,5 @@ export interface ICommandNameArgumentTypeMapping {
197198
[DSCommands.AddInputDateRangeBlock]: [];
198199
[DSCommands.AddInputFileBlock]: [];
199200
[DSCommands.AddButtonBlock]: [];
201+
[DSCommands.OpenInDeepnote]: [];
200202
}

src/kernels/deepnote/deepnoteSharedToolkitInstaller.node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IOutputChannel, IExtensionContext } from '../../platform/common/types';
1010
import { STANDARD_OUTPUT_CHANNEL } from '../../platform/common/constants';
1111
import { IFileSystem } from '../../platform/common/platform/types';
1212
import { Cancellation } from '../../platform/common/cancellation';
13-
import { DEEPNOTE_TOOLKIT_WHEEL_URL, DEEPNOTE_TOOLKIT_VERSION } from './types';
13+
import { DEEPNOTE_TOOLKIT_VERSION } from './types';
1414

1515
/**
1616
* Manages a shared installation of deepnote-toolkit in a versioned extension directory.
@@ -220,7 +220,7 @@ export class DeepnoteSharedToolkitInstaller {
220220
'--target',
221221
this.sharedInstallationPath.fsPath,
222222
'--upgrade',
223-
`deepnote-toolkit[server] @ ${DEEPNOTE_TOOLKIT_WHEEL_URL}`
223+
`deepnote-toolkit[server]==${DEEPNOTE_TOOLKIT_VERSION}`
224224
],
225225
{ throwOnStdErr: false }
226226
);

src/kernels/deepnote/deepnoteToolkitInstaller.node.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { inject, injectable, named } from 'inversify';
55
import { CancellationToken, Uri, workspace } from 'vscode';
66
import { PythonEnvironment } from '../../platform/pythonEnvironments/info';
7-
import { IDeepnoteToolkitInstaller, DEEPNOTE_TOOLKIT_WHEEL_URL, DEEPNOTE_TOOLKIT_VERSION } from './types';
7+
import { IDeepnoteToolkitInstaller, DEEPNOTE_TOOLKIT_VERSION } from './types';
88
import { IProcessServiceFactory } from '../../platform/common/process/types.node';
99
import { logger } from '../../platform/logging';
1010
import { IOutputChannel, IExtensionContext } from '../../platform/common/types';
@@ -189,7 +189,7 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
189189
Cancellation.throwIfCanceled(token);
190190

191191
// Install deepnote-toolkit and ipykernel in venv
192-
logger.info(`Installing deepnote-toolkit and ipykernel in venv from ${DEEPNOTE_TOOLKIT_WHEEL_URL}`);
192+
logger.info(`Installing deepnote-toolkit (${DEEPNOTE_TOOLKIT_VERSION}) and ipykernel in venv from PyPI`);
193193
this.outputChannel.appendLine('Installing deepnote-toolkit and ipykernel...');
194194

195195
const installResult = await venvProcessService.exec(
@@ -199,7 +199,7 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
199199
'pip',
200200
'install',
201201
'--upgrade',
202-
`deepnote-toolkit[server] @ ${DEEPNOTE_TOOLKIT_WHEEL_URL}`,
202+
`deepnote-toolkit[server]==${DEEPNOTE_TOOLKIT_VERSION}`,
203203
'ipykernel'
204204
],
205205
{ throwOnStdErr: false }
@@ -260,7 +260,7 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
260260
throw new DeepnoteToolkitInstallError(
261261
venvInterpreter.uri.fsPath,
262262
venvPath.fsPath,
263-
DEEPNOTE_TOOLKIT_WHEEL_URL,
263+
DEEPNOTE_TOOLKIT_VERSION,
264264
installResult.stdout || '',
265265
installResult.stderr || 'Package installation completed but verification failed'
266266
);
@@ -278,7 +278,7 @@ export class DeepnoteToolkitInstaller implements IDeepnoteToolkitInstaller {
278278
throw new DeepnoteToolkitInstallError(
279279
baseInterpreter.uri.fsPath,
280280
venvPath.fsPath,
281-
DEEPNOTE_TOOLKIT_WHEEL_URL,
281+
DEEPNOTE_TOOLKIT_VERSION,
282282
'',
283283
ex instanceof Error ? ex.message : String(ex),
284284
ex instanceof Error ? ex : undefined

src/kernels/deepnote/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export interface IDeepnoteKernelAutoSelector {
156156
ensureKernelSelected(notebook: vscode.NotebookDocument, token?: vscode.CancellationToken): Promise<void>;
157157
}
158158

159-
export const DEEPNOTE_TOOLKIT_VERSION = '0.2.30.post30';
160-
export const DEEPNOTE_TOOLKIT_WHEEL_URL = `https://deepnote-staging-runtime-artifactory.s3.amazonaws.com/deepnote-toolkit-packages/${DEEPNOTE_TOOLKIT_VERSION}/deepnote_toolkit-${DEEPNOTE_TOOLKIT_VERSION}-py3-none-any.whl`;
159+
export const DEEPNOTE_TOOLKIT_VERSION = '1.0.0rc2';
161160
export const DEEPNOTE_DEFAULT_PORT = 8888;
162161
export const DEEPNOTE_NOTEBOOK_TYPE = 'deepnote';

src/notebooks/deepnote/blocks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ project:
4545
type: 'code'
4646
content: "df = pd.DataFrame({'a': [1, 2, 3]})\ndf"
4747
sortingKey: '001'
48-
blockGroup: 'default-group'
48+
blockGroup: 'uuid-v4'
4949
executionCount: 1
5050
metadata:
5151
table_state_spec: '{"pageSize": 25, "pageIndex": 0}'
@@ -150,7 +150,7 @@ Example of a cell after pocket conversion:
150150
__deepnotePocket: {
151151
type: 'code',
152152
sortingKey: '001',
153-
blockGroup: 'default-group',
153+
blockGroup: 'uuid-v4',
154154
executionCount: 1
155155
}
156156
},
@@ -472,7 +472,7 @@ blocks:
472472
type: 'big-number'
473473
content: ''
474474
sortingKey: '001'
475-
blockGroup: 'default-group'
475+
blockGroup: 'uuid-v4'
476476
metadata:
477477
deepnote_big_number_title: 'Customers'
478478
deepnote_big_number_value: 'customers'
@@ -517,7 +517,7 @@ When opened in VS Code, the block becomes a cell with JSON content showing the c
517517
__deepnotePocket: {
518518
type: 'big-number',
519519
sortingKey: '001',
520-
blockGroup: 'default-group'
520+
blockGroup: 'uuid-v4'
521521
}
522522
}
523523
}

src/notebooks/deepnote/deepnoteDataConverter.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
ButtonBlockConverter
2828
} from './converters/inputConverters';
2929
import { CHART_BIG_NUMBER_MIME_TYPE } from '../../platform/deepnote/deepnoteConstants';
30+
import { generateUuid } from '../../platform/common/uuid';
3031

3132
/**
3233
* Utility class for converting between Deepnote block structures and VS Code notebook cells.
@@ -168,7 +169,7 @@ export class DeepnoteDataConverter {
168169

169170
private createFallbackBlock(cell: NotebookCellData, index: number): DeepnoteBlock {
170171
return {
171-
blockGroup: 'default-group',
172+
blockGroup: generateUuid(),
172173
id: generateBlockId(),
173174
sortingKey: generateSortingKey(index),
174175
type: cell.kind === NotebookCellKind.Code ? 'code' : 'markdown',
@@ -235,6 +236,8 @@ export class DeepnoteDataConverter {
235236
for (const item of output.items) {
236237
if (item.mime === 'text/plain') {
237238
data['text/plain'] = new TextDecoder().decode(item.data);
239+
} else if (item.mime === 'text/markdown') {
240+
data['text/markdown'] = new TextDecoder().decode(item.data);
238241
} else if (item.mime === 'text/html') {
239242
data['text/html'] = new TextDecoder().decode(item.data);
240243
} else if (item.mime === 'application/json') {
@@ -391,6 +394,10 @@ export class DeepnoteDataConverter {
391394
);
392395
}
393396

397+
if (data['text/markdown']) {
398+
items.push(NotebookCellOutputItem.text(data['text/markdown'] as string, 'text/markdown'));
399+
}
400+
394401
if (data['text/plain']) {
395402
let mimeType = 'text/plain';
396403
// deepnote-toolkit returns the text/plain mime type for big number outputs

0 commit comments

Comments
 (0)