[Distutils] Design rationale for the egg format ?
pje at telecommunity.com
Mon Jun 14 16:28:03 CEST 2010
At 03:59 PM 6/14/2010 +0900, David Cournapeau wrote:
>I have a few questions about the egg format implementation, and was
>hoping people who designed it could answer them:
> - why does the filename encode some metadata (which python version if
>the package contains extensions, platform specifier) ?
As Paul mentioned, it's so that discovery can happen without needing
anything more than a listdir(). (A legacy of eggs' origin as a
binary plugin format.)
> - why are the metadata split into files instead of one single
> metadata file ?
Because that's simpler than trying to define a single universal file
format that's forward and backward-compatible with every possible
feature and use case. Each use case can have an optimized file format.
It also scales better for performance when you have multiple things
you might (or might not) be reading. For example, since entry points
are separate from dependencies, you you don't need to read the
dependencies from an egg that doesn't have an entry point you're scanning for.
More information about the Distutils-SIG