@jupyterlite/pyodide-kernel 0.7.0-alpha.5 → 0.7.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/kernel.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ILogPayload } from '@jupyterlab/logconsole';
1
+ import type { ILogPayload } from '@jupyterlab/logconsole';
2
2
  import { Contents, KernelMessage } from '@jupyterlab/services';
3
- import { BaseKernel, IKernel } from '@jupyterlite/kernel';
4
- import { IPyodideWorkerKernel } from './tokens';
3
+ import { BaseKernel, IKernel } from '@jupyterlite/services';
4
+ import type { IPyodideWorkerKernel } from './tokens';
5
5
  /**
6
6
  * A kernel that executes Python code with Pyodide.
7
7
  */
package/lib/kernel.js CHANGED
@@ -2,9 +2,9 @@ import coincident from 'coincident';
2
2
  import { wrap } from 'comlink';
3
3
  import { PromiseDelegate } from '@lumino/coreutils';
4
4
  import { PageConfig } from '@jupyterlab/coreutils';
5
- import { BaseKernel } from '@jupyterlite/kernel';
5
+ import { BaseKernel } from '@jupyterlite/services';
6
6
  import { allJSONUrl, pipliteWheelUrl } from './_pypi';
7
- import { DriveContentsProcessor, } from '@jupyterlite/contents';
7
+ import { DriveContentsProcessor, } from '@jupyterlite/services';
8
8
  /**
9
9
  * A kernel that executes Python code with Pyodide.
10
10
  */
@@ -102,6 +102,7 @@ export class PyodideKernel extends BaseKernel {
102
102
  payload: { type: 'text', level: 'critical', data: err.message },
103
103
  kernelId: this.id,
104
104
  });
105
+ this._ready.reject(err.message);
105
106
  });
106
107
  return remote;
107
108
  }
