diff --git a/asv/plugins/mamba.py b/asv/plugins/mamba.py index 8e0be1b7b..8fd29cfc7 100644 --- a/asv/plugins/mamba.py +++ b/asv/plugins/mamba.py @@ -12,13 +12,20 @@ except ImportError: from yaml import Loader -import libmambapy - -from ._mamba_helpers import MambaSolver from .. import environment, util from ..console import log -WIN = os.name == "nt" + +from importlib_metadata import version as get_version +import libmambapy + +if int(get_version(libmambapy).split(".")[0]) <= 2: + raise environment.EnvironmentUnavailable( + f"libmambapy must be less than 2.0, but got {get_version('libmambapy')}" + ) + + +from ._mamba_helpers import MambaSolver # Like Conda, Mamba also needs to be serialized util.new_multiprocessing_lock("mamba_lock")