From 6639d1ba0a4aab6d69cef28d1ff280cac2a2b679 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Mon, 25 Sep 2023 17:26:33 +0200 Subject: [PATCH] only apply defaults::x workaround when default_channels is not customized --- conda_libmamba_solver/solver.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/conda_libmamba_solver/solver.py b/conda_libmamba_solver/solver.py index eb85c8e3..ccfa8353 100644 --- a/conda_libmamba_solver/solver.py +++ b/conda_libmamba_solver/solver.py @@ -20,7 +20,13 @@ import libmambapy as api from boltons.setutils import IndexedSet from conda import __version__ as _conda_version -from conda.base.constants import REPODATA_FN, UNKNOWN_CHANNEL, ChannelPriority, on_win +from conda.base.constants import ( + DEFAULT_CHANNELS, + REPODATA_FN, + UNKNOWN_CHANNEL, + ChannelPriority, + on_win, +) from conda.base.context import context from conda.common.constants import NULL from conda.common.io import Spinner, timeout @@ -921,7 +927,10 @@ def _check_spec_compat(self, match_spec: Union[MatchSpec, None]) -> Union[MatchS f"You can only use {supported}, but you tried to use " f"{tuple(unsupported_but_set)}.", ) - if match_spec.get_raw_value("channel") == "defaults": + if ( + match_spec.get_raw_value("channel") == "defaults" + and context.default_channels == DEFAULT_CHANNELS + ): # !!! Temporary !!! # Apply workaround for defaults::pkg-name specs. # We need to replace it with the actual channel name (main, msys2, r)