|
| 1 | +[project] |
| 2 | +name = "xeus-me" |
| 3 | +version = "0.1.0" |
| 4 | +description = "Setup a pixi environment for building a jupyterlite app with WASM" |
| 5 | +authors = ["bugsbunny88 <bugs@bunny>"] |
| 6 | +platforms = ["emscripten-wasm32", "osx-arm64", "osx-64", "linux-64"] # Windows is not working yet: "win-64"] |
| 7 | +channels = ["conda-forge"] |
| 8 | + |
| 9 | +[feature.wasm] |
| 10 | +# add the emscripten-forge channel to the list of channels |
| 11 | +channels = ["https://repo.mamba.pm/emscripten-forge"] |
| 12 | +platforms = ["emscripten-wasm32"] |
| 13 | + |
| 14 | +[feature.wasm.dependencies] |
| 15 | +# we always need the xeus-python kernel for jupyterlite |
| 16 | +xeus-python = "*" |
| 17 | +python = "*" |
| 18 | +# add any extra packages from emscripten-forge here |
| 19 | +matplotlib = "*" |
| 20 | + |
| 21 | +[feature.host] |
| 22 | +channels = ["conda-forge"] |
| 23 | +platforms = ["osx-arm64", "osx-64", "linux-64"] |
| 24 | +dependencies = { python = "*", jupyterlite-xeus = "*", jupyter_server = "*" } |
| 25 | + |
| 26 | +# make sure that we have the WASM environment installed before building the app |
| 27 | +[feature.host.tasks] |
| 28 | +setup-wasm = { cmd = "pixi install -e wasm", inputs = ["pixi.lock"] } |
| 29 | +build-dist = { cmd = "pixi run build --output-dir dist" } |
| 30 | + |
| 31 | +# build the jupyterlite app |
| 32 | +[feature.host.tasks.build] |
| 33 | +cmd = "jupyter lite build --XeusAddon.prefix=.pixi/envs/wasm" |
| 34 | +depends-on = ["setup-wasm"] |
| 35 | +outputs = ["_output"] |
| 36 | +inputs = ["pixi.lock", "files/"] |
| 37 | + |
| 38 | +# serve the jupyterlite app with a "simple server" |
| 39 | +[feature.host.tasks.start] |
| 40 | +cmd = "python -m http.server 8000 -d _output" |
| 41 | +depends-on = ["build"] |
| 42 | + |
| 43 | +[environments] |
| 44 | +default = ["host"] |
| 45 | +wasm = ["wasm"] |
0 commit comments