Hello,

On Nov 14 16:00 Marcus Rueckert wrote (shortened):

> > On Wed, 2007-11-14 at 15:08 +0100, Johannes Meixner wrote:
> > > Hello,
> > > 
> > > what is the recommended way for packaging Python stuff?
> > > 
> > > Either
> > > have byte-compiled Python .pyc and .pyo files packaged into the RPM
> > > or
> > > let this be done by the currently actually installed Python system
> > > during run-time on the end-user's computer and not by whatever
> > > (perhaps different) Python system during package build-time?
> 
> as we build with the same python version as the user will run it later.
> you can safely package the .pyc files.

I understand that it is the same Python version directly after
a new system installation.

But what happens when the user later change/update his Pyhon?

Think about the "worst case" when the user replaces our Pyhon
with whatever self-compiled Pyhon.

Are byte-compiled Python .pyc and .pyo files the same for any Python
and/or is any Python sufficiently smart to know when .pyc and/or .pyo
files are outdated (even if the matching .py files are unchanged)?


> i would even recommend packaging
> them so they get removed if you uninstall the package.

Removal when uninstalling could also be done by whatever
other magic (e.g. via %ghost or a %preun scriptlet in RPM).

I wonder why in this case small RPMs seem not to count.

For example the installed .pyc and .pyo files in python
on a openSUSE 10.3 i386 system are more than 7MB and
still about 1.6MB after "bzip2" so that those files
should make the python RPM about 1.6MB bigger.

At least according to
http://www.python.org/doc/1.5.1p1/tut/node43.html
I wonder if there is a noticeable advantage to provide
.pyc and .pyo files in the RPM because it reads:
"A program doesn't run any faster when it is read from
 a ".pyc" or ".pyo" file than when it is read from a ".py" file;
 the only thing that's faster about ".pyc" or ".pyo" files is
 the speed with which they are loaded."


I am no Python expert at all and I would be happy if a Python expert
could provide some background information.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to