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

fix: Improve message after the env creating with micromamba #2425

Merged
merged 4 commits into from
Mar 31, 2023

Conversation

xmnlab
Copy link
Contributor

@xmnlab xmnlab commented Mar 29, 2023

This PR aims to improve the message presented after the environment creation with micromamba.

Fix #2407

@xmnlab xmnlab force-pushed the add-message-for-activation branch from b2d8ef2 to de76d2d Compare March 29, 2023 17:52
@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 29, 2023

note: I made some changes in the environment files, and gitignore because it was something that popped-up locally .. let me know if it is ok to keep that changes, otherwise I am also glad to remove that here.

thanks!

@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 29, 2023

btw, I opened this PR in draft mode just to get some inputs/reviews in early stage ... I am checking now how to get the environment name to add it to the message.

but if anyone could give some tips it would be very appreciated :)

@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 29, 2023

just for the record, this is how the output looks like:

...
Linking wheel-0.40.0-pyhd8ed1ab_0
Linking setuptools-67.6.1-pyhd8ed1ab_0
Linking pip-23.0.1-pyhd8ed1ab_0

Transaction finished

To activate this environment, use:

    $ micromamba activate <placeholder>

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

    $ micromamba run -n <placeholder> mycommand

(mamba-dev) ✔ ~/dev/prefixdev-projects/mamba

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.

Thanks for the suggestion!

This files and the IO mechanism will go through a redesign.
I'm OK to add this with [micro]mamba and <environment> for now so that we know to add it in the refactoring.
Perhaps leave a comment //TODO add executable name TODO add environment name/prefix.

.gitignore Outdated
Comment on lines 32 to 36
libmamba/Makefile
libmamba/libmambaConfig.cmake
libmamba/libmambaConfigVersion.cmake
libmamba/libmambaTargets.cmake
sometestfile.txt
Copy link
Member

Choose a reason for hiding this comment

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

Let's leave this out o this PR. We do use cmake -B build/ to have the CMake generated files separate in the build/ direcrtory.
Then you can cmake --build build/ ...

@@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- cxx-compiler
- cmake
- cmake >=3.16
Copy link
Member

Choose a reason for hiding this comment

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

I'm OK with this, it's the one specified in CMakeLists.txt

Comment on lines 1087 to 1091
Console::stream() << "\nTransaction finished";
Console::stream() << "\nTo activate this environment, use:\n";
Console::stream() << " $ micromamba activate <placeholder>";
Console::stream() << "\nOr to execute a single command in this environment, use:\n";
Console::stream() << " $ micromamba run -n <placeholder> mycommand\n";
Copy link
Member

Choose a reason for hiding this comment

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

You can log that in a single string.

@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 30, 2023

thanks for the review @AntoinePrv , appreciate that!
I will apply all the suggestions soon! thanks

@xmnlab xmnlab force-pushed the add-message-for-activation branch from 5a5bbfb to 960dc5e Compare March 31, 2023 01:07
@xmnlab xmnlab marked this pull request as ready for review March 31, 2023 01:09
@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 31, 2023

@AntoinePrv, I already applied the changes you requested.
thank you so much for your review

@Hind-M
Copy link
Member

Hind-M commented Mar 31, 2023

Thanks for this PR!
To avoid the linters failure on the CI, you can run pre-commit run --all locally :)

@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 31, 2023

pre-commit run --all

oh nice! I missed that! thank you so much for the tip! I will install the pre-commit hooks here! thanks!

@AntoinePrv
Copy link
Member

AntoinePrv commented Mar 31, 2023

@xmnlab already done for you :)
Current CI failures seems unrelated.

@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 31, 2023

@AntoinePrv thank you so much! I will take a look into that in a bit :)

@xmnlab xmnlab force-pushed the add-message-for-activation branch from b99d5ce to 7845838 Compare March 31, 2023 13:29
@xmnlab
Copy link
Contributor Author

xmnlab commented Mar 31, 2023

@AntoinePrv thank you so much for your review! and all the help :)
I just rebased my branch in order to have the CI running with the last changes.

let me know if there is anything else I can do about this PR :)

thanks!

@AntoinePrv AntoinePrv force-pushed the add-message-for-activation branch from 7845838 to 5d71f6d Compare March 31, 2023 15:24
@AntoinePrv AntoinePrv merged commit a3597e3 into mamba-org:main Mar 31, 2023
Comment on lines +1090 to +1093
<< "To activate this environment, use:\n\n"
<< " $ [micro]mamba activate <environment>\n\n"
<< "Or to execute a single command in this environment, use:\n\n"
<< " $ [micro]mamba run -n <environment> mycommand\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

This message is being triggered in all transactions, install, update, etc, and not only environment creation. It is a bit noisy that way b/c for most of those the user is already in the environment and defeats the purposes of the message.

PS: It would be nice to change the <environment> for the actual name of the environment, mimicking conda's behavior and making the message "copy-n-pastable."

Copy link
Member

Choose a reason for hiding this comment

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

This message is being triggered in all transactions, install, update, etc, and not only environment creation. It is a bit noisy that way b/c for most of those the user is already in the environment and defeats the purposes of the message.

Hmm I agree!

PS: It would be nice to change the <environment> for the actual name of the environment, mimicking conda's behavior and making the message "copy-n-pastable."

It's already the case on the last version of the code :)

Copy link
Contributor

Choose a reason for hiding this comment

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

It's already the case on the last version of the code :)

Awesome. Waiting for the new release.

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.

Micromamba create env doesn't show the message about how to activate the environment
4 participants