[Catalog-sig] Make setuptools smarter?
Phillip J. Eby
pje at telecommunity.com
Wed Feb 27 21:27:15 CET 2008
At 04:29 PM 2/26/2008 +1100, Richard Jones wrote:
>Phillip J. Eby <pje at telecommunity.com> wrote:
> > At 08:44 AM 2/26/2008 +1100, Richard Jones wrote:
> > >PyPI has an xml-rpc interface but it's not being used.
> > >
> > >What are the chances of getting setuptools to change?
> > See http://www.python.org/dev/peps/pep-0365/ for details on what's
> > supposed to (eventually) use the XML-RPC interface.
>I wasn't aware of that PEP, thanks! Is there any more detail on what
>XML-RPC features you'd need to support it?
AFAIK, it should be possible to do with the existing API, since it
will only be supporting downloads for files found directly on
PyPI. (i.e., no third-party distribution sites). The MD5's are
included in that API already.
To find the package, I was thinking I would use package_releases(),
and if nothing is found, falling back to search() using the longest
alphanumeric substring of the canonicalized package name, then
filtering the results that come back. Then, it'd be on to picking a
compatible bdist_egg out of release_urls().
One minor possible hurdle is that package_releases() doesn't list
*all* available versions, only the "unhidden" ones. It might be nice
to have a separate API to request *all* versions.
OTOH, I have to say that the availability of the new "simple" API
makes it a lot more tempting to just use that. Because there, I can
make just *one* server round trip to get all the data I need,
assuming that the user has properly spelled and capitalized the
package name. Whereas, with the XML-RPC API, it requires a minimum
of two calls. (And of course, the "simple" API can be statically
mirrored, while XML-RPC cannot.)
More information about the Catalog-SIG