[Pythonmac-SIG] bundlebuilder --standalone not working

Just van Rossum just at letterror.com
Wed Sep 3 21:14:46 EDT 2003


Bob Swerdlow wrote:

> I added --package=encodings and application seems to be working well
> now.
> 
> That warning about XML seems inappropriate: DeprecationWarning: The
> xmllib module is obsolete.  Use xml.sax instead. We ARE using xml.sax
> and I don't see why xmllib is getting called at all - could this be
> coming from some other package rather than our code?  Can I safely
> ignore these warnings?

I'm not familiar enough with PyXML to be able to judge that.

> The bundle is now 8MB, which is pretty large for downloading.  Is
> there any way to reduce the size?

The --package directive includes *all* of that package, so you're now
pulling in all of PyXML and all of encodings, don't know which is
bigger. Experiment with that dummy import encodings.whatever-it-was to
see how much that helps. Regarding PyXML: the only way I can think of
right now is to remove the old xml and rename _xmlplus to xml, and don't
specify --package=_xmlplus. Hm, onother option would be to put a dummy
import _xmlplis.whatever-it-is-you're-really-importing-from-PyXML. Btw.
these dummy imports may occur in a function that never gets called.
Example from one of my own projects:

def _moduleFinderHint():
        """Dummy function to let modulefinder know what tables may be
        dynamically imported.
        """
        import B_A_S_E_
        import C_F_F_
        import D_S_I_G_
        import G_D_E_F_
        import G_P_O_S_
        ...etc.

Also: add a -v to the bundlebuilder options to see a list of what
modules actually get included. Sometimes it's easy to spot stuff that
you know is not going to get used, but is pulled in because of some
never triggered import somewhere. Use the --exclude option to exclude
specific modules.

Just



More information about the Pythonmac-SIG mailing list