File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1096,6 +1096,8 @@ def has_c() -> bool:
10961096
10971097
10981098class Version (tuple ):
1099+ """A class that can be used to compare version strings."""
1100+
10991101 def __new__ (cls , * version ):
11001102 padded_version = cls ._padded (version , 4 )
11011103 return super ().__new__ (cls , tuple (padded_version ))
@@ -1161,8 +1163,12 @@ def __str__(self):
11611163
11621164def check_for_min_version (package_version : str , package_name : str ) -> tuple [str , bool ]:
11631165 package_version = Version .from_string (package_version )
1164- requirement = (
1165- [i for i in requires ("pymongo" ) if i .startswith (package_name )].next ().split (";" ).next ()
1166- )
1166+ # Dependency is expected to be in one of the forms:
1167+ # "pymongocrypt<2.0.0,>=1.13.0; extra == 'encryption'"
1168+ # 'dnspython<3.0.0,>=1.16.0'
1169+ #
1170+ requirement = [i for i in requires ("pymongo" ) if i .startswith (package_name )][0 ] # noqa: RUF015
1171+ if ";" in requirement :
1172+ requirement = requirement .split (";" )[0 ]
11671173 required_version = requirement [requirement .find (">=" ) + 2 :]
11681174 return required_version , package_version > Version .from_string (required_version )
You can’t perform that action at this time.
0 commit comments