[Distutils] Extending distutils with 3rd party build commands?
Bob Ippolito
bob at redivi.com
Sat Oct 23 00:23:51 CEST 2004
On Oct 22, 2004, at 18:04, Bob Ippolito wrote:
> On Oct 22, 2004, at 17:18, Fred L. Drake, Jr. wrote:
>
>> One thing that no one has mentioned in this thread is the
>> "command-packages"
>> support I added to distutils for Python 2.4. I think this supports
>> Bob's use
>> case well.
>>
>> What's needed is to install a Python package containing the new
>> commands
>> somewhere on the search path (preferably in .../site-packages). Then
>> edit
>> the Python installations distutils config file (bet you didn't know
>> about
>> that!) to include
>>
>> [global]
>> command-packages=my.pkg
>>
>> The new commands will be available for all setup.py scripts.
>>
>> This is a documented feature; you can read more about it at
>>
>> http://www.python.org/dev/doc/devel/dist/node29.html
>
> That does indeed support this use case.. I may have to move things
> around in the package a bit to support it, but it may just work.
>
> Now what about the "Python installations distutils config file"?
> Where's that located? I don't see it referenced in the
> documentation.. Can that file be placed somewhere on site-packages
> like sitecustomize (good), or does it require editing a root-owned
> vendor file (bad)?
Ok, I tracked it down to distutils.dist. Unfortunately, it looks like
this feature won't be very useful for my use case after all. There are
only a few locations searched for distutils configuration files:
- 'distutils.cfg' must either go inside the distutils package itself
(vendor files, bad)
- '.pydistutils.cfg' ('pydistutils.cfg' in win32/macos classic) located
in the user's home directory (per-user, bad)
- 'setup.cfg' in the current directory (per-package, worse)
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).
-bob
More information about the Distutils-SIG
mailing list