mounts as lists where better..
Opened this issue · 1 comments
DerThorsten commented
I believe mounts as a List
where better than comma-separated strings.
with lists I could do the following for three relatively long mounts
jupyter lite build \
--XeusAddon.prefix=$XEUS_PYTHON_WASM_ENV_PREFIX
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/python3.11/site-packages/nxtgm:/lib/python3.11/site-packages/nxtgm"
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/nxtgm/__extra__/:/lib/"
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/nxtgm/plugins:/lib/nxtgm/plugins"
With the comma separated this looks like the follwoing (horrible)
jupyter lite build \
--XeusAddon.prefix=$XEUS_PYTHON_WASM_ENV_PREFIX
--XeusAddon.mounts="$WASM_ENV_PREFIX/lib/python3.11/site-packages/nxtgm:/lib/python3.11/site-packages/nxtgm,XeusAddon.mounts="$WASM_ENV_PREFIX/lib/nxtgm/__extra__/:/lib/,$WASM_ENV_PREFIX/lib/nxtgm/plugins:/lib/nxtgm/plugins"
So to make this somewhat sane with the comma-separated list I have to introduce some variables
and call it with the variables.
MOUNT_PYTHON_PKG="$WASM_ENV_PREFIX/lib/python3.11/site-packages/nxtgm:/lib/python3.11/site-packages/nxtgm"
MOUNT_LIBNXTGM="$WASM_ENV_PREFIX/lib/nxtgm/__extra__/:/lib/"
MOUNT_NXTGM_PLUGINS="$WASM_ENV_PREFIX/lib/nxtgm/plugins:/lib/nxtgm/plugins"
# jupyterlite
jupyter lite build \
--XeusAddon.prefix=$XEUS_PYTHON_WASM_ENV_PREFIX \
--XeusAddon.mounts=$MOUNT_PYTHON_PKG,$MOUNT_LIBNXTGM,$MOUNT_NXTGM_PLUGINS
I suggest using a list of strings, and each entry can be comma-separated.
That way we get the best of both worlds
martinRenou commented
Sounds good to me!