@jupyterlite/xeus 0.1.1 → 0.1.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/README.md +15 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# JupyterLite Xeus
|
|
2
2
|
|
|
3
3
|
[](https://github.com/jupyterlite/xeus/actions/workflows/build.yml)
|
|
4
|
+
|
|
4
5
|
JupyterLite loader for Xeus kernels
|
|
5
6
|
|
|
6
7
|
## Requirements
|
|
@@ -21,7 +22,7 @@ pip install jupyterlite_xeus
|
|
|
21
22
|
|
|
22
23
|
#### xeus-python kernel
|
|
23
24
|
|
|
24
|
-
To
|
|
25
|
+
To load a `xeus-python` kernel with a custom environment, create an `environment.yaml` file with `xeus-python` and the desired dependencies. Here is an example with `numpy` as a additional dependency:
|
|
25
26
|
|
|
26
27
|
```yaml
|
|
27
28
|
name: xeus-lite-wasm
|
|
@@ -33,7 +34,7 @@ dependencies:
|
|
|
33
34
|
- numpy
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
To build
|
|
37
|
+
To build JupyterLite, run the following command where `environment.yaml` is the path to the file you just created
|
|
37
38
|
|
|
38
39
|
```bash
|
|
39
40
|
jupyter lite build --XeusAddon.environment_file=some_path/to/environment.yaml
|
|
@@ -41,7 +42,7 @@ jupyter lite build --XeusAddon.environment_file=some_path/to/environment.yaml
|
|
|
41
42
|
|
|
42
43
|
#### xeus-lua / xeus-sqlite / xeus-\<mylang\>
|
|
43
44
|
|
|
44
|
-
To
|
|
45
|
+
To load a `xeus-lua` or `xeus-sqlite` kernel you can
|
|
45
46
|
do the same as above, just with
|
|
46
47
|
|
|
47
48
|
```yaml
|
|
@@ -56,8 +57,8 @@ dependencies:
|
|
|
56
57
|
- xeus-sqlite
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
Note that xeus-sqlite and xeus-lua do not
|
|
60
|
-
To build
|
|
60
|
+
Note that `xeus-sqlite` and `xeus-lua` do not support additional dependencies yet.
|
|
61
|
+
To build JupyterLite, run again:
|
|
61
62
|
|
|
62
63
|
```bash
|
|
63
64
|
jupyter lite build --XeusAddon.environment_file=environment.yaml
|
|
@@ -65,7 +66,7 @@ jupyter lite build --XeusAddon.environment_file=environment.yaml
|
|
|
65
66
|
|
|
66
67
|
#### Multiple kernels
|
|
67
68
|
|
|
68
|
-
To create a deployment with multiple kernels, you can
|
|
69
|
+
To create a deployment with multiple kernels, you can simply add them to the `environment.yaml` file:
|
|
69
70
|
|
|
70
71
|
```yaml
|
|
71
72
|
name: xeus-lite-wasm
|
|
@@ -81,11 +82,11 @@ dependencies:
|
|
|
81
82
|
|
|
82
83
|
### From local environment / prefix
|
|
83
84
|
|
|
84
|
-
When developing a xeus-kernel, it is very
|
|
85
|
+
When developing a xeus-kernel, it is very useful to be able to test it in JupyterLite without having to publish the kernel to emscripten-forge. Therefore, you can also use a local environment / prefix to build JupyterLite with a custom kernel.
|
|
85
86
|
|
|
86
87
|
#### Create a local environment / prefix
|
|
87
88
|
|
|
88
|
-
This workflow usually starts with creating a local conda environment / prefix for `emscripten-wasm32` with all the dependencies
|
|
89
|
+
This workflow usually starts with creating a local conda environment / prefix for the `emscripten-wasm32` platform with all the dependencies required to build your kernel (here we install dependencies for `xeus-python`).
|
|
89
90
|
|
|
90
91
|
```bash
|
|
91
92
|
micromamba create -n xeus-python-dev \
|
|
@@ -95,12 +96,12 @@ micromamba create -n xeus-python-dev \
|
|
|
95
96
|
--yes \
|
|
96
97
|
"python>=3.11" pybind11 nlohmann_json pybind11_json numpy pytest \
|
|
97
98
|
bzip2 sqlite zlib libffi xtl pyjs \
|
|
98
|
-
xeus xeus-
|
|
99
|
+
xeus xeus-lite
|
|
99
100
|
```
|
|
100
101
|
|
|
101
102
|
#### Build the kernel
|
|
102
103
|
|
|
103
|
-
This depends on your kernel but will look something like this:
|
|
104
|
+
This depends on your kernel, but it will look something like this:
|
|
104
105
|
|
|
105
106
|
```bash
|
|
106
107
|
# path to your emscripten emsdk
|
|
@@ -141,7 +142,7 @@ micromamba activate xeus-lite-host
|
|
|
141
142
|
python -m pip install jupyterlite-xeus
|
|
142
143
|
```
|
|
143
144
|
|
|
144
|
-
When running `jupyter lite build
|
|
145
|
+
When running `jupyter lite build`, we pass the `prefix` option and point it to the local environment / prefix we just created:
|
|
145
146
|
|
|
146
147
|
```bash
|
|
147
148
|
jupyter lite build --XeusAddon.prefix=$WASM_ENV_PREFIX
|
|
@@ -149,7 +150,7 @@ jupyter lite build --XeusAddon.prefix=$WASM_ENV_PREFIX
|
|
|
149
150
|
|
|
150
151
|
### Mounting additional files
|
|
151
152
|
|
|
152
|
-
To copy additional files and directories into the virtual
|
|
153
|
+
To copy additional files and directories into the virtual filesystem of the xeus-lite kernels you can use the `--XeusAddon.mount` option.
|
|
153
154
|
Each mount is specified as a pair of paths separated by a colon `:`. The first path is the path to the file or directory on the host machine, the second path is the path to the file or directory in the virtual filesystem of the kernel.
|
|
154
155
|
|
|
155
156
|
```bash
|
|
@@ -180,4 +181,4 @@ python -m pip install -e . -v --no-build-isolation
|
|
|
180
181
|
|
|
181
182
|
### Packaging the extension
|
|
182
183
|
|
|
183
|
-
See [RELEASE](RELEASE.md)
|
|
184
|
+
See [RELEASE](RELEASE.md).
|