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

Add dev mode command for micromamba shell init #2118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hind-M
Copy link
Member

@Hind-M Hind-M commented Nov 15, 2022

Following my experience in dev mode to activate an environment using a locally built micromamba, I added the working command in the displayed error message to hopefully make it clearer.

shell_hook_command
= "eval \"$(micromamba shell hook --shell=" + guessed_shell + ")\"";

shell_hook_dev_mode_cmd = "eval \"$(./micromamba/micromamba shell hook --shell="
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this path change depending on user? It's not uncommon to put it under build/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, I also don't need to run the hook again. Since the hook already uses the MAMBA_EXE variable, I can set export MAMBA_EXE="${PWD}/build/micromamba/micromamba. Or perhaps I'm missing something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this path change depending on user? It's not uncommon to put it under build/

If you are testing your built micromamba, I assumed you're in your build directory and so the path would be the same. But we could also make it ./build/micromamba/micromamba, maybe that would be clearer.

Copy link
Member Author

@Hind-M Hind-M Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, I also don't need to run the hook again. Since the hook already uses the MAMBA_EXE variable, I can set export MAMBA_EXE="${PWD}/build/micromamba/micromamba. Or perhaps I'm missing something.

Well I don't know, maybe I am missing something... Because I had this info from Johan and it didn't work for me... We should probably need to discuss this.

if (guessed_shell != "cmd.exe")
{
shell_hook = unindent((R"(

To initialize the current )"
+ guessed_shell + R"( shell, run:
$ )" + shell_hook_command
+ R"(
+ shell_hook_dev_mode + R"(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be shown to all (non-dev) users? If so I would suggest a better approach would be to put that information in the docs.

Copy link
Member Author

@Hind-M Hind-M Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be shown to all (non-dev) users?

Yes.

If so I would suggest a better approach would be to put that information in the docs.

Well I thought about it but since the problem occurred while trying to activate an env with the built micromamba, I had this message error (which wasn't solving the problem). So I think that having an error message with the right suggested command would really help because it's the first thing that I/someone would try (follow the suggestion, before searching in the docs), but that doesn't mean not putting it there as well.

@AntoinePrv
Copy link
Member

Thanks for publishing this @Hind-M. I also struggled with this at first, so this information should definitely go somewhere.

My personal preference would be to not show this message to end users, whether it is putting it in the doc, or deactivating it with some sort of flag (is there a debug flag in Context)?
Happy to get another pair of eyes on this.

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

Successfully merging this pull request may close these issues.

2 participants