[Python-Dev] Packaging documentation and packaging.pypi API

Paul Moore p.f.moore at gmail.com
Wed Jun 20 18:45:23 CEST 2012


On 20 June 2012 17:07, Carl Meyer <carl at oddbird.net> wrote:
> Hi Paul,
>
> On 06/20/2012 09:29 AM, Paul Moore wrote:
>> As a specific example, one thing I would like to do is to be able to
>> set up a packaging.pypi client object that lets me query and download
>> distributions. However, rather than just querying PyPI (the default)
>> I'd like to be able to set up a list of locations (PyPI, a local
>> server, and maybe some distribution files stored on my PC) and combine
>> results from all of them. This differs from the mirror support in that
>> I want to combine the lists, not use one as a fallback if the other
>> doesn't exist. From the documentation, I can't tell if this is
>> possible, or a feature request, or unsupported... (Actually, there's
>> not even any documentation saying how the URL(s) in index_url should
>> behave, so how exactly do I set up a local repository anyway...?)
>
> This is perhaps a tangent, as your point here is to point out what the
> API of packaging.pypi ought to allow - but pip's PackageFinder class can
> easily do exactly this for you. Feel free to follow up with me for
> details if this is actually still a problem you need to solve.

Thanks - as you say, it's not so much the actual problem as the
principle of what the packaging API offers that matters here. Although
it does make a good point - to what extent do the packaging APIs draw
on existing experience like that of pip? Given that tools like pip are
used widely to address real requirements, it would seem foolish to
*not* draw on that experience in designing a stdlib API.

(As regards my actual use, it's very much a "back burner" project of
mine - I keep dabbling with writing utilities to grab bdist_wininst
installers and unpack/install them in virtualenvs. The PackageFinder
class might well be useful there. I'll keep it in mind for the next
time I go back to that problem).

Paul.


More information about the Python-Dev mailing list