quick n' dirty measurement of compression and byte-compilation

Michael Hudson mwh at python.net
Wed Jan 2 04:40:57 EST 2002


Zooko <zooko at zooko.com> writes:

> [Please Cc: zooko at zooko.com in replies.  Thank you!]
> 
>  Michael Hudson <mwh at python.net> wrote:
> >
> > Zooko <zooko at zooko.com> writes:
> > 
> > > I noticed that the PyXML build script byte-compiles its .py files.
> > > It seems like this potentially introduces incompatibility if the
> > > version of Python used to build differs from the version used to run
> > > the resulting package.
> > 
> > Depends where you install the files.  By default don't they end up in
> > 
> >     $(prefix)/lib/python$(VERSION)/site-packages
> 
> Mojo Nation currently gets distributed [1] either as a
> self-installing Windows package or as an "untar me and run in place"
> Unix tarball.

Yeah, I see that it's different for "applications" as opposed to
"libraries".

OTOH, I thought "best practice" for apps was to bundle up a copy of
Python too, using py2exe or installer.  Obviously this depends on
distribution method and the size of your application...

> Even if we *did* install into
> `$(prefix)/lib/python$(VERSION)/site-packages', that wouldn't solve
> the problem of delivering only byte-compiled .pyo's for a version of
> Python that the user doesn't have.

Perhaps I should have read more than the first paragraph of your
post...

[...]  
> I'd like to repeat my suggestion to developers: transmit straight
> .py files and > do byte-compilation on the end-user's computer,
> either in the installation > script or simply at runtime.  (Also:
> use bzip2.)

.. 'cause then I'd have read this, which I agree with.


Cheers,
M.



More information about the Python-list mailing list