Spec for the egg-info format

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Spec for the egg-info format

Paul Moore
Is there a good spec of the egg-info (directory) format anywhere? I've
found various bits, notably in the setuptools documentation, but I'm
trying to get the details clear:

- What files are mandatory?
- What format should files be in (specifically, line-ending format and
to an extent encoding)
- Should filenames in installed-files.txt be absolute or relative (and
if relative, then to what)?
- Directory name format is PACKAGE-VERSION-PYVERSION.egg-info,
correct? Always? What about platform-specific binaries? Do they need a
platform ID in there?

Also, what is the defined filename format for egg files and wininst
executables? Is that defined anywhere (it seems to be more or less
PACKAGE-VERSION-PYVERSION[-PLATFORM].egg for eggs, and
PACKAGE-VERSION[.PLATFORM][-PYVERSION].exe for wininst).

If necessary, I can read the code from distutils/setuptools, but there
seem to be odd variations on the cheeseshop, and I'd rather be sure
what's accepted than stick purely to what the tools generate. But if
what the tools generate is all that's going to be reliably accepted,
then great, I'll go with that.

My main interest is in what pip accepts, FWIW. (I'm trying to write a
pip-compatible binary file installer).

Paul.
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Spec for the egg-info format

PJ Eby
On Mon, Mar 5, 2012 at 4:47 PM, Paul Moore <[hidden email]> wrote:
Is there a good spec of the egg-info (directory) format anywhere?



- What files are mandatory?
PKG-INFO - that's it.  The rest are optional - see http://peak.telecommunity.com/DevCenter/EggFormats#standard-metadata
 
- What format should files be in (specifically, line-ending format and
to an extent encoding)

Setuptools doesn't define an encoding, and it treats any line ending character(s) as line ending characters in the files it reads.  Think universal newlines.
 
- Should filenames in installed-files.txt be absolute or relative (and
if relative, then to what)?

That's defined by the appropriate PEP; setuptools doesn't yet support an installed-files log.
 
- Directory name format is PACKAGE-VERSION-PYVERSION.egg-info,
correct? Always?

The minimum is PACKAGE.egg-info, which is used for "setup.py develop" installs/usage.
 
What about platform-specific binaries? Do they need a
platform ID in there?

That goes in the .egg filename, yes.  See:


 
Also, what is the defined filename format for egg files and wininst
executables? Is that defined anywhere (it seems to be more or less
PACKAGE-VERSION-PYVERSION[-PLATFORM].egg for eggs, and
PACKAGE-VERSION[.PLATFORM][-PYVERSION].exe for wininst).

The wininst format is distutils defined rather than setuptools-defined; for the rest, see the above link.
 

If necessary, I can read the code from distutils/setuptools, but there
seem to be odd variations on the cheeseshop, and I'd rather be sure
what's accepted than stick purely to what the tools generate. But if
what the tools generate is all that's going to be reliably accepted,
then great, I'll go with that.

My main interest is in what pip accepts, FWIW. (I'm trying to write a
pip-compatible binary file installer).

Paul.
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig


_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: Spec for the egg-info format

Carl Meyer-4
On 03/07/2012 09:07 PM, PJ Eby wrote:
> On Mon, Mar 5, 2012 at 4:47 PM, Paul Moore <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Is there a good spec of the egg-info (directory) format anywhere?
[snip]
>     - Should filenames in installed-files.txt be absolute or relative (and
>     if relative, then to what)?
>
>
> That's defined by the appropriate PEP; setuptools doesn't yet support an
> installed-files log.

I have nothing to add except for here; installed-files.txt is not
specified in any PEP AFAIK, it's pip-specific (and generated by the
distutils install --record option). Generally the filenames in it are
relative to the location of installed-files.txt itself; absolute paths
will work equally well for uninstall (where the installed-files log is
used), but obviously become wrong if the installation were relocated.

All the files in .egg-info aside from installed-files.txt are generated
by setuptools and not touched by pip.

Carl


_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig

signature.asc (205 bytes) Download Attachment