[Python-Dev] buildtime vs runtime in Distutils

M.-A. Lemburg mal at egenix.com
Thu Nov 19 12:04:44 CET 2009


Tarek Ziadé wrote:
> On Mon, Nov 16, 2009 at 8:15 PM, Toshio Kuratomi <a.badger at gmail.com> wrote:
> [..]
>> I've brought the issue of Makefile and pyconfig.h being needed for distutils
>> to the attention of every new Fedora python maintainer since the package
>> split was made.  The current maintainer, David Malcolm, agrees that
>> distutils.sysconfig needs to be able to use this data and he has moved the
>> Makefile and header files into the main python package.  This doesn't change
>> the problems with using a Makefile and C header files as a data format for
>> python.
> 
> Great News !
> 
> Now for the format problem, I agree that it seems more robust to
> pre-process the variables
> and inject them in the stdlib when ./configure is run.
> 
> I am not sure what is the best strategy here, but I would rather not
> add yet another
> configuration file (wether its an xml format or an ini-like format).
> 
> So what I am proposing is to inject those values in a private dict in
> the new sysconfig.py module,
> that can be read through the get_config_vars / get_config_var APIs.
> 
> This means that sysconfig.py will be added as "sysconfig.py.in"

Wouldn't it be cleaner to place the extracted information into
a new module _sysconfig_settings.py which gets created by the
configure script or the Makefile later during the build ?

This new module could then be imported into sysconfig.py at
run-time.

BTW: There's already a Tools/scripts/h2py.py we could use for
converting pyconfig.h into a Python file. For the Makefile
we could use the distutils Makefile parser to add the extra
values.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 19 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-Dev mailing list