Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jtpio opened this issue Feb 20, 2024 · 7 comments
Open

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

jtpio opened this issue Feb 20, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@jtpio
Copy link
Member

jtpio commented Feb 20, 2024

Problem

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

# open the env yaml file if it's provided
if env_file.exists():
with open(env_file, "r") as file:
yaml_content = yaml.safe_load(file)
env_name = yaml_content.get("name", "xeus-env")
env_prefix = root_prefix / "envs" / env_name
self.prefix = str(env_prefix)
create_conda_env_from_env_file(root_prefix, yaml_content, env_file.parent)
else:
create_conda_env_from_specs(
env_name=env_name,
root_prefix=root_prefix,
specs=["xeus-python"],
channels=["https://repo.mamba.pm/emscripten-forge", "conda-forge"],
)

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: jupyterlite/repo2jupyterlite#19

@martinRenou
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

jtpio commented Feb 20, 2024

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
Copy link
Member Author

jtpio commented Feb 20, 2024

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

jtpio commented Feb 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants