jupyterlite / xeus

JupyterLite loader for Xeus kernels
https://jupyterlite-xeus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

Automatically add the `emscripten-forge` channel if it is missing? #76

Open jtpio opened 6 months ago

jtpio commented 6 months ago

Problem

Currently the default channels are only added if there is no environment file:

https://github.com/jupyterlite/xeus/blob/eda12f8c2e50bd7ca4b171e38492de652a678cb4/jupyterlite_xeus/add_on.py#L130-L147

Proposed Solution

Maybe the add-on should check if the user-provided environment.yml includes https://repo.mamba.pm/emscripten-forge in the list of channels, and add it automatically otherwise?

Additional context

This could help improving compatibility with existing environment.yml files without having to create a copy of the file with https://repo.mamba.pm/emscripten-forge in it.

And also for use cases such as repo2jupyterlite: https://github.com/jupyterlite/repo2jupyterlite/pull/19

martinRenou commented 6 months ago

I don't think we should add https://repo.mamba.pm/emscripten-forge automagically if it's not there.

People should be free to use any channel they want (if they mirror emscripten-forge or provide their own channel with emscripten packages).

martinRenou commented 6 months ago

If no channel is specified, it's used by default though: https://github.com/jupyterlite/xeus/blob/main/jupyterlite_xeus/create_conda_env.py#L47

jtpio commented 6 months ago

Ah ok, I thought we used to have something like this in jupyterlite-xeus-python. But maybe because it was always installing xeus-python by default.

jtpio commented 6 months ago

If no channel is specified, it's used by default though: https://github.com/jupyterlite/xeus/blob/main/jupyterlite_xeus/create_conda_env.py#L47

Could it make sense to also do this if only the conda-forge channel is specified? I guess this could address most use cases.

martinRenou commented 6 months ago

Could it make sense to also do this if only the conda-forge channel is specified? I guess this could address most use cases

I see, yeah that could make sense!

martinRenou commented 6 months ago

Could it make sense to also do this if only the conda-forge channel is specified? I guess this could address most use cases.

Let's put this behind an optional flag though, as we probably should not change the environment file without the user knowing.

jtpio commented 6 months ago

Let's put this behind an optional flag though, as we probably should not change the environment file without the user knowing.

That sounds good, and would at least help experiment with that without too much disruption.

Projects like https://github.com/jupyterlite/repo2jupyterlite could then enable that option by default.