Skip to content

Commit b9ba211

Browse files
committed
fix: Fixed yaml_list_adapter to avoid partial match of specifier
1 parent 2437e37 commit b9ba211

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

yaml_list_adapter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ def _change_specifier_logic(self, spec_with_text: str) -> tuple:
9999
ver_specifier, text = str_match # e.g. ('<', '1.20')
100100

101101
for old, new in (
102-
("<", ">="),
103-
(">", "<="),
104-
("<=", ">"),
105-
(">=", "<"),
106-
("!", "="),
107-
("~", "!"),
108102
("===", "==="), # not changed specifier for arbitrary equality defined by PEP440
109103
# (https://packaging.python.org/en/latest/specifications/version-specifiers/#arbitrary-equality)
104+
("<=", ">"),
105+
(">=", "<"),
110106
("==", "!="),
107+
("!=", "=="),
108+
("~=", "!="), # Handle compatible release
109+
("<", ">="),
110+
(">", "<="),
111111
):
112112
if old in ver_specifier:
113113
new_ver_spec = ver_specifier.replace(old, new)

0 commit comments

Comments
 (0)