Skip to content

Activate default environment instead of base environment#414

Merged
jaimergp merged 16 commits intoconda-incubator:mainfrom
marcoesters:default-env-condarc
Oct 23, 2025
Merged

Activate default environment instead of base environment#414
jaimergp merged 16 commits intoconda-incubator:mainfrom
marcoesters:default-env-condarc

Conversation

@marcoesters
Copy link
Contributor

conda has replaced auto_activate_base with auto_activate to allow for setting default environments to different environments than the base environment.

On Windows, however, the base environment is hard-coded as the primary activation environment, overriding default environment settings. Additionally, other environments are only activated when they are not the base environment, which would make it impossible to activate the base environment if a default environment is set in a .condarc file.

The action's input options also still reflect the old language in conda. auto-update-base should be deprecated in favor of auto-update.

Summary of changes

  • Deprecate auto-activate-base input parameter and replace with auto-activate.
  • Remove warnings for using auto_activate_base the option depends on the conda version and is thus not actionable by the user.
  • Activate the default environment on Windows instead of the base environment.
  • isValidActivate now checks if the target environment is the default environment.
  • Replace hard-coded paths to Miniconda for Windows shell scripts with the actual path to the base environment.

@marcoesters marcoesters marked this pull request as ready for review September 10, 2025 20:49
@marcoesters marcoesters requested a review from a team as a code owner September 10, 2025 20:49
src/conda.ts Outdated
)) as string;
const config = JSON.parse(configsOutput) as types.ICondaConfig;
if (config.default_activation_env) {
return config.default_activation_env === envName;
Copy link
Member

Choose a reason for hiding this comment

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

Can this be also a full path instead of a name? And, in that case, do you need to resolve the paths?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In principle, you can use a full path, even though it seems unlikely that an installer would use a full path in the config file (even though it could be used as a function input). I added some path expansion logic, but testing all possible combinations here would quickly result in a lot of CI time being used.

I think we need to create an issue to start unit testing our functions with jest.

Copy link
Member

Choose a reason for hiding this comment

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

I think we need to create an issue to start unit testing our functions with jest.

Let's do that

@marcoesters marcoesters requested a review from jaimergp October 20, 2025 20:37
@jaimergp jaimergp merged commit 3afdf12 into conda-incubator:main Oct 23, 2025
101 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.

2 participants