Skip to content

Commit fc245cf

Browse files
committed
Support additional kernel packages
1 parent 77dce75 commit fc245cf

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,15 @@ npm run start:bash # Open a bash shell in the container
6161
#.env file
6262
JUPYTERLITE_EXTERNAL_MY_CUSTOM_EXTENSION=../demo/my-custom-ext
6363
```
64+
65+
- To install additional packages to the kernel enviromnent, create `jupyterlite/environment.yml` file with following content:
66+
67+
```yaml
68+
name: xeus-build-wasm
69+
channels:
70+
- https://repo.mamba.pm/emscripten-forge
71+
- conda-forge
72+
dependencies:
73+
- package-1
74+
- package-2
75+
```

script/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -e
23

34
echo "############## INSTALLING EMPACK ##############"
45
cd /home/$MAMBA_USER/empack
@@ -43,5 +44,8 @@ cd /home/$MAMBA_USER/xeus
4344
rm -fr tsconfig.tsbuildinfo
4445
python -m pip install -e . -v --no-build-isolation
4546
cd $LITE_DIR
47+
if [ -f ./environment.yml ]; then
48+
micromamba install -n $WASM_BUILD_ENV --platform=emscripten-wasm32 -f ./environment.yml --yes
49+
fi
4650
rm -fr _output .jupyterlite.doit.db
4751
jupyter lite build --XeusAddon.prefix=$PREFIX --XeusAddon.mounts=$PREFIX/lib/python3.11/site-packages/pyjs:/lib/python3.11/site-packages/pyjs

script/wasm-env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- pybind11_json
1111
- bzip2
1212
- zlib
13+
- zstd
1314
- sqlite
1415
- libffi
1516
- exceptiongroup
@@ -19,4 +20,3 @@ dependencies:
1920
- requests-wasm-polyfill>=0.3.0
2021
- libpython
2122
- numpy
22-

0 commit comments

Comments
 (0)