-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
This looks like a bug in max_satisfying to me.
from semver import max_satisfying
versions = [ '49.0.0.2', '49.0.0.4', '49.0.0.5' ]
range_ = '>=49'
print(max_satisfying(versions, range_, loose=True, include_prerelease=True))
$ python max_satisfying.py
49.0.0.2
I would expect it to return 49.0.0.5, the highest (or max) version that satisfies.
Changing this
if max_ is None or max_sv.compare(v) == -1: # compare(max, v, true)
to this
if (max_ is None or max_sv.compare(v) == -1) or (max_sv.compare(v) == 0): # compare(max, v, true)
fixes it.
$ python max_satisfying.py
49.0.0.5
Metadata
Metadata
Assignees
Labels
No labels