@jupyterlite/pyodide-kernel-extension 0.0.2 → 0.0.3
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/LICENSE +29 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -3
- package/package.json +5 -3
- package/schema/kernel.v0.schema.json +29 -0
- package/style/img/pyodide.svg +17 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022, JupyterLite Contributors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -4,6 +4,9 @@ import { PageConfig, URLExt } from '@jupyterlab/coreutils';
|
|
|
4
4
|
import { IServiceWorkerManager, } from '@jupyterlite/server';
|
|
5
5
|
import { IKernelSpecs } from '@jupyterlite/kernel';
|
|
6
6
|
import { IBroadcastChannelWrapper } from '@jupyterlite/contents';
|
|
7
|
+
export * as KERNEL_SETTINGS_SCHEMA from '../schema/kernel.v0.schema.json';
|
|
8
|
+
import KERNEL_ICON_SVG_STR from '../style/img/pyodide.svg';
|
|
9
|
+
const KERNEL_ICON_URL = `data:image/svg+xml;base64,${btoa(KERNEL_ICON_SVG_STR)}`;
|
|
7
10
|
/**
|
|
8
11
|
* The default CDN fallback for Pyodide
|
|
9
12
|
*/
|
|
@@ -21,7 +24,6 @@ const kernel = {
|
|
|
21
24
|
requires: [IKernelSpecs],
|
|
22
25
|
optional: [IServiceWorkerManager, IBroadcastChannelWrapper],
|
|
23
26
|
activate: (app, kernelspecs, serviceWorker, broadcastChannel) => {
|
|
24
|
-
const baseUrl = PageConfig.getBaseUrl();
|
|
25
27
|
const config = JSON.parse(PageConfig.getOption('litePluginSettings') || '{}')[PLUGIN_ID] || {};
|
|
26
28
|
const url = config.pyodideUrl || PYODIDE_CDN_URL;
|
|
27
29
|
const pyodideUrl = URLExt.parse(url).href;
|
|
@@ -35,8 +37,8 @@ const kernel = {
|
|
|
35
37
|
language: 'python',
|
|
36
38
|
argv: [],
|
|
37
39
|
resources: {
|
|
38
|
-
'logo-32x32':
|
|
39
|
-
'logo-64x64':
|
|
40
|
+
'logo-32x32': KERNEL_ICON_URL,
|
|
41
|
+
'logo-64x64': KERNEL_ICON_URL,
|
|
40
42
|
},
|
|
41
43
|
},
|
|
42
44
|
create: async (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlite/pyodide-kernel-extension",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "JupyterLite - Pyodide Kernel Extension",
|
|
5
5
|
"homepage": "https://github.com/jupyterlite/pyodide-kernel",
|
|
6
6
|
"bugs": {
|
|
@@ -26,7 +26,9 @@
|
|
|
26
26
|
"lib/*.js.map",
|
|
27
27
|
"lib/*.js",
|
|
28
28
|
"style/*.css",
|
|
29
|
-
"style
|
|
29
|
+
"style/**/*.svg",
|
|
30
|
+
"style/index.js",
|
|
31
|
+
"schema/*.json"
|
|
30
32
|
],
|
|
31
33
|
"scripts": {
|
|
32
34
|
"build": "jlpm build:lib && jlpm build:labextension:dev",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"@jupyterlab/coreutils": "^5.5.2",
|
|
49
51
|
"@jupyterlite/contents": "^0.1.0-beta.18",
|
|
50
52
|
"@jupyterlite/kernel": "^0.1.0-beta.18",
|
|
51
|
-
"@jupyterlite/pyodide-kernel": "^0.0.
|
|
53
|
+
"@jupyterlite/pyodide-kernel": "^0.0.3",
|
|
52
54
|
"@jupyterlite/server": "^0.1.0-beta.18"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "https://jupyterlite-pyodide-kernel.readthedocs.org/en/latest/reference/schema/settings-v0.html#",
|
|
4
|
+
"title": "Pyodide Kernel Settings Schema v0",
|
|
5
|
+
"description": "Pyodide-specific configuration values. Will be defined in another location in the future.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"pyodideUrl": {
|
|
9
|
+
"description": "The path to the main pyodide.js entry point",
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js",
|
|
12
|
+
"format": "uri"
|
|
13
|
+
},
|
|
14
|
+
"disablePyPIFallback": {
|
|
15
|
+
"description": "Disable the piplite behavior of falling back to https://pypi.org/pypi/",
|
|
16
|
+
"default": false,
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
},
|
|
19
|
+
"pipliteUrls": {
|
|
20
|
+
"description": "Paths to PyPI-compatible API endpoints for wheels. If ending in ``all.json``, assumed to be an aggregate, keyed by package name, with relative paths",
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"default": [],
|
|
26
|
+
"format": "uri"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="182" height="182" data-name="Layer 1" version="1.1" viewBox="0 0 182 182" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>.cls-1 {
|
|
5
|
+
fill: #fff;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.cls-2 {
|
|
9
|
+
fill: #654ff0;
|
|
10
|
+
}</style>
|
|
11
|
+
</defs>
|
|
12
|
+
<rect width="182" height="182" fill="#fff" stop-color="#000000" style="paint-order:stroke fill markers"/>
|
|
13
|
+
<rect class="cls-1" x="107" y="125" width="50" height="32"/>
|
|
14
|
+
<path class="cls-2" d="m135.18 97c0-0.13-0.01-7.24-0.02-7.37h27.51v71.33h-71.34v-71.33h27.51c0 0.13-0.02 7.24-0.02 7.37m32.59 56.33h4.9l-7.43-25.25h-7.45l-6.12 25.25h4.75l1.24-5.62h8.49l1.61 5.62zm-26.03 0h4.69l6.02-25.25h-4.63l-3.69 17.4h-0.06l-3.5-17.4h-4.42l-3.9 17.19h-0.06l-3.23-17.19h-4.72l5.44 25.25h4.78l3.75-17.19h0.06zm18.89-19.03h1.99l2.37 9.27h-6.42z"/>
|
|
15
|
+
<path d="m89 49.66c0 10.6-8.8 20-20 20h-40v20h-10v-70h50c10.7 0 19.7 8.9 20 20zm-10-10c0-5.5-4.5-10-10-10h-40v30h40c5.5 0 10-4.5 10-10z"/>
|
|
16
|
+
<path d="m132 67.66v22h-10v-22l-30-33v-15h10v10.9l25 27.5 25-27.5v-10.9h10v15z"/>
|
|
17
|
+
</svg>
|