[Distutils] Requirent specifiers specified? :)

Phillip J. Eby pje at telecommunity.com
Thu Jun 22 19:42:24 CEST 2006


At 01:05 PM 6/22/2006 -0400, Jim Fulton wrote:

>On Jun 22, 2006, at 12:49 PM, Phillip J. Eby wrote:
>
>>At 12:26 PM 6/22/2006 -0400, Jim Fulton wrote:
>>>On Jun 21, 2006, at 5:11 PM, Phillip J. Eby wrote:
>>>>"""Requirement strings basically consist of a distribution name, an
>>>>optional list of "options" (more on this in a moment), and a
>>>>comma- separated list of zero or more version conditions. Version
>>>>conditions basically specify ranges of valid versions, using
>>>>comparison operators. The version conditions you supply are sorted
>>>>into ascending version order, and then scanned left to right until
>>>>the package's version falls between a pair of > or >= and < or <=
>>>>conditions, or exactly matches a == or != condition."""
>>>
>>>I don't think this is right. :)
>>>...
>>>When scanning left to right, 1.9 matches !=1.1, so it should match
>>>and,
>>>since it is the highest version, it should be returned.  Either your
>>>description
>>>of the algorithm is incorrect or I'm misunderstanding it.
>>
>>You're missing the "exactly matches" part.  The relevant context
>>is: "Until the package's version ... exactly matches a == or !=
>>condition".  Perhaps making that "a == or != condition's version"
>>would have been clearer, as that's what I meant by that phrase.
>>
>>Anyway, "1.9" does not exactly match the "1.1" in "!=1.1".
>
>Um, OK.  So I guess the idea is that we scan these things trying to
>make a decision.
>The decision is either match or not match.  Is that how I was supposed
>to read the above quote?

Um, no.  :)  The specification is:

1. "The version conditions you supply are sorted into ascending version order"

2. "and then scanned left to right"  (from low to high version number)

3. "until the package's version"

3a. "falls between a pair of > or >= and < or <= conditions"

3b. "or exactly matches a == or != condition"

In both #3a and #3b, we are saying that the package's version is compared 
to the condition's version.  If the version is *between* the version of a > 
or >= condition on the left, and the version of a < or <= condition on the 
right, then it is accepted.  If the version exactly matches the version of 
a == or != condition, then it is either accepted (==) or rejected (!=).  If 
neither #3a nor #3b happens, then we continue "scanning left to right" (per 
#2).

I suspect that you will next come back and ask about this:

 >1.0, !=1.2, <2.0

at which point I will remind you that #3a says nothing about the pairs 
being adjacent.  :)



More information about the Distutils-SIG mailing list