[Distutils] Extending distutils with 3rd party build commands?

Bob Ippolito bob at redivi.com
Sat Oct 23 04:30:39 CEST 2004

On Oct 22, 2004, at 22:14, Fred L. Drake, Jr. wrote:

> On Friday 22 October 2004 06:23 pm, Bob Ippolito wrote:
>> I need an editable file in a system-wide directory such as
>> site-packages that isn't "owned" by the Python installation.  Even if
>> this were the case, it would be a real pain to implement, because it
>> would have to be done as a very careful postflight script that merges
>> the user's current config file with the necessary additions (in this
>> case, make sure to preserve anything else in the command-packages list
>> if there is one).
> Something that's supposed to affect all users should require that root 
> set it
> up.  I understand the issue about it being owned by the Python 
> installation,
> though.

The problem is that Python itself will be owned by the vendor.  Let's 
say Apple, Debian, FreeBSD, etc.  Anything additional to that should 
live somewhere else, in a location that's explicitly not controlled by 
the vendor.  $prefix/etc creates another problem in that Python has 
never used $prefix/etc for anything before.  It's not a general 
solution to this problem.

In particular, the situation on OS X is such that site-packages is 
writable by the admin group (it's technically a symlink to somewhere 
else, but that's inconsequential), where the rest of the Python 
installation is owned by root:wheel (not writable by admins).  It's of 
course possible for administrator users to authenticate as euid 0 and 
modify vendor files, but it's frowned upon and should not be done, 

> Where would you suggest it be?  $prefix/etc/distutils.cfg, perhaps?  
> What
> about on Windows?

There should be a way to register new distutils functionality by way of 
sys.path.  This allows the vendor, admins, users, and specific 
applications to add functionality.  The performance impact is 
completely negligible.


More information about the Distutils-SIG mailing list