File tree 1 file changed +19
-0
lines changed
Filter options
1 file changed +19
-0
lines changed
Original file line number Diff line number Diff line change 38
38
import logging
39
39
from importlib .metadata import version
40
40
41
+ from packaging .version import Version
42
+
41
43
import click
42
44
43
45
from jinja2 import Environment
@@ -539,6 +541,22 @@ def check_conda_lock_version():
539
541
)
540
542
541
543
544
+ def check_conda_version ():
545
+ # Avoid issues with glibc (https://github.com/conda/conda-lock/issues/292)
546
+ # or osx (https://github.com/conda/conda-lock/issues/408) virtual package.
547
+ # The glibc one has been fixed in conda 23.1.0 and the osx has been fixed
548
+ # in main and will be fixed when conda > 23.5.0 is released.
549
+ conda_info_output = execute_command (["conda" , "info" , "--json" ])
550
+
551
+ conda_info = json .loads (conda_info_output )
552
+ conda_version = Version (conda_info ["conda_version" ])
553
+
554
+ if Version ("22.9.0" ) < conda_version <= Version ("23.5.0" ):
555
+ raise RuntimeError (
556
+ f"conda version should be <= 22.9.0 or > 23.5.0, got: { conda_version } "
557
+ )
558
+
559
+
542
560
@click .command ()
543
561
@click .option (
544
562
"--select-build" ,
@@ -547,6 +565,7 @@ def check_conda_lock_version():
547
565
)
548
566
def main (select_build ):
549
567
check_conda_lock_version ()
568
+ check_conda_version ()
550
569
filtered_conda_build_metadata_list = [
551
570
each
552
571
for each in conda_build_metadata_list
You can’t perform that action at this time.
0 commit comments