diff --git a/.actions/setup_tools.py b/.actions/setup_tools.py index 9aab03d1d6..a8c00e7975 100644 --- a/.actions/setup_tools.py +++ b/.actions/setup_tools.py @@ -54,11 +54,11 @@ def _augment_requirement(ln: str, comment_char: str = "#", unfreeze: str = "all" Returns: adjusted requirement - >>> _augment_requirement("arrow>=1.2.0, <=1.2.2 # anything", unfreeze="") - 'arrow>=1.2.0, <=1.2.2' - >>> _augment_requirement("arrow>=1.2.0, <=1.2.2 # strict", unfreeze="") - 'arrow>=1.2.0, <=1.2.2 # strict' - >>> _augment_requirement("arrow>=1.2.0, <=1.2.2 # my name", unfreeze="all") + >>> _augment_requirement("arrow<=1.2.2,>=1.2.0 # anything", unfreeze="") + 'arrow<=1.2.2,>=1.2.0' + >>> _augment_requirement("arrow<=1.2.2,>=1.2.0 # strict", unfreeze="") + 'arrow<=1.2.2,>=1.2.0 # strict' + >>> _augment_requirement("arrow<=1.2.2,>=1.2.0 # my name", unfreeze="all") 'arrow>=1.2.0' >>> _augment_requirement("arrow>=1.2.0, <=1.2.2 # strict", unfreeze="all") 'arrow>=1.2.0, <=1.2.2 # strict' @@ -94,7 +94,7 @@ def _augment_requirement(ln: str, comment_char: str = "#", unfreeze: str = "all" # remove version restrictions unless they are strict if unfreeze and "<" in req and not is_strict: - req = re.sub(r",? *<=? *[\d\.\*]+", "", req).strip() + req = re.sub(r",? *<=? *[\d\.\*]+,? *", "", req).strip() if ver_major is not None and not is_strict: # add , only if there are already some versions req += f"{',' if any(c in req for c in '<=>') else ''} <{int(ver_major) + 1}.0"