Tarek Ziadé <tarek <at> ziade.org> writes:
yeah that's close to what I remembered. and the 4% left are non-sense versions
that said suggest_normalized_version() would probably work well with semver as well
Actually, sensible-looking semantic versions seem not to be amenable to having normalized versions suggested via suggest_normalized_version(). For example, the legal semantic version "0.1.0-build+post" fails both as-is, and for suggestion:
from distutils2 import version version.NormalizedVersion('0.1.0-build+post') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "distutils2/version.py", line 84, in __init__ self._parse(s, error_on_huge_major_num) File "distutils2/version.py", line 95, in _parse raise IrrationalVersionError(s) distutils2.errors.IrrationalVersionError: 0.1.0-build+post assert version.suggest_normalized_version('0.1.0-build+post') Traceback (most recent call last): File "<stdin>", line 1, in <module> AssertionError
So, some work might be required for NormalizedVersion to work with semantic versions. Regards, Vinay Sajip