From bb6b2d1ab53b3d5341b35c3bd3da9ad4e8b623b0 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Fri, 13 Dec 2024 15:06:32 +0100 Subject: [PATCH] Add environment variables for conda/mamba/micromamba --- conda_lock/conda_lock.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/conda_lock/conda_lock.py b/conda_lock/conda_lock.py index baf7658f..a29a6e20 100644 --- a/conda_lock/conda_lock.py +++ b/conda_lock/conda_lock.py @@ -1193,17 +1193,22 @@ def main() -> None: @main.command("lock", context_settings={"show_default": True}) @click.option( - "--conda", default=None, help="path (or name) of the conda/mamba executable to use." + "--conda", + default=None, + help="path (or name) of the conda/mamba executable to use.", + envvar="CONDA_LOCK_CONDA", ) @click.option( "--mamba/--no-mamba", default=HAVE_MAMBA, help="don't attempt to use or install mamba.", + envvar="CONDA_LOCK_MAMBA", ) @click.option( "--micromamba/--no-micromamba", default=False, help="don't attempt to use or install micromamba.", + envvar="CONDA_LOCK_MICROMAMBA", ) @click.option( "-p", @@ -1453,17 +1458,22 @@ def lock( @main.command("install", context_settings={"show_default": True}) @click.option( - "--conda", default=None, help="path (or name) of the conda/mamba executable to use." + "--conda", + default=None, + help="path (or name) of the conda/mamba executable to use.", + envvar="CONDA_LOCK_CONDA", ) @click.option( "--mamba/--no-mamba", default=DEFAULT_INSTALL_OPT_MAMBA, help="don't attempt to use or install mamba.", + envvar="CONDA_LOCK_MAMBA", ) @click.option( "--micromamba/--no-micromamba", default=DEFAULT_INSTALL_OPT_MICROMAMBA, help="don't attempt to use or install micromamba.", + envvar="CONDA_LOCK_MICROMAMBA", ) @click.option( "--copy",