[Distutils] Requirent specifiers specified? :)
Jim Fulton
jim at zope.com
Thu Jun 22 19:56:22 CEST 2006
On Jun 22, 2006, at 1:42 PM, Phillip J. Eby wrote:
> 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).
This is the clearest thing I have seen so far and matches what I was
trying to say.
> 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. :)
I'm not sure what you are trying to say. I'm really trying to make
sense of this.
I assume you are alluding to what I assume is the case that that
there is an implicit
>-infinity and <infinity, so the above example becomes:
>-infinity, >1.0, !=1.2, <2.0, <infinity
Which isn't all that different from:
>1.0, >2.0, <5.0, <6.0
so how is a case like this handled? How should "fals between a pair
of" be interpreted?
I would tend to expect innermost, otherwise:
>1.0, <3.0, >5.0, <7.0
is ambiguous too.
I suggest that a more careful specification is needed.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Distutils-SIG
mailing list