xeus icon indicating copy to clipboard operation
xeus copied to clipboard

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

Open jtpio opened this issue 1 year ago • 7 comments

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

jtpio avatar Feb 20 '24 11:02 jtpio

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 avatar Feb 20 '24 12:02 martinRenou

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

martinRenou avatar Feb 20 '24 12:02 martinRenou

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 avatar Feb 20 '24 14:02 jtpio

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.

jtpio avatar Feb 20 '24 14:02 jtpio

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 avatar Feb 21 '24 08:02 martinRenou

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.

martinRenou avatar Feb 23 '24 09:02 martinRenou

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.

jtpio avatar Feb 23 '24 12:02 jtpio