On 23 Apr, 2012, at 23:13, Chris Barker wrote: > Another couple py2app questions: > > I"ve discovered that my app is HUGE! -- I already expected that, but > this is a bit out of bounds. The reason: > > The scipy and matplotlib packages bring in all of scipy, numpy, and > matplotlib uncompressed. This gets pretty darn big, particularly when > you're using one or two simple functions from scipy, for instance. > > I know why they do that -- there are a number of dynamic inports, and > folks often include matplotlib and/or scipy in apps where people may > be scripting, etc, and using features that aren't always imported by > the app. And this way, apps using those libs "just work" which is > great. > > However, it would be nice to be able to override soem of this: > > Is there a way to "turn off" a recipe (other than deleting it from the > install)?
No, and I'd prefer to fix recipes instead of having a way to disable them. The numpy/scipy recipes are probably as aggressive as they are because that fixes the immediate problem with minimal effort while writing the recipe. The recipe should get a way to specify which dynamic imports are present, simular to the hardcoded knowlegde about the stdlib in modulegraph. That way py2app can include only the bits that are really necessary. IIRC the matplotlib recipe includes the entire package because of the data files that are in the package, including only the code doesn't work. > > - Is there a way to apply excludes after the recipe? As far as I can > tell, if the recipe includes it, excludes doesn't remove it. That's correct, and is a bug: user specified actions should override automatic actions, including the recipes. Ronald > > > -Chris > > > > On Mon, Apr 23, 2012 at 11:42 AM, Chris Barker <chris.bar...@noaa.gov> wrote: >> Folks, >> >> py2app doesn't seem to do "the right thing" with nested packages. >> However, it's not entirely clear what it should do... >> >> example: the "pubsub" package is delivered with wxPython, so it is >> commonly imported thusly: >> >> from wx.lib.pubsub import Publisher >> >> However, in wx.lib.pubsub, there is some trickery in the __init___, so >> as py2app installs it, ot doesn't work (see previous messages to this >> and the wxPython list). However, if you do: >> >> packages = ['wx.lib.pubsub'] ... >> >> in your py2app setup.py, you get the entire pubsub package, but installed in >> : >> >> Peppy.app/Contents/Resources/lib/python2.7/pubsub >> >> so it will work, but only if you now import it as: >> >> from pubsub import Publisher >> >> not too heinous, but it's really nice if we don't have to change >> imports for the bundled version. >> >> if I add 'wx' to packages, It does work, but I've then got all of wx, >> all of wx.lib, etc, which is really a bit much (the resulting app >> bundle is 124MB, vs. 60 without specifying the wx package) >> >> At first, I thought I'd want: >> >> wx/lib/pubsub/.... >> >> put on sys.path, with wx and lib empty except the specified dirs. >> However, that would put two "wx" dirs on sys.path, which would not be >> good (assuming wx is used...) >> >> Would it be possible for the packages specification to be processed >> after modulegraph is run, and it would then see that "wx" and "wx.lib" >> are there, and then put all of pubsub in there? Or maybe put the parts >> of wx and wx.lib that were already going to be included outside the >> zip bundle? >> >> -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.bar...@noaa.gov > > > > -- > > 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.bar...@noaa.gov > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG