[Distutils] Supporting extensibility in disutils

M.-A. Lemburg mal at egenix.com
Mon Aug 2 19:38:07 CEST 2004


Fred L. Drake, Jr. wrote:
> On Monday 02 August 2004 12:49 pm, M.-A. Lemburg wrote:
>  > I'm +1 on being able to *add* new commands this way, but a
>  > strong -1 on overriding distutils own commands by doing
>  > import hackery. The reason for the latter is that tracking down
>  > errors in such setups is a complete nightmare - both for the
>  > developer and the user.
> 
> I'm not actually suggesting any import hackery that isn't being done already.  
> All that's being done is loading of a class from a computed name; I'm 
> suggesting that distutils try more than one name before failing.
> 
> I don't think the package developer should need to worry about such setups at 
> all.  If they provide a setup.py that works with a vanilla Python, they've 
> done their part.  It's the responsibilty of the distutils extension developer 
> to work with what they get.
> 
>  > How about something like a PYTHONDISTUTILSPATH + distutils.path
>  > (mimicing PYTHONPATH and sys.path for command lookups) ?
> 
> That would certainly work for adding commands.  I'm not convinced we don't 
> want to allow overrides, though.  (No, I don't like that directories from 
> PYTHONPATH come after the default path, or that site-packages comes after the 
> standard library.)  We could certainly point out the potential dangers of 
> overriding stock commands in this way, but it's not clear that we need to 
> disallow overriding either.

The PYTHONDISTUTILSPATH would allow this without having to
change any code, even though it's considered dangerous.

Providing distutils.path would also allow munging the path
in e.g. sitecustomize.py which is probably what you have in mind.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 02 2004)
 >>> 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 mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Distutils-SIG mailing list