[Pythonmac-SIG] py2app questions..

Chris Barker - NOAA Federal chris.barker at noaa.gov
Fri Apr 12 22:48:14 CEST 2013


OK,

I've run py2app with --xref. I've enclosed the html output.

Again, this app uses:

> wxPython
> numpy
> matplotlib

(and a few other stdlib packages...)

I've learned a few things from this.

1) this is odd:
  right near the top, I see:
     prescript.py
     imports: Image
  that's the prescript for the PIL recipe -- I"m not using PIL, it
seems it's runnign nthe recipe, and using what the recipe imported --
not good.


2) do I need all of Carbon?
Carbon
imports: warnings
imported by: Carbon.AE Carbon.Appearance Carbon.AppleEvents
Carbon.CarbonEvents Carbon.ControlAccessor Carbon.Controls Carbon.Ctl
Carbon.Dialogs Carbon.Dlg Carbon.Dragconst Carbon.Events Carbon.Evt
Carbon.File Carbon.Files Carbon.Menu Carbon.Qd Carbon.QuickDraw
Carbon.Res Carbon.TextEdit Carbon.Win Carbon.Windows EasyDialogs
aepack aetools macostools macresource plistlib

I'm guessing py2ap uses plistlib, or something...

3) Matplotlib has multipel back-ends -- that's why I'm getting TK
stuff (and from there, Carbon?):
   FileDialog
       imports: Dialog Tkinter fnmatch os
   imported by: matplotlib.backends.backend_tkagg

An idea how to tweak the MPL recipe to only pull in the backend we
need? is there a way to pass options to he recipes?

4) Ipython is getting pulled in my Matplotlib too:

IPython
imports:
....
IPython.zmq matplotlib.sphinxext.ipython_directive

which explains the zmq.so

( and a lot of other stuff -- iPython pulls in a lot )

5) It looks like Image is getting pulled in a couple places:
...
 docutils.parsers.rst.directives.images docutils.writers.html4css1
prescript.py scipy.misc.pilutil

docutils, prescript, and scipy (not sure why scipy is pulled in yet, I
removed that dependency...)

6)OpenGL
imported by: IPython.lib.inputhookglut ....

so that's getting pulled in by IPython, which is pulled in by MPL... ( I think )
(wow! OPenGL sure has a lot of modules!)

7) bsddb seems to be recusively importing itself...

bsddb
imports: UserDict _bsddb bsddb.dbutils collections os warnings weakref
imported by: bsddb.db bsddb.dbutils dbhash

bsddb.db
imports: _bsddb bsddb
imported by: bsddb.dbutils

bsddb.dbutils
imports: bsddb bsddb.db time
imported by: bsddb

....

OK, I'm getting bored. A lot of this is really caused by Matplotlib --
which make some sense, it's been designed to be a developers tool (or
at least to be used interactively), with all sorts of options,
determined at run-time.

Is there a way to turn off a recipe other than removing ot from my
py2app install?

This is making me think that the MPL recipe should pull in the MPL
package, but not scan it for dependencies...

Still not sure about PIL -- but I wouldn't be surprised if MPL is
involved somehow!

-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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RiverDilution.html.zip
Type: application/zip
Size: 206316 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20130412/8baa6ccb/attachment-0001.zip>


More information about the Pythonmac-SIG mailing list