semver icon indicating copy to clipboard operation
semver copied to clipboard

Use fullmatch instead of match

Open abergeron opened this issue 5 years ago • 2 comments

Using match only matches the beginning of the string and can ignore some version information.

I've encountered this problem with this version string '0.7.1dev1+1.*' where not using fullmatch would ignore the '.*' part.

abergeron avatar May 27 '20 16:05 abergeron

Ah well fullmatch is python 3+ only. I'm not sure how to do the switch between versions here.

abergeron avatar May 27 '20 16:05 abergeron

I now realize that this PR doesn't solve the more fundamental problem, but at least makes it so that str(parse_constraint('0.7.1dev1+1.*')) == '0.7.1dev1+1.*'.

Where as before it would be str(parse_constraint('0.7.1dev1+1.*')) == '0.7.1dev1+1'.

abergeron avatar May 30 '20 21:05 abergeron