[Distutils] Pep 440 question/clarification Version specifiers no "Or" available
Nick Coghlan
ncoghlan at gmail.com
Thu Sep 8 23:10:16 EDT 2016
On 9 Sep 2016 12:32 pm, "Robert Collins" <robertc at robertcollins.net> wrote:
>
> Thats right, there is no 'or' operator available today.
>
> In addition to what Donald says, Or significantly complicates the
> resolution job for the resolver: should 'A OR B' prefer A? If B is
> already installed should it be uninstalled to permit choosing A (aka
> is it a disjunction? What if A and B can coexist and one part of the
> graph wants A and one part wants B but there is an A OR B higher up? -
> if its a disjunction that becomes uninstallable.
Fedora started running into this kind of problem when rich dependencies
were added to RPM. Between that and the need for compatibility with older
RPM versions, it's been genuinely difficult for publishers to start relying
on the new features.
> tl;dr the ramifications of OR are much deeper than those of AND for
> this problem space, and we don't even have AND solved properly - Issue
> 988.
Disjoint environment markers provide most of the capabilities we actually
need (like installing one dependency on Py2 and a different one on Py3)
without ever forcing the resolver to make an arbitrary choice between them.
There are currently some bugs even in that, though - installing an sdist or
wheel directly instead of via a requirements file bypasses the environment
marker checks for its direct dependencies :(
(Steve Kowalik was trying to figure that one out at the PyCon AU sprints,
but I don't believe he was able to track down where the missing check
should go)
Cheers,
Nick.
>
> -Rob
>
>
> On 9 September 2016 at 10:47, Matthias Bussonnier
> <bussonniermatthias at gmail.com> wrote:
> > Hi all,
> >
> > In the line of recent discussions[1] about releasing some packages
> > only for some versions of Python.
> >
> > I was reading pep 440 and in particular the "Version specifier section".
> >
> > The following sentence caught my eye:
> >
> >> The comma (",") is equivalent to a logical and operator: a candidate
version must match all given version clauses in order to match the
specifier as a whole.
> >
> >
> > Is there no way to have an "or" ? It seem to me that it might be
> > useful for package wanting to express compatibility with `2.6`, `2.7`
> > or `>3.3` for example, in the form `=~2.6 <or operator> =~3.3`.
> >
> > I completely agree that the use case is _limited_ and likely rare, I
> > was just wondering if I'm missing something, if it was an oversight
> > and if not if adding a section detailing that "or" was not considered,
> > or that "or" was explicitly not included for X,Y,Z reason would be a
> > good thing.
> >
> > Thanks,
> > --
> > Matthias
> >
> >
> >
> > [1]:
https://mail.python.org/pipermail/distutils-sig/2016-August/029604.html
> > _______________________________________________
> > Distutils-SIG maillist - Distutils-SIG at python.org
> > https://mail.python.org/mailman/listinfo/distutils-sig
> _______________________________________________
> Distutils-SIG maillist - Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20160909/a919bd32/attachment-0001.html>
More information about the Distutils-SIG
mailing list