[Distutils] get_metadata in Distutils
Phillip J. Eby
pje at telecommunity.com
Mon Jan 12 17:07:34 CET 2009
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.
>The only difference I can see is that I am working on an API that would return
Yep... which means that you're going to have to reinvent (and
re-test) a fair number of wheels to get there. pkg_resources just
lets you ask for a distribution's PKG-INFO metadata, and get it back
as a string, regardless of what egg format is in use (including
distutils). But to *just* support PKG-INFO, the irony is that you'll
have to recreate a fair amount of stuff.
>I'd say then : if setutpools version parsing system is superior to
I'm not actually familiar with "versionpredicate", so I couldn't
say. It's definitely superior to LooseVersion and StrictVersion,
which were the only version tools available in the distutils when I
started all this.
>wouldn't it make sense to merge it into Distutils ?
>Maybe that was the initial plans ?
Yes, and yes. Setuptools version parsing (and name/version escaping)
functions at least doesn't have any dependencies on anything
else. So that's an easy port. If you want Requirement objects as
well (specifying various version ranges), a bit more gets pulled
in. However, if all you want is to be able to turn versions into
opaquely-comparable values, parse_version() and its dependencies are
all you need.
(By the way, I previously proposed PEP 365 -- that pkg_resources
simply be bundled in the stdlib -- to address these needs.)
>Well, being able to query the installed version for a package seem to
>me like a feature
>that should live in Distutils or pkgutil
>In the same way, being able to do version arithmetic is rather
>important, and it would be better
>ihmo to have one and only one way to deal with that in Python,
>What are you plans for Setuptools development for the future ?
I hope someday to have some time for it again. :)
More information about the Distutils-SIG