[Distutils] [Python-Dev] [Python-checkins] peps: PEP 426: replace implied 'version starts with' with new ~= operator

Daniel Holth dholth at gmail.com
Sat Feb 23 19:43:59 CET 2013

On Sat, Feb 23, 2013 at 10:23 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:

> On Sun, Feb 24, 2013 at 12:57 AM, Vinay Sajip <vinay_sajip at yahoo.co.uk>
> wrote:
> > Nick Coghlan <ncoghlan <at> gmail.com> writes:
> >
> >> Daniel is a fan of this syntax, but I think it is inferior to the
> >> implied approach, so don't expect it to survive to any accepted
> >> version of the PEP :)
> >
> > Another thing against ~= is that it isn't valid Python syntax. It's not
> a deal-
> > breaker, but it does mean that you can't e.g. use the ast module in the
> > implementation. This might be a factor if the mini-language ever grows
> (as it
> > recently did, adding parentheses).
> Daniel persuaded me that the *semantics* of Ruby's ~> pessimistic
> version comparison operator are highly desirable. I liked them so
> much, I'm now proposing them as the default behaviour of version
> specifiers. Thus, the "~=" operator goes away, and you can use "==" to
> explicitly request the previously proposed default behaviour, or just
> append an extra ".0" if you're more pessimistic about a dependency's
> backwards compatibility policies than the default interpretation.
> This and other aspects will be brought up on distutils-sig at some
> point not too far in the future :)
> Cheers,
> Nick.

Join us on distutils-sig! It's like python-dev, except with more distutils!

Good changes, ~> is useful, unlike "starts with". I don't think we should
include starts-with at all.

There simply must be a way to spell "equals" that means "equals". It will
be used when that so-called security release broke my application that
integrates said library in a way that doesn't even expose the flaw.

Plone depends on hundreds of libraries that probably only use >= or no
version at all in their setup.py. Then the buildout.cfg ships with the ==
versions of all the libraries that the Plone release team actually tested.
== is not the common plague that you fear.

Requirements specifiers have never been valid Python syntax; note the
unquoted version strings. Environment markers are different and do not
compare distribution versions.

As a aside pkg_resources probably needs an operator [that might be removed
when generating PKG-INFO] for use in setup.py install_requires. Setuptools
parses distname [OPERATOR version] not distname [OPERATOR? version]

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

More information about the Distutils-SIG mailing list