distributing a large python application

I am looking for advice on how to trip down the size of a monothic application I am building with python/wxPython. This project involves the python code from python, wxPython significant amounts of C and C++ code from wxPython, PyOpenGL and the underlying application functionality, which is largely a set of unix commands implemented in C. My question is: what strategies are there for doing a more traditional linking stage for the final application bundle? As it stands, I packaged up python, wxPython and PyOpenGL with my app and it came to a 100Meg binary. I use only a small portion of the funcionality of those packages (e.g. site-packages from python) but the wxPython and OpenGL extensions are done as shared libraries which means the whole thing goes out. I have tried freeze.py and similar, but that just seems to make things bigger. Are there tools that do a static analysis of python code to list which packages are actually used? What about a dynamic analysis (I run my app, then dump the list of loaded modules and just ship those). For the C/C++ code, I am thinking of just statically linking the extensions into a python exectable and letting the linker strip dead code. Advice or pointers to other groups appreciated. Thanks, -Jesse __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

Jesse Hammons <jessehammons@yahoo.com> writes:
I am looking for advice on how to trip down the size of a monothic application I am building with python/wxPython.
[...]
I have tried freeze.py and similar, but that just seems to make things bigger.
Are there tools that do a static analysis of python code to list which packages are actually used?
Yes, used by freeze, for example. It's the modulefinder script, which is now (2.3) also in the standard library.
What about a dynamic analysis (I run my app, then dump the list of loaded modules and just ship those).
See sys.modules. Thomas

Jesse Hammons wrote:
I am looking for advice on how to trip down the size of a monothic application I am building with python/wxPython.
This project involves the python code from python, wxPython significant amounts of C and C++ code from wxPython, PyOpenGL and the underlying application functionality, which is largely a set of unix commands implemented in C.
My question is: what strategies are there for doing a more traditional linking stage for the final application bundle? As it stands, I packaged up python, wxPython and PyOpenGL with my app and it came to a 100Meg binary. I use only a small portion of the funcionality of those packages (e.g. site-packages from python) but the wxPython and OpenGL extensions are done as shared libraries which means the whole thing goes out.
I have tried freeze.py and similar, but that just seems to make things bigger.
hmm, sounds as if the size is more determined by the shared lirbaries you depend on (wxWindows, GL, etc.) rather than the python wrappers.
Are there tools that do a static analysis of python code to list which packages are actually used? What about a dynamic analysis (I run my app, then dump the list of loaded modules and just ship those).
For the C/C++ code, I am thinking of just statically linking the extensions into a python exectable and letting the linker strip dead code.
yeah. But that doesn't help you strip down the C++ libraries. For those you have to repackage the original libs (or at least use static libs whenever you can). Regards, Stefan
participants (3)
-
Jesse Hammons
-
Stefan Seefeld
-
Thomas Heller