Skip to content

Commit

Permalink
strip double equals from conda version strings as unsupported by some…
Browse files Browse the repository at this point in the history
… micromamba versions (#2201)
  • Loading branch information
saikonen authored Jan 8, 2025
1 parent aa03edb commit defd38b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion metaflow/plugins/pypi/micromamba.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import functools
import json
import os
import re
import subprocess
import tempfile
import time
Expand All @@ -23,6 +24,8 @@ def __init__(self, error):

GLIBC_VERSION = os.environ.get("CONDA_OVERRIDE_GLIBC", "2.38")

_double_equal_match = re.compile("==(?=[<=>!~])")


class Micromamba(object):
def __init__(self, logger=None):
Expand Down Expand Up @@ -101,7 +104,8 @@ def solve(self, id_, packages, python, platform):
cmd.append("--channel=%s" % channel)

for package, version in packages.items():
cmd.append("%s==%s" % (package, version))
version_string = "%s==%s" % (package, version)
cmd.append(_double_equal_match.sub("", version_string))
if python:
cmd.append("python==%s" % python)
# TODO: Ensure a human readable message is returned when the environment
Expand Down

0 comments on commit defd38b

Please sign in to comment.