[Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

"Martin v. Löwis" martin at v.loewis.de
Thu Apr 20 21:53:00 CEST 2006


Anthony Baxter wrote:
>> 4. .egg files. -1
> 
> As far as I understand it, an egg file is just a zipimport format zip 
> file with some additional metadata. You can also install the egg 
> files in an unpacked way, if you prefer that. I don't understand the 
> objection here - it's no better or worse than countless packages in 
> site-packages, and if it gives us multiple versions of the same code, 
> all the better. 

It is worse: each .egg file makes an additional sys.path entry (if
I understand correctly); every import statement will traverse every
every package. I'm not sure precisely how all this works, but I wouldn't
be surprised if the zip directory is read over and over again.
Compare that to countless packages in site-packages: "import foo" will
*just* look for foo.py, foo.so, and the directory foo.

I understand there is a second API to importing, some kind of
"require()" call. I consider that even worse: it obsoletes the
language's mechanism for modules, and defines its own
modularization.

However, this isn't really my objection to .egg files. I dislike them
because they compete with platform packages: .rpm, .msi, .deb. Package
authors will refuse to produce them, putting the burden of package
maintenance (what packages are installed, what are their dependencies,
when should I remove a package) onto the the end user/system
administrator.

Regards,
Martin




More information about the Python-Dev mailing list