[Distutils] get_metadata in Distutils

Phillip J. Eby pje at telecommunity.com
Thu Jan 15 16:20:05 CET 2009


At 11:24 AM 1/15/2009 +0100, Tarek Ziadé wrote:
>On Mon, Jan 12, 2009 at 5:07 PM, Phillip J. Eby <pje at telecommunity.com> wrote:
> > At 02:11 PM 1/12/2009 +0100, Tarek Ziadé wrote:
> >>
> >> Ok, I will introduce in my patch the other formats. I am wondering though,
> >> how
> >> far this would be from an integration of pkg_resources into
> >> Distutils/pkgutil,
> >> with some API on the top and if it makes sense.
> >
> > It makes sense to me, I just wanted you to be aware how deep a job it is.
> >  You're probably going to need a generic function by importer type, just
> > like the others in pkgutil.
>
>I am making some progress, now the patch works with zipped eggs, unzipped eggs
>and regular .egg-info files.
>
>I am wondering about other cases though:
>
>- it seems that pkg_resources works on .egg-info *directories*. When
>does this case happen ?

System packages (.rpm, .deb, etc.), or other install 
--root/--single-version-externally-managed installs of 
setuptools-based packages.

(Of course, there are also .egg directories with EGG-INFO 
subdirectories, installed by easy_install --always-unzip...)


>- you said that its needs to work on nested packages, but I can't see
>the difference when grabbing the metadata in such a package

More precisely: you can have nested .egg directories within a single 
zipfile.  This is to support bundling a bunch of eggs in a single 
zipfile for easy application distribution.


>There are also some mechanisms I am not sure at a 100% of, like the
>right way to loop over sys.path entries, and the way to deal with
>sys.meta_path, etc..

Well, setuptools ignores sys.meta_path, but I suppose technically it 
shouldn't.  A use case hasn't occurred yet, though, at least to my knowledge.



More information about the Distutils-SIG mailing list