[Distutils] [RFC] PEP 345 and PEP 386 updates

Tarek Ziadé ziade.tarek at gmail.com
Wed Oct 21 15:18:16 CEST 2009


On Wed, Oct 21, 2009 at 1:38 PM, Eric Smith <eric at trueblade.com> wrote:
> Tarek Ziadé wrote:
>>
>> On Wed, Oct 21, 2009 at 10:42 AM, M.-A. Lemburg <mal at egenix.com> wrote:
>>>
>>> Tarek Ziadé wrote:
>>>>
>>>> On Tue, Oct 20, 2009 at 5:20 PM, M.-A. Lemburg <mal at egenix.com> wrote:
>>>>>>>
>>>>>>> The micro-language should provide a limited number of
>>>>>>> variables to use on the conditions:
>>>>>>>
>>>>>>> python_version = sys.version
>>>>>>> sys_platform = sys.platform
>>>>>>
>>>>>> If we adopt such a micro-language (I'm reserving judgment until I've
>>>>>> had more time to read the relevant PEPs carefully), I'd rather see the
>>>>>> names match what's in the Python runtime more closely, probably only
>>>>>> avoiding the call syntax.
>>>>>
>>>>> We could do that as well, yes.
>>>>
>>>> +1 on close names + no call syntax
>>>>
>>>> but, notice that "python_version" here is:   "%s.%s" %
>>>> sys.version_info[0], sys.version_info[1]
>>>>
>>>> thats why we came up with that name, to disinguish it from sys.version
>>>> (that contains more stuff)
>>>
>>> I think we do need the full version here, so perhaps using
>>> sys.version.split()[0] would be better or simply the full
>>> version string and then have conditions use >=, <=, <, >
>>> only (ie. not =, since that would likely never match).
>>
>> Notice that for the comparisons >, < to work, that requires more than
>> string
>> comparisons in case we provide the ability to work with rc versions,
>> because:
>>
>>>>> '2.6.3rc4' < '2.6.3'
>>
>> False
>>
>> We said earlier that we could use sys.hexversion to handle this, but
>> otherwise,
>> at least for the Python version, we can use the StrictVersion() class
>> from Distutils,
>>
>> *But* we ended up thinking that it would be better for the first version
>> to keep
>> just "==", "!=", "in" and "not in" operators and a MAJOR.MINOR string.
>>
>> These are enough just to compare strings, on a limited number of
>> versions for Python.
>
> I thought the plan was to stick with major.minor and "==", "!=", "in" and
> "not in" until PEP 386 was accepted, then switch over to having all versions
> (including Python's) be some sort of Version object, at which point we can
> have richer version comparisons, with all of the existing uses being
> compatible.

Yes that's the plan too. PEP 345 is not updated yet, but that is
clearly stated in PEP 386.

Tarek


More information about the Distutils-SIG mailing list