[fix] Use only ws.find in install
Replace `pkg_resources.Environment(ws.entries).best_match(req, ws)` with `ws.find(req)`. The first already starts by calling `ws.find(req)` to attempt to find an already activated dist in the working set, but if none is found it then proceeds to scan through the entries of the environment - i.e. the entries of the working set, `ws.entries` - to activate a dist at these locations if one matches. This is problematic if a dist from site-packages is in the working set at this stage: this will consider site-packages over eggs installed in .eggs, seemingly randomly depending on what dists are requested and whether they are found in site-packages. Also when calling `install(['zc.buildout'])` to resolve the dists of buildout and its dependencies currently running there are no version pins yet, so if `zc.buildout` comes from site-packages and specific versions of its dependencies come from `.eggs` but other versions exist in site-packages, then the dists from site-packages would be found instead of the actually running dists from `.eggs`.
Showing
Please register or sign in to comment