Skip to content

Commit 20b0959

Browse files
authored
Merge pull request #52 from TG1999/github_native/add_comparator
Change equal comparator for github native ranges
2 parents 7b1bf07 + 7cb6448 commit 20b0959

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/univers/version_range.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,8 @@ def from_native(cls, string):
900900

901901

902902
vers_by_github_native_comparators = {
903-
"==": "=",
903+
"=": "=",
904+
"!=": "!=",
904905
"<=": "<=",
905906
">=": ">=",
906907
"<": "<",
@@ -917,6 +918,8 @@ def build_constraint_from_github_advisory_string(scheme: str, string: str):
917918
>>> assert str(vr) == "<=2.24", str(vr)
918919
>>> vr = build_constraint_from_github_advisory_string("pypi","< 9.0")
919920
>>> assert str(vr) == "<9.0", str(vr)
921+
>>> vr = build_constraint_from_github_advisory_string("pypi","= 9.0")
922+
>>> assert str(vr) == "9.0", str(vr)
920923
"""
921924
vrc = RANGE_CLASS_BY_SCHEMES[scheme]
922925
comparator, version = split_req(
@@ -947,6 +950,8 @@ def build_range_from_github_advisory_constraint(scheme: str, string: str):
947950
>>> assert str(vr) == "vers:gem/>=2.13.0|<2.16.0"
948951
>>> vr = build_range_from_github_advisory_constraint("pypi","< 9.0")
949952
>>> assert str(vr) == "vers:pypi/<9.0"
953+
>>> vr = build_range_from_github_advisory_constraint("pypi","= 9.0")
954+
>>> assert str(vr) == "vers:pypi/9.0"
950955
"""
951956
constraint_strings = string.split(",")
952957
constraints = []

0 commit comments

Comments
 (0)