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

Improve micromamba transaction message #2474

Merged

Conversation

ruben-arts
Copy link
Contributor

@ruben-arts ruben-arts commented Apr 19, 2023

Before:

Transaction finished

To activate this environment, use:

    $ [micro]mamba activate <environment>

Or to execute a single command in this environment, use:

    $ [micro]mamba run -n <environment> mycommand

Examples of the result now:

$ time ./build/micromamba/micromamba create -c conda-forge --yes -n test python

# results in

Transaction finished

To activate this environment, use:

    micromamba activate test

Or to execute a single command in this environment, use:

    micromamba run -n test mycommand
    

$ time ./micromamba create -c conda-forge --yes -p ~/testing python

# results in, note the -p or -n

Transaction finished

To activate this environment, use:

   micromamba activate /home/rarts/testing

Or to execute a single command in this environment, use:

    micromamba run -p /home/rarts/testing mycommand

Notable improvements:

  • If is_micromamba is true micromamba will be used as the executable
  • Use no $ to make the line double click + copy + paste.
  • Use -p when using prefix, use -n for a named env.

Comment on lines 1093 to 1095
std::istringstream iss(ctx.command_params.current_command);
std::string executable;
std::getline(iss, executable, ' ');
Copy link
Member

Choose a reason for hiding this comment

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

Could this be a method of the command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not be needed anymore.

Copy link
Member

@AntoinePrv AntoinePrv left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@wolfv
Copy link
Member

wolfv commented Apr 19, 2023

Unfortunately the executable won't work for activate because the activation is actually implemented on the shell level. So it has to be micromamba activate ....

@AntoinePrv
Copy link
Member

So maybe you can switch with ctx.is_micromamba?

@ruben-arts
Copy link
Contributor Author

Unfortunately the executable won't work for activate because the activation is actually implemented on the shell level. So it has to be micromamba activate ....

Should we keep the run with the executable or keep the also move that to micromamba?

@wolfv
Copy link
Member

wolfv commented Apr 19, 2023

I think the executable path can be long and weird so maybe just micromamba is better

@ruben-arts
Copy link
Contributor Author

@wolfv @AntoinePrv I updated the PR, pretty sad that the executable thingy didn't work... But it should work in normal situations now!

Copy link
Member

@Hind-M Hind-M left a comment

Choose a reason for hiding this comment

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

Thanks!

@Hind-M Hind-M merged commit b6b04e1 into mamba-org:main Apr 25, 2023
20 checks passed
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.

None yet

4 participants