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

Clarify wording for running conda init #713

Merged
merged 8 commits into from
Sep 4, 2023
Merged
15 changes: 8 additions & 7 deletions constructor/header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,14 @@ if [ "$BATCH" = "0" ]; then
#if has_conda and initialize_conda is True
# Interactive mode.

printf "Do you wish the installer to initialize %s\\n" "${INSTALLER_NAME}"
printf "by running conda init? [yes|no]\\n"
printf "Do you wish to update your shell profile to automatically initialize conda?\\n"
printf "This will activate conda on startup and change the command prompt when activated.\\n"
printf "If you'd prefer that conda's base environment not be activated on startup,\\n"
printf " run the following command when conda is activated:\\n"
printf "\\n"
printf "conda config --set auto_activate_base false\\n"
printf "\\n"
printf "You can undo this by running \`conda init --reverse \$SHELL\`? [yes|no]\\n"
printf "[%s] >>> " "$DEFAULT"
read -r ans
if [ "$ans" = "" ]; then
Expand Down Expand Up @@ -578,11 +584,6 @@ if [ "$BATCH" = "0" ]; then
esac
fi
fi
printf "If you'd prefer that conda's base environment not be activated on startup, \\n"
printf " set the auto_activate_base parameter to false: \\n"
printf "\\n"
printf "conda config --set auto_activate_base false\\n"
printf "\\n"
#endif

printf "Thank you for installing %s!\\n" "${INSTALLER_NAME}"
Expand Down
11 changes: 7 additions & 4 deletions constructor/osxpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,13 @@ def modify_xml(xml_path, info):
'initialize_by_default', True) else 'false')
path_choice.set('title', "Add conda initialization to the shell")
path_description = """
If this box is checked, "conda init" will be executed to ensure that
conda is available in your preferred shell upon startup. If unchecked,
you must this initialization yourself or activate the environment
manually for each shell in which you wish to use it."""
If this box is checked, conda will be automatically activated in your
preferred shell on startup. This will change the command prompt when
activated. If your prefer that conda's base environment not be activated
on startup, run `conda config --set auto_activate_base false`. You can
undo this by running `conda init --reverse ${SHELL}`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is ${SHELL} expected to be defined here or is it just a placeholder? I am assuming that it will be rendered in the SH installers but I am not sure about the PKGs. If it's meant to be a placeholder, that's ok too, just wanted to make sure it was not an oversight.

Copy link
Contributor Author

@marcoesters marcoesters Aug 31, 2023

Choose a reason for hiding this comment

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

I expect this to be a literal ${SHELL}, not the rendered version. In the sh installers, I escaped the $ sign so that it doesn't get rendered.

If unchecked, you must this initialization yourself or activate the
environment manually for each shell in which you wish to use it."""
path_choice.set('description', ' '.join(path_description.split()))
elif ident.endswith('cacheclean'):
path_choice.set('visible', 'true')
Expand Down
19 changes: 19 additions & 0 deletions news/713-update-conda-init-wording
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* Clarify consequences for when `conda init` is run during the installation. (#713)