@@ -132,6 +133,12 @@ export class PyodideKernel extends BaseKernel {
132
133
  if (this.isDisposed) {
133
134
  return;
134
135
  }
136
+ try {
137
+ this._ready.reject(`${this.id} was disposed`);
138
+ }
139
+ catch (err) {
140
+ // nothing to see here
141
+ }
135
142
  this._worker.terminate();
136
143
  this._worker = null;
137
144
  super.dispose();
package/lib/tokens.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Definitions for the Pyodide kernel.
3
3
  */
4
- import { TDriveMethod, TDriveRequest, TDriveResponse } from '@jupyterlite/contents';
5
- import { IWorkerKernel } from '@jupyterlite/kernel';
4
+ import { TDriveMethod, TDriveRequest, TDriveResponse, IWorkerKernel } from '@jupyterlite/services';
6
5
  /**
7
6
  * The schema for a Warehouse-like index, as used by piplite.
8
7
  */
package/lib/worker.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type Pyodide from 'pyodide';
2
2
  import type { ILogPayload } from '@jupyterlab/logconsole';
3
3
  import { KernelMessage } from '@jupyterlab/services';
4
- import type { DriveFS } from '@jupyterlite/contents';
4
+ import type { DriveFS } from '@jupyterlite/services/lib/contents/drivefs';
5
5
  import type { IPyodideWorkerKernel } from './tokens';
6
6
  export declare abstract class PyodideRemoteKernel {
7
7
  constructor();
@@ -19,7 +19,7 @@ export declare abstract class PyodideRemoteKernel {
19
19
  protected initFilesystem(options: IPyodideWorkerKernel.IOptions): Promise<void>;
20
20
  /**
21
21
  * Recursively convert a Map to a JavaScript object
22
- * @param obj A Map, Array, or other object to convert
22
+ * @param obj A Map, Array, or other object to convert
23
23
  */
24
24
  mapToObject(obj: any): any;
25
25
  /**
package/lib/worker.js CHANGED
@@ -149,7 +149,8 @@ ${e.stack}`;
149
149
  const mountpoint = '/drive';
150
150
  const { FS, PATH, ERRNO_CODES } = this._pyodide;
151
151
  const { baseUrl } = options;
152
- const { DriveFS } = await import('@jupyterlite/contents');
152
+ // Use direct submodule import for tree-shaking
153
+ const { DriveFS } = await import('@jupyterlite/services/lib/contents/drivefs');
153
154
  const driveFS = new DriveFS({
154
155
  FS: FS,
155
156
  PATH,
@@ -167,16 +168,17 @@ ${e.stack}`;
167
168
  }
168
169
  /**
169
170
  * Recursively convert a Map to a JavaScript object
170
- * @param obj A Map, Array, or other object to convert
171
+ * @param obj A Map, Array, or other object to convert
171
172
  */
172
173
  mapToObject(obj) {
173
174
  const out = obj instanceof Array ? [] : {};
174
- obj.forEach((value, key) => {
175
+ const entries = obj instanceof Map ? obj.entries() : Object.entries(obj);
176
+ for (const [key, value] of entries) {
175
177
  out[key] =
176
178
  value instanceof Map || value instanceof Array
177
179
  ? this.mapToObject(value)
178
180
  : value;
179
- });
181
+ }
180
182
  return out;
181
183
  }
182
184
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlite/pyodide-kernel",
3
- "version": "0.7.0-alpha.5",
3
+ "version": "0.7.0-rc.0",
4
4
  "description": "JupyterLite - Pyodide Kernel",
5
5
  "homepage": "https://github.com/jupyterlite/pyodide-kernel",
6
6
  "bugs": {
@@ -50,17 +50,16 @@
50
50
  "watch": "tsc -b --watch"
51
51
  },
52
52
  "dependencies": {
53
- "@jupyterlab/coreutils": "^6.5.0-beta.0",
54
- "@jupyterlab/logconsole": "^4.5.0-beta.0",
55
- "@jupyterlite/contents": "^0.7.0-alpha.7",
56
- "@jupyterlite/kernel": "^0.7.0-alpha.7",
53
+ "@jupyterlab/coreutils": "^6.5.0",
54
+ "@jupyterlab/logconsole": "^4.5.0",
55
+ "@jupyterlite/services": "^0.7.0-rc.0",
57
56
  "coincident": "^1.2.3",
58
57
  "comlink": "^4.4.2"
59
58
  },
60
59
  "devDependencies": {
61
60
  "@babel/core": "^7.22.17",
62
61
  "esbuild": "^0.19.2",
63
- "pyodide": "0.28.3",
62
+ "pyodide": "0.29.0",
64
63
  "rimraf": "^6.0.1",
65
64
  "typescript": "~5.2.2"
66
65
  },
@@ -69,8 +68,8 @@
69
68
  },
70
69
  "pyodide-kernel": {
71
70
  "packages": {
72
- "py/pyodide-kernel": "0.7.0a5",
73
- "py/piplite": "0.7.0a5",
71
+ "py/pyodide-kernel": "0.7.0rc0",
72
+ "py/piplite": "0.7.0rc0",
74
73
  "py/ipykernel": "6.9.2",
75
74
  "py/widgetsnbextension3/widgetsnbextension": "3.6.999",
76
75
  "py/widgetsnbextension4/widgetsnbextension": "4.0.999"
package/pypi/all.json CHANGED
@@ -5,19 +5,19 @@
5
5
  {
6
6
  "comment_text": "",
7
7
  "digests": {
8
- "md5": "a1c974b121fcd1985c8acb1f7a398b15",
9
- "sha256": "5129fe7118b141f56b204108316b15eb5698fbbadb2e2c2761ebd9e4122a3cd0"
8
+ "md5": "fd18f643a37a3426cae1ab31c9c60c8c",
9
+ "sha256": "a61ed6a44856a828635d345216b806f597b5aadc2f3ee190c3a91560e5fe9a7a"
10
10
  },
11
11
  "downloads": -1,
12
12
  "filename": "ipykernel-6.9.2-py3-none-any.whl",
13
13
  "has_sig": false,
14
- "md5_digest": "a1c974b121fcd1985c8acb1f7a398b15",
14
+ "md5_digest": "fd18f643a37a3426cae1ab31c9c60c8c",
15
15
  "packagetype": "bdist_wheel",
16
16
  "python_version": "py3",
17
17
  "requires_python": ">=3.10",
18
18
  "size": 2731,
19
- "upload_time": "2025-10-13T08:08:08.376946Z",
20
- "upload_time_iso_8601": "2025-10-13T08:08:08.376946Z",
19
+ "upload_time": "2025-11-20T08:48:49.826959Z",
20
+ "upload_time_iso_8601": "2025-11-20T08:48:49.826959Z",
21
21
  "url": "./ipykernel-6.9.2-py3-none-any.whl",
22
22
  "yanked": false,
23
23
  "yanked_reason": null
@@ -27,24 +27,24 @@
27
27
  },
28
28
  "piplite": {
29
29
  "releases": {
30
- "0.7.0a5": [
30
+ "0.7.0rc0": [
31
31
  {
32
32
  "comment_text": "",
33
33
  "digests": {
34
- "md5": "31c78e0c4e20cf372646174462aa29d3",
35
- "sha256": "84cd60599ff10559662325761d51f1de5de853b67ffd1ca7a2c6a9d8dfba541e"
34
+ "md5": "8f14f9231ae8e786d5e00115bc37eb94",
35
+ "sha256": "56325125a06bb24493da4bbb3b6dc37cc35ce440f3587aed0c902b8fe8a3ae7a"
36
36
  },
37
37
  "downloads": -1,
38
- "filename": "piplite-0.7.0a5-py3-none-any.whl",
38
+ "filename": "piplite-0.7.0rc0-py3-none-any.whl",
39
39
  "has_sig": false,
40
- "md5_digest": "31c78e0c4e20cf372646174462aa29d3",
40
+ "md5_digest": "8f14f9231ae8e786d5e00115bc37eb94",
41
41
  "packagetype": "bdist_wheel",
42
42
  "python_version": "py3",
43
43
  "requires_python": "<3.12,>=3.11",
44
- "size": 7966,
45
- "upload_time": "2025-10-13T08:08:08.376946Z",
46
- "upload_time_iso_8601": "2025-10-13T08:08:08.376946Z",
47
- "url": "./piplite-0.7.0a5-py3-none-any.whl",
44
+ "size": 7976,
45
+ "upload_time": "2025-11-20T08:48:49.826959Z",
46
+ "upload_time_iso_8601": "2025-11-20T08:48:49.826959Z",
47
+ "url": "./piplite-0.7.0rc0-py3-none-any.whl",
48
48
  "yanked": false,
49
49
  "yanked_reason": null
50
50
  }
@@ -53,24 +53,24 @@
53
53
  },
54
54
  "pyodide-kernel": {
55
55
  "releases": {
56
- "0.7.0a5": [
56
+ "0.7.0rc0": [
57
57
  {
58
58
  "comment_text": "",
59
59
  "digests": {
60
- "md5": "2b4952f1c687fe25fc30072a4a92b88d",
61
- "sha256": "0d04ce3c7d3444f0adeed3f33049854ffc1b1a088c28e840661d0fcb3447f24e"
60
+ "md5": "74120ab2e2117a2ca90a8c0189dde9df",
61
+ "sha256": "8b0e38843fdf7ddb9a0f7f5bcc4c1d570d1bffdead25905254f31b71b2c61f63"
62
62
  },
63
63
  "downloads": -1,
64
- "filename": "pyodide_kernel-0.7.0a5-py3-none-any.whl",
64
+ "filename": "pyodide_kernel-0.7.0rc0-py3-none-any.whl",
65
65
  "has_sig": false,
66
- "md5_digest": "2b4952f1c687fe25fc30072a4a92b88d",
66
+ "md5_digest": "74120ab2e2117a2ca90a8c0189dde9df",
67
67
  "packagetype": "bdist_wheel",
68
68
  "python_version": "py3",
69
69
  "requires_python": "<3.12,>=3.11",
70
- "size": 11414,
71
- "upload_time": "2025-10-13T08:08:08.376946Z",
72
- "upload_time_iso_8601": "2025-10-13T08:08:08.376946Z",
73
- "url": "./pyodide_kernel-0.7.0a5-py3-none-any.whl",
70
+ "size": 11424,
71
+ "upload_time": "2025-11-20T08:48:49.825959Z",
72
+ "upload_time_iso_8601": "2025-11-20T08:48:49.825959Z",
73
+ "url": "./pyodide_kernel-0.7.0rc0-py3-none-any.whl",
74
74
  "yanked": false,
75
75
  "yanked_reason": null
76
76
  }
@@ -83,19 +83,19 @@
83
83
  {
84
84
  "comment_text": "",
85
85
  "digests": {
86
- "md5": "92b6894d11d333e7e38ec8b9adacc113",
87
- "sha256": "5b84d118f6056883d3f79b7f7e4c570970e034f6c3b01c45e547ea0ad3ae9cdb"
86
+ "md5": "86a4e69468616fe678e7370711b4f4c6",
87
+ "sha256": "5c37826ba357133160324a03ea47f18f1bebd23b4afe3d0861dd4bdc7935e037"
88
88
  },
89
89
  "downloads": -1,
90
90
  "filename": "widgetsnbextension-3.6.999-py3-none-any.whl",
91
91
  "has_sig": false,
92
- "md5_digest": "92b6894d11d333e7e38ec8b9adacc113",
92
+ "md5_digest": "86a4e69468616fe678e7370711b4f4c6",
93
93
  "packagetype": "bdist_wheel",
94
94
  "python_version": "py3",
95
95
  "requires_python": "<3.12,>=3.11",
96
96
  "size": 2369,
97
- "upload_time": "2025-10-13T08:08:08.376946Z",
98
- "upload_time_iso_8601": "2025-10-13T08:08:08.376946Z",
97
+ "upload_time": "2025-11-20T08:48:49.826959Z",
98
+ "upload_time_iso_8601": "2025-11-20T08:48:49.826959Z",
99
99
  "url": "./widgetsnbextension-3.6.999-py3-none-any.whl",
100
100
  "yanked": false,
101
101
  "yanked_reason": null
@@ -105,19 +105,19 @@
105
105
  {
106
106
  "comment_text": "",
107
107
  "digests": {
108
- "md5": "789f54a4379a909c047fec6c63ca4369",
109
- "sha256": "d6766804a149b1c0c0d606c8b67da806fa30e7fe3527a135ba0bf9ede1f5745d"
108
+ "md5": "71c901252e73e97d23102628c6bd35a6",
109
+ "sha256": "8bd67fa6a0ab4eb3478bbe792284be868021a1d3a59a2d8f66155fc5247f6596"
110
110
  },
111
111
  "downloads": -1,
112
112
  "filename": "widgetsnbextension-4.0.999-py3-none-any.whl",
113
113
  "has_sig": false,
114
- "md5_digest": "789f54a4379a909c047fec6c63ca4369",
114
+ "md5_digest": "71c901252e73e97d23102628c6bd35a6",
115
115
  "packagetype": "bdist_wheel",
116
116
  "python_version": "py3",
117
117
  "requires_python": "<3.12,>=3.11",
118
118
  "size": 2370,
119
- "upload_time": "2025-10-13T08:08:08.377946Z",
120
- "upload_time_iso_8601": "2025-10-13T08:08:08.377946Z",
119
+ "upload_time": "2025-11-20T08:48:49.826959Z",
120
+ "upload_time_iso_8601": "2025-11-20T08:48:49.826959Z",
121
121
  "url": "./widgetsnbextension-4.0.999-py3-none-any.whl",
122
122
  "yanked": false,
123
123
  "yanked_reason": null
index d280a1a..b025bb4 100644
Binary file