[Pythonmac-SIG] [Numpy-discussion] Packaging numpy with py2app

Josh Marshall josh.p.marshall at gmail.com
Tue Jul 18 07:01:15 CEST 2006


Thanks Bob,

On 18/07/2006, at 2:01 PM, Bob Ippolito wrote:
> To do "includes", you need to manipulate the modulegraph instance.  
> Take a look at the docutils recipe for an example. 'packages' is in  
> the return value because that need to be dealt with by py2app, not  
> modulegraph.
Can you change the recipe for matplotlib to be:

def check(cmd, mf):
     m = mf.findNode('matplotlib')
     if m is None or m.filename is None:
         return None
     mf.import_hook('pytz.zoneinfo', m, ['UTC'])
     return dict(
         packages = ['matplotlib']
     )


This does the trick with no workarounds.

If anyone needs to actual work with the plotting of time-zone  
relative dates in matplotlib in embedded Cocoa, it'll die. However,  
the likelihood of this occurring is low, but for future reference for  
the Googlers of the future; add the time-zones you need to the list  
in import_hook, ie ['UTC', 'Australia.Sydney'].

> Applications are usually distributed compressed, the on-disk size  
> isn't too much of a concern for most people...

True, I just compressed the .app and it shrunk from 40 MB to 14, so  
no problems there. The other thing to get down the compressed size is  
for me to figure out how to exclude stuff I don't need. The question  
does stand though, how would I go about including the package  
'scipy', but omitting 'scipy.weave'?

My other concern was getting around to doing this as a universal  
binary and have an enormous file. What sort of file size increases am  
I looking at? I presume it'll just be the libraries that double in  
size, and the Python code should remain the same?

>> Oh, and any reason why I can't send mail to pythonmac- 
>> sig at python.org? I'm always getting a PERM_FAILURE: SMTP Error  
>> (state 12): 554 permanent error.
>
> You probably have to be subscribed?
I am subscribed via sourceforge. The emails go about 75%, and fail  
the rest. Bizarre.


More information about the Pythonmac-SIG mailing list