Packaging .py files

Jakub Bogusz qboosh at pld-linux.org
Wed Jul 16 18:49:47 CEST 2008


(moving to -en)

On Wed, Jul 16, 2008 at 03:31:41PM +0200, Patryk Zawadzki wrote:
> On Wed, Jul 16, 2008 at 3:17 PM, Mateusz Korniak <mateusz at ant.gliwice.pl> wrote:
> > On Wednesday 16 of July 2008, Patryk Zawadzki wrote:
> >> I'd like to start
> >> packaging .py files along with their bytecode counterparts. The
> >> reasoning:
> >>
> >> 1) It's much easier to find bugs in your own code (...)
> >>
> >> 2) It's much easier to trace faulty applications (...)
> >>
> >> 3) We'll no longer need to patch multiple applications that either use
> >> codegen.py (patches for this are all over the place) or use
> >> glob("*.py") to find their plugins.
> >>
> >> I'm not planning a mass commit or anything but I'll start packaging
> >> the sources instead of removing them when commiting from now on.
> >>
> >> Please no "save the 1k of disk space" arguments.
> >
> > We can pack *.py and *.pyo (instead of *.pyc *.pyo) archiving almost same and
> > having "save the 1k of disk space" ;)
> 
> Yeah, having .pyc files next to their optimized versions would be useless.

That's false, replacing .pyc with .py is very bad idea.

1. .pyo files are used only when python is called with -O option.

2. if module .pyc file is not present, python (called without -O) attempts
to write it - so using some python module with root privileges would
create .pyc files not belonging to any package

And when presenting your idea, use real numbers, not disdained "1k".
I bet it's about 10-20MB on average system (depending on usage of some
GNOME/KDE python applications or python frameworks like Twisted or
Django).


-- 
Jakub Bogusz    http://qboosh.pl/


More information about the pld-devel-en mailing list