Packaging .py files

Patryk Zawadzki patrys at pld-linux.org
Wed Jul 16 18:57:30 CEST 2008


On Wed, Jul 16, 2008 at 6:49 PM, Jakub Bogusz <qboosh at pld-linux.org> wrote:
> (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.

Then we can/should package them all. I don't want to fix correct code
to look for .pyc files instead of .py (all packages using codegen).

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

True, sorry but I'm in zombie state today due to weather changes (no,
coffee does not help).

> 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

Also true.

> 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).

On these systems 10MB is the same as 1k.

-- 
Patryk Zawadzki
PLD Linux Distribution


More information about the pld-devel-en mailing list