[Python-Dev] Adding a sysconfig module in the stdlib

2009-05-07 Thread Tarek Ziadé
Hello,

I am trying to refactor distutils.log in order to use logging but I
have been bugged by the fact that site.py uses
distutils.util.get_platform() in addbuilddir.
The problem is the order of imports at initialization time : importing
logging into distutils will make the initialization/build fail
because site.py wil break when
trying to import logging, then time.

Anyways,
So why site.py looks into distutils ?  because distutils has a few
functions to get some info about the platform and about the Makefile
and some
other header files like pyconfig.h etc.

But I don't think it's the best place for this, and I have a proposal :

let's create a dedicated sysconfig module in the standard library
that will provide all the (refactored) functions located in
distutils.sysconfig (but not customize_compiler)
and disutils.util.get_platform.

This module can be used by site.py, by distutils, and others, and will
focus on this role.

Regards
Tarek

-- 
Tarek Ziadé | http://ziade.org
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Adding a sysconfig module in the stdlib

2009-05-07 Thread Aahz
On Fri, May 08, 2009, Tarek Ziad? wrote:

 This module can be used by site.py, by distutils, and others, and will
 focus on this role.

This should get kicked around on python-ideas; I don't think it will
require a full-blown PEP unless there's disagreement about what it should
contain.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

It is easier to optimize correct code than to correct optimized code.
--Bill Harlan
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Adding a sysconfig module in the stdlib

2009-05-07 Thread David Cournapeau
On Fri, May 8, 2009 at 9:36 AM, Tarek Ziadé ziade.ta...@gmail.com wrote:
 Hello,

 I am trying to refactor distutils.log in order to use logging but I
 have been bugged by the fact that site.py uses
 distutils.util.get_platform() in addbuilddir.
 The problem is the order of imports at initialization time : importing
 logging into distutils will make the initialization/build fail
 because site.py wil break when
 trying to import logging, then time.

 Anyways,
 So why site.py looks into distutils ?  because distutils has a few
 functions to get some info about the platform and about the Makefile
 and some
 other header files like pyconfig.h etc.

 But I don't think it's the best place for this, and I have a proposal :

 let's create a dedicated sysconfig module in the standard library
 that will provide all the (refactored) functions located in
 distutils.sysconfig (but not customize_compiler)
 and disutils.util.get_platform.

If we are talking about putting this into the stdlib proper, I would
suggest thinking about putting information for every platform in
sysconfig, instead of just Unix. I understand it is not an easy
problem (because windows builds are totally different than every other
platform), but it would really help for interoperability with other
build tools. If sysconfig is to become independent of distutils, it
should be cross platform and not unix specific.

cheers,

David
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com