podhmo / python-node-semver

python version of node-semver
MIT License
21 stars 15 forks source link

catch up current node's implementation (partially) #8

Closed podhmo closed 7 years ago

podhmo commented 7 years ago

5

podhmo commented 7 years ago

i see. <=1.2 is treated as <SemVer Comparator "<=1.2.0-0">. so 1.2 is rejected.

podhmo commented 7 years ago

some tests are broken, need to fix

memsharded commented 7 years ago

Sure, no worries. I have tried to have a look to your fix proposal, seems you are also doing other improvements and I couldn't follow, sorry I couldn't help further.

Just another check: when you compare with <=1.2.0 explicit, the prerelease -0 is not added in that case, and it works

wanted = "1.2" 
cands =  ["1.1.1", "1.2", "1.1.1-111", "1.1.1-21"]
result = max_satisfying(cands, "<=1.2.0", loose=True)
assert wanted == result, "result is %s" % result #Works
podhmo commented 7 years ago

tests are passed. (and implementation is changed, for catch-up current node's implementation)

not impelemented features

podhmo commented 7 years ago

These tests are passed, so original issue is solved, maybe. https://github.com/podhmo/python-semver/pull/8/files#diff-4841ac9d81b28247dd3e303936222e7b