From d88b76d9fb911b3abbe4fc5f3ae8c63ec3e74efc Mon Sep 17 00:00:00 2001 From: Michael Cormier Date: Wed, 30 Sep 2020 11:40:50 -0600 Subject: [PATCH] Update prefix base tracking --- ggd/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ggd/utils.py b/ggd/utils.py index 0e71f46..c9104c2 100644 --- a/ggd/utils.py +++ b/ggd/utils.py @@ -703,9 +703,6 @@ def prefix_in_conda(prefix): env_var_names[name] = env_path.rstrip("/") env_var_paths[env_path.rstrip("/")] = name - ## Get the base/first conda environment - cbase = min(env_var_paths.keys()) - prefix = prefix.rstrip("/") ## Check that the file is in the environment lists @@ -715,6 +712,9 @@ def prefix_in_conda(prefix): ## Get the prefix path dd prefix_path = get_conda_prefix_path(prefix) + ## Get the base/first conda environment for all environments that are subdirs of the specified prefix + cbase = min([x for x in env_var_paths.keys() if x in prefix_path]) + ## Check that the file path includes the conda base directory if cbase not in prefix_path: raise CondaEnvironmentNotFound(prefix)