-
Notifications
You must be signed in to change notification settings - Fork 381
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: Adapt root prefix' precedence for envs_dirs
#3813
base: main
Are you sure you want to change the base?
Conversation
This adds the case to simulate what happens when ${MAMBA_ROOT_PREFIX}/envs already exists.
envs_dirs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, @holzman!
Ok, I think I've addressed all of the issues, thanks for being so patient! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @holzman!
I just have a couple of nitpicks but apart from them, the test covers all the cases.
I would wait for another approval from someone in the team before merging this contribution.
if set_in_condarc: | ||
f.write(f"envs_dirs: [{str(condarc_envs_dirs)}]") | ||
|
||
for envs_folder in (condarc_envs_dirs, conda_envs_dirs, cli_provided_root, mamba_root_prefix): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for envs_folder in (condarc_envs_dirs, conda_envs_dirs, cli_provided_root, mamba_root_prefix): | |
# TODO: Remove those calls to `os.makedirs` once | |
# https://github.com/mamba-org/mamba/issues/3790 is fixed | |
for envs_folder in (condarc_envs_dirs, conda_envs_dirs, cli_provided_root, mamba_root_prefix): |
Ok, I've added one more commit to address the nits. (Now I'm off to write a better test for #3796). |
Adds a new test and fixes #3806. With this PR it now has the desired behavior:
One note - in order for this approach to work, I needed to ensure that the minimum vector size for configuration items was 1 so that
--print-config
didn't crash. (Alternatively I could change the print-config code to ignore a zero-size vector, but this seemed like a more robust approach).