[Distutils] extensions in packages

M.-A. Lemburg mal@lemburg.com
Wed, 26 May 1999 09:41:57 +0200


David Ascher wrote:
> 
> On Tue, 25 May 1999, M.-A. Lemburg wrote:
> >
> > I've been using DLL/SOs in packages with much success for some time
> > now. Don't know why you need any hacks to get this going though:
> > it works right out of the box for me.
> 
> Do you have the DLLs/.so's in directories that are children of
> $exec_prefix?  If yes, please let us know how you do it.  That's the task
> that we're trying to solve.

No, I simply leave them in the packages subdirectories. The "make
install" step is not needed if you have the users compile the
extensions in the package subdirs. There's no magic to it.

This doesn't allow you to have one installation for multiple
platforms, but it makes the installation process very simple
and currently is the only way to go with the classical
Makefile.pre.in approach, since this does not allow you to
install extensions in directories other than site-packages
without tweaking.

I still think that to get multi-platform installation working
we'd definitely need to extend the package import mechanism
to have it continue the search for a particular module in case
the first try fails.

Note that this kind of search will be very costly due the amount
of IO needed to search the path. Some sort of fastpath hook
should be included along with this extension to fix this. (Such
a hook could also be used to do other PYTHONPATH mods at runtime
which go far beyond the current sys.path tricks, e.g. to implement
new module lookup schemes.)

For a try at such a hook, see:

	http://starship.skyport.net/~lemburg/fastpath.zip

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                   219 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/