pypa/pip — pull request #2114 by bukzor (2014-11-04 02:20:52+00:00)
Title: attempt an optimistic localhost-only search for "==" requirements

This is mostly for discussion.

In our very large project (>300 requirements) we're finding that the round-trips to the pypi server make the pip portion of our build frustratingly slow, even though we've ensured that all wheels are built and available on local disk.

Here I attempt to leverage the fact that there's no need to talk to the pypi server if we have a == requirement and a match is found locally.

There's two parts of this implementation that are (probably) objectionable, and I'd like advise on how to implement them more cleanly:

1. _find_requirement is called twice in the case of a package with pinned version, not found locally. This results in a series of messages "Do distributions at all found for foolib! Downloading foolib. Unpacking foolib. Successfully installed foolib."
2. The fake html page (line 751). This doesn't seem to cause any problems, but does seem like a pretty terrible hack.

On the other hand, if you don't mind these problems as much as I do, don't let me stop you from pulling :)