@@ -44,7 +44,7 @@ def wrapper(self: "Spec", other: SpecComparable) -> bool:
4444 if not isinstance (other , comparable_types ):
4545 return NotImplemented
4646 # For compatible types, convert them to Version instance:
47- if isinstance (other , String .__args__ ): # type: ignore
47+ if isinstance (other , String .__args__ ): # type: ignore
4848 other = Version .parse (cast (String , other ))
4949 if isinstance (other , dict ):
5050 other = Version (** other )
@@ -129,8 +129,7 @@ class however, only ``*`` is used regardless what you used before.
129129 """
130130
131131 _regex = re .compile (
132- rf"{ _operator_regex_str } ?\s*{ _version_regex_str } " ,
133- re .VERBOSE | re .IGNORECASE
132+ rf"{ _operator_regex_str } ?\s*{ _version_regex_str } " , re .VERBOSE | re .IGNORECASE
134133 )
135134
136135 _regex_version_any = re .compile (_version_any , re .VERBOSE | re .IGNORECASE )
@@ -200,7 +199,7 @@ def __init__(self, spec: Union[str, bytes]) -> None:
200199 ]
201200
202201 # This is the special case for 1 -> 1.0.0
203- if ( minor is None and patch is None ) :
202+ if minor is None and patch is None :
204203 self .real_version_tuple [1 :3 ] = (0 , 0 )
205204 elif (minor not in placeholders ) and (patch is None ):
206205 self .real_version_tuple [2 ] = 0
@@ -309,61 +308,55 @@ def __eq__(self, other: SpecComparable) -> bool: # type: ignore
309308 """self == other."""
310309 # Find the position of the first "*"
311310 index = self .__get_index ()
312- version = tuple ([
313- int (cast (int , item ))
314- for item in self .real_version_tuple [:index ]
315- ])
311+ version = tuple (
312+ [int (cast (int , item )) for item in self .real_version_tuple [:index ]]
313+ )
316314
317315 return cast (Version , other [:index ]) == version
318316
319317 @preparecomparison
320318 def __ne__ (self , other : SpecComparable ) -> bool : # type: ignore
321319 """self != other."""
322320 index = self .__get_index ()
323- version = tuple ([
324- int (cast (int , item ))
325- for item in self .real_version_tuple [:index ]
326- ])
321+ version = tuple (
322+ [int (cast (int , item )) for item in self .real_version_tuple [:index ]]
323+ )
327324 return cast (Version , other [:index ]) != version
328325
329326 @preparecomparison
330327 def __lt__ (self , other : SpecComparable ) -> bool :
331328 """self < other."""
332329 index : Optional [int ] = self .__get_index ()
333- version = tuple ([
334- int (cast (int , item ))
335- for item in self .real_version_tuple [:index ]
336- ])
330+ version = tuple (
331+ [int (cast (int , item )) for item in self .real_version_tuple [:index ]]
332+ )
337333 return cast (Version , other [:index ]) < version
338334
339335 @preparecomparison
340336 def __gt__ (self , other : SpecComparable ) -> bool :
341337 """self > other."""
342338 index = self .__get_index ()
343- version = tuple ([
344- int (cast (int , item ))
345- for item in self .real_version_tuple [:index ]
346- ])
339+ version = tuple (
340+ [int (cast (int , item )) for item in self .real_version_tuple [:index ]]
341+ )
347342 return cast (Version , other [:index ]) > version
348343
349344 @preparecomparison
350345 def __le__ (self , other : SpecComparable ) -> bool :
351346 """self <= other."""
352347 index = self .__get_index ()
353- version = tuple ([
354- int (cast (int , item ))
355- for item in self .real_version_tuple [:index ]
356- ])
348+ version = tuple (
349+ [int (cast (int , item )) for item in self .real_version_tuple [:index ]]
350+ )
357351 return cast (Version , other [:index ]) <= version
358352
359353 @preparecomparison
360354 def __ge__ (self , other : SpecComparable ) -> bool :
361355 """self >= other."""
362356 index = self .__get_index ()
363- version = tuple ([
364- int (cast (int , item ))
365- for item in self .real_version_tuple [:index ]
366- ])
357+ version = tuple (
358+ [int (cast (int , item )) for item in self .real_version_tuple [:index ]]
359+ )
367360 return cast (Version , other [:index ]) >= version
368361
369362 # @preparecomparison
@@ -391,7 +384,8 @@ def _tilde(self, other: SpecComparable) -> bool:
391384 str (int (major ) + 1 if length == 1 else major ),
392385 str (int (minor ) + 1 if length >= 2 else minor ),
393386 "0" ,
394- ])
387+ ]
388+ )
395389 # print("> tilde", length, u_version)
396390
397391 # Delegate it to other
0 commit comments