[Distutils] Why are egg-info and related pth files required for rpm packages?
a.badger at gmail.com
Tue Sep 4 23:04:46 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Phillip J. Eby wrote:
> At 12:39 PM 9/4/2007 -0400, Stanley A. Klein wrote:
>> I recently installed Fedora 7 and looked at
>> /usr/lib/python2.5/site-packages. The directory has numerous Python
>> packages installed but no egg-info and few .pth files. Of the three .pth
>> files in my installation, only one has a content different from the name
>> of the package (pointing to a subdirectory of site-packages with a
>> different name).
I have some egg-info files in my site-packages. Those are from
setuptools using packages. I noticed the seemingly useless .pth files
the other day and am puzzled by their presence. More info on those
later in this post.
> The .egg-info files or directories are required in order to contain
> project-level metadata.
> So .egg-info is absolutely indispensable, regardless of installation method.
> As for .pth files, the only .pth files that should be generated by
> setuptools are the ones needed to support namespace packages. When
> you have multiple projects spanning a namespace package, each of
> those projects would contain "somepackage/__init__.py" in its naive
> layout. But this would cause conflicts between the RPMs, so
> setuptools uses uniquely-named .pth files to work around the absence
> of an __init__.py. So, these "Project-version-nspkg.pth" files are
> also indispensable, as the packages involved won't be importable without them.
> However, the .pth files you described don't sound like ones generated
> by setuptools.
I looked into this briefly when attempting to get rid of .pth's and eggs
to diagnose the earlier bug (thanks again for the quick patch and
release!) The packages I've looked at so far are all being generated by
distutils and have a C component. I haven't had a chance to delve deeper.
> Note, by the way, that as of Python 2.5, *all* distutils-generated
> packages include .egg-info; they just use a single file instead of a
> directory. This makes it easy to detect what Python packages are
> installed on a system, as long as the platform maintainers don't
> remove this file.
I'm sorry to say that this is not true on Fedora 7's python2.5. There's
a patch that disables generating egg-info files for distutils. I've
started talking with the python maintainer in Fedora to find out why the
patch exists and if it can be removed but he needs some time to find out
why the patch was added in the first place.
(A note in the spec files implies that the patch was added so as not to
generate egg-info for python core libraries and it might not have been
meant to affect distutils as a whole. I have to figure out if even that
level of meddling is going to prove bothersome and make a
recommendation. If you can think of some cases where that would be bad,
please reply so that I can include them in our discussion.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Distutils-SIG