@jupyterlite/pyodide-kernel-extension 0.3.0-alpha.0 → 0.3.1

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/index.js CHANGED
@@ -25,6 +25,7 @@ const kernel = {
25
25
  optional: [IServiceWorkerManager, IBroadcastChannelWrapper],
26
26
  activate: (app, kernelspecs, serviceWorker, broadcastChannel) => {
27
27
  const config = JSON.parse(PageConfig.getOption('litePluginSettings') || '{}')[PLUGIN_ID] || {};
28
+ const baseUrl = PageConfig.getBaseUrl();
28
29
  const url = config.pyodideUrl || PYODIDE_CDN_URL;
29
30
  const pyodideUrl = URLExt.parse(url).href;
30
31
  const pipliteWheelUrl = config.pipliteWheelUrl
@@ -33,6 +34,12 @@ const kernel = {
33
34
  const rawPipUrls = config.pipliteUrls || [];
34
35
  const pipliteUrls = rawPipUrls.map((pipUrl) => URLExt.parse(pipUrl).href);
35
36
  const disablePyPIFallback = !!config.disablePyPIFallback;
37
+ const loadPyodideOptions = config.loadPyodideOptions || {};
38
+ for (const [key, value] of Object.entries(loadPyodideOptions)) {
39
+ if (key.endsWith('URL') && typeof value === 'string') {
40
+ loadPyodideOptions[key] = new URL(value, baseUrl).href;
41
+ }
42
+ }
36
43
  kernelspecs.register({
37
44
  spec: {
38
45
  name: 'python',
@@ -60,6 +67,7 @@ const kernel = {
60
67
  pipliteUrls,
61
68
  disablePyPIFallback,
62
69
  mountDrive,
70
+ loadPyodideOptions,
63
71
  });
64
72
  },
65
73
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlite/pyodide-kernel-extension",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.1",
4
4
  "description": "JupyterLite - Pyodide Kernel Extension",
5
5
  "homepage": "https://github.com/jupyterlite/pyodide-kernel",
6
6
  "bugs": {
@@ -48,10 +48,10 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@jupyterlab/coreutils": "^6.1.1",
51
- "@jupyterlite/contents": "^0.3.0-alpha.0",
52
- "@jupyterlite/kernel": "^0.3.0-alpha.0",
53
- "@jupyterlite/pyodide-kernel": "^0.3.0-alpha.0",
54
- "@jupyterlite/server": "^0.3.0-alpha.0"
51
+ "@jupyterlite/contents": "^0.3.0",
52
+ "@jupyterlite/kernel": "^0.3.0",
53
+ "@jupyterlite/pyodide-kernel": "^0.3.1",
54
+ "@jupyterlite/server": "^0.3.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@jupyterlab/builder": "~4.1.1",
@@ -24,6 +24,19 @@
24
24
  },
25
25
  "default": [],
26
26
  "format": "uri"
27
+ },
28
+ "loadPyodideOptions": {
29
+ "type": "object",
30
+ "description": "additional options to provide to `loadPyodide`, see https://pyodide.org/en/stable/usage/api/js-api.html#globalThis.loadPyodide",
31
+ "default": {},
32
+ "properties": {
33
+ "packages": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "string"
37
+ }
38
+ }
39
+ }
27
40
  }
28
41
  }
29
42
  }