[Distutils] Passing build_ext arguments to easy_install?

Jim Fulton jim at zope.com
Tue Aug 8 20:23:15 CEST 2006

On Aug 8, 2006, at 12:15 PM, Phillip J. Eby wrote:

> At 12:02 PM 8/8/2006 -0400, Jim Fulton wrote:
>> On Aug 8, 2006, at 11:58 AM, Phillip J. Eby wrote:
>>> At 10:43 AM 8/8/2006 -0400, Jim Fulton wrote:
>>>> One hack I can think of is to use --editible and --build- 
>>>> directory to
>>>> download the package, write a setup.cfg into the resulting  
>>>> directory
>>>> and then run easy_install on the result.  I would hope though that
>>>> there is a better way. :)
>>> Not at the moment, no.  However, you could subclass easy_install
>>> and override the 'run_setup()' method to edit the setup.cfg first.
>>> The setuptools.command.setopt module includes some nice routines
>>> for editing setup.cfg files, so that you won't even overwrite
>>> settings you don't care about.
>> OK, I'll look at that when I get a chance.  Thanks. Would you be
>> interested in some sort of patch for 0.7 to make it possible to pass
>> this information to easy_install?
> Do you mean via the command-line interface?

Yeah.  Although, ultimately, I want to escape the command-line  
interface. I'd still much rather use a Python API. I'll need to  
understand the internals a lot better.  I expect looking at the  
things you suggested will help me do that.  Generally, the farther I  
go and the more I learn of setuptools, the less I actually reply on  

> One thing I originally thought about doing was trying to have some  
> way for the child setup to "inherit" settings from the easy_install  
> command; that is, to copy default options from the parent process  
> to the "subprocess" (not really a subprocess), perhaps by editing  
> the target's setup.cfg.  But maybe for what you want, all you need  
> is something like:
>     easy_install --build-commands="build_ext --blah fah wah foo"  
> whatever
> The big question there of course is whether those commands should  
> also be applied to dependencies.

Probably not.

> For something like include and library dirs, it's probably not a  
> problem, I'm just wondering about the general applicability.

Yup.  All good points.  It's not obvious how to expose this.

I think what's needed is a way to say more about how a particular  
package should be
handled.  This kind of detail doesn't lend itself to command-line  
arguments, which is
why zc.buildout is command-line based. :)


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