[Pythonmac-SIG] Zope py2app, some progress

Roger Binns rogerb at rogerbinns.com
Thu Feb 10 08:25:05 CET 2005


> I'd like to see that pie slice for the Mac OS X build to shrink even 
> further.. 

You aren't satisfied with being the smallest amount of code already ?-)

> I took at a look at your setup.py, and it looks a fair amount 
> of it doesn't need to be specified:

More accurately you are looking at code that has evolved over two years
and for the Mac bits used to support BundleBuilder and has to build
the 10.2 and 10.3 packages differently.

> Other than removing whitespace, I think that's about all I can do to 
> make your setup shorter :)

I'm not particularly concerned with how long it is.  The point of
the original slides was how little work it is to take a full featured
Python graphical application and distribute it as a native app without
the user knowing or caring that it is in Python or having to install
any pre-requisites.

Incidentally a number of people over time have taken copies of that
script for their own projects.

The biggest problem on Mac at the moment is having to distribute
two versions (one for 10.2 and one for 10.3).  Second to that is
the sheer size of the download.

Platform     DownloadSize     InstalledSize

Windows         7.4MB                27MB
Linux          10.5MB                30MB
Panther        14.9MB                40MB

The good news is I found the cause and fix.  A whole bunch of the
wxPython/wxWidgets libraries don't respond to strip or have been
stripped.  However running "strip -x" does remove a whole bunch
more gunk that plain "strip" doesn't.  (IIRC cx-Freeze runs strip 
on executable files/libraries automatically.)

Adding another Mac specific line (:-) to makedist.py to automatically
run the strip reduces the download to 10.4MB and the installed size
to 20.6MB.

Note also that both Windows and Linux don't compress the contents
of the zip file containing all the .pyo files.  py2app also looks
like it does a way better job of excluding unneeded .pyo files.

Incidentally I did find a gross hack to work around the py2app
bug of not handling the optimise option.  Stripping out the 
doc strings saves over 3MB of compressed size, and aren't useful
in the binary end user distribution anyway.

Roger




More information about the Pythonmac-SIG mailing list