From 1c64798e7170941ecd9e9c70fb9546abfde11a57 Mon Sep 17 00:00:00 2001 From: James Frost Date: Mon, 5 Feb 2024 12:59:02 +0000 Subject: [PATCH 1/2] Increase minimum ensureconda version for py3.12 compatibility Prior to ensureconda v1.4.4 distutils is used, which was removed in python 3.12. This prevents conda-lock running under python newer than 3.11, so the minimum version of ensureconda is increased. Fixes https://github.com/conda/conda-lock/issues/542 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 52316733..cb87a06d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ # conda-lock dependencies "click >=8.0", "click-default-group", - "ensureconda >=1.3", + "ensureconda >=1.4.4", "gitpython >=3.1.30", "jinja2", "pydantic >=1.10", From b86ec4361e1cef676b3caaa4fcaaa056751bdd22 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Mon, 5 Feb 2024 14:17:41 +0100 Subject: [PATCH 2/2] =?UTF-8?q?LooseVersion=20=E2=86=92=20Version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conda_lock/invoke_conda.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda_lock/invoke_conda.py b/conda_lock/invoke_conda.py index 692ac4e4..941f8071 100644 --- a/conda_lock/invoke_conda.py +++ b/conda_lock/invoke_conda.py @@ -8,10 +8,10 @@ import tempfile import threading -from distutils.version import LooseVersion from typing import IO, Dict, Iterator, List, Optional, Sequence, Union from ensureconda.api import determine_micromamba_version, ensureconda +from packaging.version import Version from conda_lock.models.channel import Channel @@ -57,7 +57,7 @@ def determine_conda_executable( for candidate in _determine_conda_executable(conda_executable, mamba, micromamba): if candidate is not None: if is_micromamba(candidate): - if determine_micromamba_version(str(candidate)) < LooseVersion("0.17"): + if determine_micromamba_version(str(candidate)) < Version("0.17"): mamba_root_prefix() return candidate raise RuntimeError("Could not find conda (or compatible) executable")