[Distutils] Pep 440 question/clarification Version specifiers no "Or" available

Robert Collins robertc at robertcollins.net
Thu Sep 8 22:31:49 EDT 2016


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.

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.

-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


More information about the Distutils-SIG mailing list