Python package packaging question

Toshio toshio at tiki-lounge.com
Mon Feb 2 22:23:50 UTC 2004


n Mon, 2004-02-02 at 16:55, Nalin Dahyabhai wrote:
> On Mon, Feb 02, 2004 at 04:18:09PM -0500, Mihai Ibanescu wrote:
> > It may seem like it. .pyc and .pyo files are there for performance 
> > reasons. .py files are there, because debugging would be a nightmare 
> > otherwise.
> 
> The byte-compiled versions will always be generated if you have write
> access to the directory.  (This is almost always the case if you happen
> to run a script as root.)  If you run a script as root and then attempt
> to uninstall the package which includes that script, some directories
> which are unique to the package can't be removed because the .pyc and
> .pyo files are still there (even though the .py files are now gone).
> 
Right.  I think the .py files are important.  I think one of the pyc or
pyo files would be nice (pyc because python creates those by default?) 
But I'm very tempted to %ghost the pyo files rather than install them
because they take up more space, aren't going to be used most of the
time, and don't seem to provide much of a performance change.  (I
believe %ghost also autoremoves the files on package de-install, if I'm
wrong, would someone correct me?)

> Some packages include the byte-compiled versions of their scripts to
> avoid this.  Personally I think all packages which include python
> scripts should include both the .pyc and .pyo files (and that the
> default RPM configuration should automate this), but I don't think
> there's ever been a consensus on that.
> 
I'd like to see consensus because I see a potential to generate some
boilerplate code for python packaging if we can agree on what the
standard should be.

-Toshio
-- 
Toshio <toshio at tiki-lounge.com>





More information about the devel mailing list