[Python-Dev] Relative Package Imports

Gordon McMillan gmcm@hypernet.com
Tue, 14 Sep 1999 12:47:25 -0400


[MA Lemburg]
> The solution I'm using (and Zope is too) is to wrap a
> complete Python installation into the product, all setup to
> do the right thing. It makes the archive a little heavier...
> which is actually not so bad from a marketing POV. Bizarre, but
> people seem to want all those megs.

This is fine if you're distributing an app - it's a black box, it's 
standalone, no dependencies outside the app. Cool. I do that 
too. I use imputil to serve modules out of archives - no need to 
tweak the modules at all. In the upcoming version (of my 
installer) sys.path has exactly one entry, and the only python 
that needs to be outside an archive is exceptions.pyc.

(I repeat here: while the pieces of my installer that handle 
binary dependencies are Win32 only, the parts that handle 
pure Python are cross-platform.)

But both you and Jim are aiming for this non-existant in-
between space - in some respects you want a "normal" 
Python installation, but you want to black-box your turf.

I'm sorry, but if you're going to fit into a Python installation, 
you should make public your dependencies. Yes, installation 
becomes more complicated, but you're dealing with *Python 
users*. They're at least as likely to get screwed by having 
multiple different copies of the same thing around as you are 
in having dependencies outside of your personal control.

If you also want to distribute as a standalone, freeze/squeeze/ 
whatever it. Just make sure that what you distribute this 
way won't interfere (or be confounded by) any existing Python 
installations.

- Gordon