Re: [Distutils] [Python-Dev] Distutils ML wrap-up: setup.cfg new format
[original mail from python-dev http://mail.python.org/pipermail/python-dev/2009-September/091947.html] On Tue, Sep 22, 2009 at 03:21:06PM +0200, Tarek Ziadé wrote:
The pseudo-grammar is (I don't know how to write those but you'll get it hopefully)::
comp: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in' comparison: expr (comp_op expr)* expr: STRING test: or_test or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison
Here you're re-introducing '<', '>', '<=' and '>=' while you said [0] that you where going to drop them. I'm still not convinced of allowing this between strings as it will likely lead to mistakes when comparing "versions". I'm still tempted by making "python_version" a RationalVersion() so that you can use '<', '>', '<=' and '>=' safely, not really convinced of writing something like: [setup:python_version == '2.2' or python_version == '2.3' or python_version == '2.4'] (Can you even split section headers over multiple lines in ini-files?) As an asside, python 3 is dropping '<>' so maybe it would be easier/less confusing to just not include it here? Regards Floris [0] http://mail.python.org/pipermail/distutils-sig/2009-September/013205.html -- Debian GNU/Linux -- The Power of Freedom www.debian.org | www.gnu.org | www.kernel.org
On Wed, Sep 23, 2009 at 2:56 PM, Floris Bruynooghe
[original mail from python-dev http://mail.python.org/pipermail/python-dev/2009-September/091947.html]
On Tue, Sep 22, 2009 at 03:21:06PM +0200, Tarek Ziadé wrote:
The pseudo-grammar is (I don't know how to write those but you'll get it hopefully)::
comp: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in' comparison: expr (comp_op expr)* expr: STRING test: or_test or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison
Here you're re-introducing '<', '>', '<=' and '>=' while you said [0] that you where going to drop them.
Right, that was a copy-paste typo: comp: '=='|'!='|'in'|'not' 'in'
I'm still not convinced of allowing this between strings as it will likely lead to mistakes when comparing "versions". I'm still tempted by making "python_version" a RationalVersion() so that you can use '<', '>', '<=' and '>=' safely, not really convinced of writing something like:
[setup:python_version == '2.2' or python_version == '2.3' or python_version == '2.4']
That's quite verbose indeed, but that is required if we want to keep string comparison. what about keeping python_version a string, but changing the way it's created ? python_version : string_version('%s.%s' % (sys.version_info[0], sys.version_info[1])) where string_version() is a function that makes sure the output is something we can compare to strings like '2.4', etc. I wouldn't talk about RationalVersion() from PEP 386 here, because we just want a subset of it in this function : The Python version scheme. Then we could re-introduce '<' and '>'
(Can you even split section headers over multiple lines in ini-files?)
I don't think so. Regards -- Tarek Ziadé | http://ziade.org | オープンソースはすごい!
On Wed, Sep 23, 2009 at 03:15:24PM +0200, Tarek Ziadé wrote:
On Wed, Sep 23, 2009 at 2:56 PM, Floris Bruynooghe
wrote: [original mail from python-dev http://mail.python.org/pipermail/python-dev/2009-September/091947.html]
On Tue, Sep 22, 2009 at 03:21:06PM +0200, Tarek Ziadé wrote:
The pseudo-grammar is (I don't know how to write those but you'll get it hopefully)::
comp: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in' comparison: expr (comp_op expr)* expr: STRING test: or_test or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison
Here you're re-introducing '<', '>', '<=' and '>=' while you said [0] that you where going to drop them.
Right, that was a copy-paste typo:
comp: '=='|'!='|'in'|'not' 'in'
I'm still not convinced of allowing this between strings as it will likely lead to mistakes when comparing "versions". I'm still tempted by making "python_version" a RationalVersion() so that you can use '<', '>', '<=' and '>=' safely, not really convinced of writing something like:
[setup:python_version == '2.2' or python_version == '2.3' or python_version == '2.4']
That's quite verbose indeed, but that is required if we want to keep string comparison.
what about keeping python_version a string, but changing the way it's created ?
python_version : string_version('%s.%s' % (sys.version_info[0], sys.version_info[1]))
where string_version() is a function that makes sure the output is something we can compare to strings like '2.4', etc.
I wouldn't talk about RationalVersion() from PEP 386 here, because we just want a subset of it in this function : The Python version scheme.
Then we could re-introduce '<' and '>'
That's not a bad idea, how about defining python_version as: '%.8X' % sys.hexversion Then using '<' and '>' would work again I think, just a little harder to use. (Of course don't forget the bikeshedding about the name: python_hexversion, hexversion, ...) Floris -- Debian GNU/Linux -- The Power of Freedom www.debian.org | www.gnu.org | www.kernel.org
Floris Bruynooghe wrote:
On Wed, Sep 23, 2009 at 03:15:24PM +0200, Tarek Ziadé wrote:
On Wed, Sep 23, 2009 at 2:56 PM, Floris Bruynooghe
wrote: [original mail from python-dev http://mail.python.org/pipermail/python-dev/2009-September/091947.html]
The pseudo-grammar is (I don't know how to write those but you'll get it hopefully)::
comp: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in' comparison: expr (comp_op expr)* expr: STRING test: or_test or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison Here you're re-introducing '<', '>', '<=' and '>=' while you said [0]
On Tue, Sep 22, 2009 at 03:21:06PM +0200, Tarek Ziadé wrote: that you where going to drop them. Right, that was a copy-paste typo:
comp: '=='|'!='|'in'|'not' 'in'
I'm still not convinced of allowing this between strings as it will likely lead to mistakes when comparing "versions". I'm still tempted by making "python_version" a RationalVersion() so that you can use '<', '>', '<=' and '>=' safely, not really convinced of writing something like:
[setup:python_version == '2.2' or python_version == '2.3' or python_version == '2.4'] That's quite verbose indeed, but that is required if we want to keep string comparison.
what about keeping python_version a string, but changing the way it's created ?
python_version : string_version('%s.%s' % (sys.version_info[0], sys.version_info[1]))
where string_version() is a function that makes sure the output is something we can compare to strings like '2.4', etc.
I wouldn't talk about RationalVersion() from PEP 386 here, because we just want a subset of it in this function : The Python version scheme.
Then we could re-introduce '<' and '>'
That's not a bad idea, how about defining python_version as:
'%.8X' % sys.hexversion
Then using '<' and '>' would work again I think, just a little harder to use. (Of course don't forget the bikeshedding about the name: python_hexversion, hexversion, ...)
I think I'd rather see us restrict ourselves to just == and != until we can finalize the version numbering PEP, then allow '>' and '<' in all places (after converting internally to RationalVersion, or whatever). I realize it's a hassle in the short term, but in the long term it should make things easier for us. Eric.
On Wed, Sep 23, 2009 at 6:15 PM, Floris Bruynooghe
That's not a bad idea, how about defining python_version as:
'%.8X' % sys.hexversion
Then using '<' and '>' would work again I think, just a little harder to use. (Of course don't forget the bikeshedding about the name: python_hexversion, hexversion, ...)
What about having both in that case ? a regular python version and the one you mention in python_hexversion. The documentation will state that python_hexversion can be used with '<' and '>' Tarek -- Tarek Ziadé | http://ziade.org | オープンソースはすごい!
On Wed, Sep 23, 2009 at 07:03:45PM +0200, Tarek Ziadé wrote:
On Wed, Sep 23, 2009 at 6:15 PM, Floris Bruynooghe
wrote: That's not a bad idea, how about defining python_version as:
'%.8X' % sys.hexversion
Then using '<' and '>' would work again I think, just a little harder to use. (Of course don't forget the bikeshedding about the name: python_hexversion, hexversion, ...)
What about having both in that case ? a regular python version and the one you mention in python_hexversion.
The documentation will state that python_hexversion can be used with '<' and '>'
That works too of course. -- Debian GNU/Linux -- The Power of Freedom www.debian.org | www.gnu.org | www.kernel.org
participants (3)
-
Eric Smith
-
Floris Bruynooghe
-
Tarek Ziadé