[Distutils] PEP 386 status - last round here ?

Tarek Ziadé ziade.tarek at gmail.com
Fri Nov 27 13:24:14 CET 2009


On Fri, Nov 27, 2009 at 11:39 AM, Piotr Ozarowski <ozarow at gmail.com> wrote:
> [Tarek Ziadé, 2009-11-26]
>> On Thu, Nov 26, 2009 at 8:55 PM, Floris Bruynooghe
>> <floris.bruynooghe at gmail.com> wrote:
>> [..]
>> >> since the .dev versions are really only snapshots leading up to
>> >> some release, i.e. 1.0.dev456 is a snapshot leading up to the
>> >> first pre-release of the 1.0 :-)
>> >
>> > But in this case if I want to make a pre-release of 1.0 but after the
>> > last rc then I can't, I can only make a post-release of the last rc.
>> > That's almost more un-intuitive that forcing your first pre-release to
>> > be '1.0a0.dev456' instead of just '1.0.dev456'.
>>
>> It seems to me that the number of development versions of rc releases
>> is very low compared to the number of development snapshots done for
>> 1.0, before the pre-release cycle starts.
>>
>> (I don't think I have ever needed a dev snapshot of a rc version)
>>
>> I am +1 for keeping the intuitive writing for the pre-release cycle.
>>
>> e.g.
>>
>>  1.0.dev456
>>  < 1.0a1.dev456
>>  < 1.0a1
>>  < 1.0rc1.dev456
>>  < 1.0rc1
>>  < 1.0rc1.post123
>>  < 1.0
>
> why not simply use "-" and "+" where "-" is before zero-length string
> and "+" is after any other string... and then sort the rest
> alphabetically? f.e.
>
>  1.0-a1-dev456
> < 1.0-a1
> < 1.0-a1+dev456
> < 1.0-dev456
> < 1.0-rc1-dev456
> < 1.0-rc1
> < 1.0-rc1+post123
> < 1.0
> < 1.0+post123
>
> don't worry about Debian, we'll simply replace "-" with "~" (we use "~"
> and "+" right now[0]). I'm not sure about rpm, but I bet it has
> something similar and it will be much easier for us to simply handle two
> characters instead of recognizing that dev1 < a1 < b1 < c1 == rc1 ...

It's different from RPMs, since they use a strcmp(), segment  by segment,
so I think they have to extract the dev/post suffixes and to put them in front
as an epoch marker maybe ? (ccing Toshio)

Meaning that they would need to split on "-", and replace "+" by "z",
and use the segments in reverse order before comparing the first
Major.Minor.Micro part,

# rmpdev-vercmp "1.0-a1-dev456"   "1.0"
0:1.0-a1-dev456 is newer

# rmpdev-vercmp "1.0~a1"   "1.0-a1"
0:1.0~a1-None is newer

# rmpdev-vercmp "1.0-a1-2"   "1.0-a1~2"
These are equals

>From rmp5.org:
"""
The algorithm that RPM uses to determine the version ordering of
packages is simple and developers are encouraged not to rely on the
details of its working. Developers should keep their numbering scheme
simple so any reasonable ordering algorithm would work. The version
comparison algorithm is in the routine rpmvercmp() and it is just a
segmented strcmp(3). First, the boundaries of the segments are found
using isdigit(3)/isalpha(3). Each segment is then compared in order
with the right most segment being the least significant. The
alphabetical portions are compared using a lexical graphical ascii
ordering, the digit segments strip leading zeroes and compare the
strlen before doing a strcmp. If both numerical strings are equal, the
longer string is larger. Notice that the algorithm has no knowledge of
decimal fractions, and perl-5.6 is "older" than perl-5.00503 because
the number 6 is less than the number 503.
"""

Tarek


More information about the Distutils-SIG mailing list