[Distutils] [Python-Dev] [Python-checkins] peps: PEP 426: replace implied 'version starts with' with new =?utf-8?Q?=7E=3D_?=operator

Donald Stufft donald.stufft at gmail.com
Tue Feb 26 23:08:57 CET 2013


On Tuesday, February 26, 2013 at 2:53 PM, Chris Jerdonek wrote:
> On Tue, Feb 26, 2013 at 8:01 AM, Donald Stufft <donald.stufft at gmail.com (mailto:donald.stufft at gmail.com)> wrote:
> > On Tuesday, February 26, 2013 at 10:10 AM, Nick Coghlan wrote:
> > 
> > Remember, part of the goals of both PEP 386 and PEP 426 is to tighten
> > up cases where setuptools is considered too permissive, because it's
> > guessing in the face of ambiguity. "Trailing zeroes should be
> > considered implied" when comparing versions is one such guess.
> > 
> > It goes against the common usage in the Python community.
> > 
> > * 135869 total releases
> > * 66528 total releases that have at least 3 version levels (A.B.C)
> > * 20244 total releases that have at least 3 version levels where A.B and
> > A.B.0 appear to be equivalent[1].
> > * 86 total releases using at least 3 version levels where A.B and A.B.0
> > appear
> > to be different[2].
> > 
> > Would break the assumptions made in ~30% of the releases using at least 3
> > version levels, or 15% of all releases. Furthermore A.B == A.B.0 being
> > equivalent is a matter of opinion with no clear answer. I would be inclined
> > to say that not breaking it for the 15% of all releases is a greater net
> > benefit here then anyones notion of "right" unless there is a clear benefit.
> > 
> > For what it's worth, the implementation of PEP386 treats them as equal as
> > well,
> > choosing to pad the shorter one out to whatever the requisite number of 0's
> > is required to make the number of components equal.
> > 
> > On a tangential note PyPI should probably not be allowing you to upload both
> > a A.B and an A.B.0, or at the very least if we want PyPI to continue
> > allowing
> > it then we need to be explicit about how that should be handled in either
> > scheme.
> > 
> 
> 
> There is a similar issue with leading zeroes. For example, I was able
> to upload to PyPI versions both of the form A.B.2 and A.B.02. The PEP
> should probably be explicit and state that any N must be the unique
> integer representation, and state how that case should be handled if
> violated (with respect to equality, etc).
> 
> Is it easy to check if any releases on PyPI have versions with leading zeroes?
In [45]: l = [x for x in releases if any([y for y in x[1].split(".") if y.startswith("0") and y.isdigit() and not y.endswith("0")])]

In [46]: len(l)
Out[46]: 1162

Note this doesn't check if they have confusing versions, (e.g. 1.1 and 1.01) just if they
have a segment with a leading 0. 
> 
> --Chris 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130226/dd510b40/attachment.html>


More information about the Distutils-SIG mailing list