[Cython] [cython-users] Re: Cython 0.17 beta 1 released
Stefan Behnel
stefan_ml at behnel.de
Fri Aug 3 06:18:27 CEST 2012
Yaroslav Halchenko, 02.08.2012 21:54:
> On Thu, 02 Aug 2012, Stefan Behnel wrote:
>>> just a side-note -- I didn't know that StrictVersion doesn't play nicely with LooseVersion to any degree:
>
>>> $> python -c 'from distutils.version import LooseVersion as LV, StrictVersion as SV; print SV("0.17") > LV("0.18")'
>>> True
>
>>> at least in python3 it pukes:
>
>>> $> python3 -c 'from distutils.version import LooseVersion as LV, StrictVersion as SV; print(SV("0.17") > LV("0.18"))'
>>> Traceback (most recent call last):
>>> File "<string>", line 1, in <module>
>>> File "/usr/lib/python3.2/distutils/version.py", line 70, in __gt__
>>> c = self._cmp(other)
>>> File "/usr/lib/python3.2/distutils/version.py", line 179, in _cmp
>>> if self.version < other.version:
>>> TypeError: unorderable types: tuple() < list()
>
>> That's surprising at first sight, but I don't think it hurts all that much.
>> People would normally use either of them, not both.
>
> I understand that but absence of error in python2.x case (thus suggesting
> supporting such a comparison) is misleading at least
>
>> Anyway, the next release candidate of Cython will be called 0.17c1. Both
>> the LooseVersion and the NormalizedVersion should be able to handle that.
>
> not quite:
>
> 1.
>
> $> python -c 'from distutils.version import LooseVersion as LV, StrictVersion as SV; print(SV("0.17") > SV("0.17c1"))'
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "/usr/lib/python2.7/distutils/version.py", line 40, in __init__
> self.parse(vstring)
> File "/usr/lib/python2.7/distutils/version.py", line 107, in parse
> raise ValueError, "invalid version number '%s'" % vstring
> ValueError: invalid version number '0.17c1'
>
>
> so it needs to be 0.17b1 I guess
>
> $> python -c 'from distutils.version import LooseVersion as LV, StrictVersion as SV; print(SV("0.17") > SV("0.17b1"))'
> True
>
>
> 2. LooseVersion is too loose to be used with standardized suffixes, so it
> would not sort those release candidates appropriately
>
> $> python -c 'from distutils.version import LooseVersion as LV, StrictVersion as SV; print(LV("0.17") > LV("0.17b1"))'
> False
Great. Then we'll have a "release candidate" called "beta" for the sake of
backwards compatibility. I'm not entirely happy about that.
Stefan
More information about the cython-devel
mailing list