Skip to content

Commit 78cd97f

Browse files
authored
fix: add support for version format x.x.x,<y in get_min_version (#1141)
Per PEP 440 https://peps.python.org/pep-0440/#version-specifiers
1 parent 4bab0a5 commit 78cd97f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/scripts/get_min_versions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ def get_min_version(version: str) -> str:
3131
assert parse_version(_min) < parse_version(_max)
3232
return _min
3333

34+
# case x.x.x,<y
35+
_match = re.match(f"^({vstring}),<({vstring})$", version)
36+
if _match:
37+
_min = _match.group(1)
38+
_max = _match.group(2)
39+
assert parse_version(_min) < parse_version(_max)
40+
return _min
41+
3442
# case x.x.x
3543
_match = re.match(f"^({vstring})$", version)
3644
if _match:

0 commit comments

Comments
 (0)