[Pythonmac-SIG] A few more py2appissues/questions

Zachary Pincus zachary.pincus at yale.edu
Sun Jun 29 18:06:17 CEST 2008


Hi all,

I've been wrestling with py2app for the last day and am getting pretty  
confused/discouraged. If anyone has any suggestions regarding the  
following issues I've run across, I would be extremely grateful!

I've tested these with both the SVN version of py2app (and  
dependencies like modulegraph/macholib) as well as the current  
distributed version.

(1) It appears that modules included via the py2app 'includes' option  
do not have their full dependencies added. I included a handful of  
modules from my main package via the setup.py script:

     setup_kws['options'] = {'py2app':{'includes':['mypackage.util',  
'mypackage.other']}}

These modules do get included, but *none* of their dependencies do,  
even though there are clear 'import' statements in each. I checked out  
the dependency graph as output by the --graph option, and sure enough,  
no dependencies other than 'os' (which is not imported by the modules)  
are shown. Is this by design? I tried tracing through the modulegraph  
code to check, but it doesn't seem that this is the desired outcome.

(2) It appears that any packages that I include via the py2app  
'packages' option are copied verbatim from the *source*, not *build*  
directory. E.g. my top-level package is called 'mypackage', and I want  
to force all of it to be included in the py2app bundle, so I do the  
following in the top-level setup.py file:
     setup_kws['options'] = {'py2app':{'includes':['mypackage.util',  
'mypackage.other']}}

Now, there are a lot of C extensions to mypackage, and some (distutils- 
supported) folder-structure transformations (thanks to some 3rd party  
code that I've included). But at the end of the day, the right  
structure gets put into build/lib.macosx[whatever]. However, for some  
reason what gets copied over into the app bundle is the mypackage tree  
from the source dir, not from the build/lib dir. Which includes  
hundreds of C source files, etc., and has the wrong structure.

Anyone have any thoughts about these matters?

Thanks,

Zach Pincus


More information about the Pythonmac-SIG mailing list