[Pythonmac-SIG] Adding sub-packages in py2app

Christopher Barker Chris.Barker at noaa.gov
Fri Oct 17 18:56:58 CEST 2008


Hi all,

I find I sometimes need to add a sub-package or module that wasn't 
pickle dup my py2app, and can't figure out how to do it. The problem is 
thus:

say I have a module I'm using that's part of a bigger package. It might 
get imported like so:

from BigPackage.SubPackage import Amodule


If I add it to the includes list like this:

  OPTIONS = {...
                'includes': ['BigPackage.SubPackage.Amodule'],
                }

It gets included, but as "Amodule", so it would have to be imported as:

import Amodule

If do this:

'packages' : [BigPackage]

all of BigPackage gets included, but if it's big, and all I need is the 
one module, that's a lot of extra stuff.


is there a way to handle this???

NOTE: If I was really importing the way I do above, py2app should pick 
it up and it'll get included properly, but sometimes that stuff is 
getting import with __import__ or, when unpacking a pickle, or..., so I 
do need to tell py2app to include it.

-thanks,

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov


More information about the Pythonmac-SIG mailing list