From 017daf3adfe7915831f9cc4f649fd1fae34a9c65 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sat, 23 Nov 2024 17:07:23 +0000 Subject: [PATCH] MAINT: Sanity check for libmambapy --- asv/plugins/mamba.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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")