[Distutils] markers, <= and python 2.7.10

Nick Coghlan ncoghlan at gmail.com
Wed Jul 1 06:33:03 CEST 2015


On 1 July 2015 at 11:44, Robert Collins <robertc at robertcollins.net> wrote:
> So - 426 markers specify string comparisons only. This is now broken
> in the wild :)
>
> We need to figure out:
>  - what comparisons we should allow (e.g. - versions, or tuples, or ?)
>  - what the migration strategy for early adopters looks like
>     - do we change the meaning of python_version
>     - do we define a new symbol name
>     - do we break existing markers, or force some type gymnastics
> (e.g. casting the user side of the marker to a sequence of
> components)?
>
> https://bitbucket.org/pypa/setuptools/commits/e01e9a77fad5
> https://github.com/pypa/pip/issues/2943

>From a logistics perspective, I think it makes sense to pull
environment markers out into their own PEP so we can standardise them
independently of the full PEP 426 specification.

>From a "how to fix it?" perspective, I think it makes sense to say
that any marker ending in "_version" is compared using PEP 440 version
ordering semantics rather than lexical ordering

My rationale for that is:

1. In the simple X.Y.Z cases, lexical string comparisons and PEP 440
give the same answer
2. In the more complex cases (like 2.7.10), PEP 440 gives the right
answer, while lexical string comparison fails
3. Anything handling environment markers already needs to be able to
handle PEP 440 semantics anyway

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list