Previously we attempt to do some crazy things with import hooks
in order to attempt to automatically alias normally installed
dependencies as our vendored dependencies. This turned out to be
fairly fragile, so instead we'll manually patch sys.modules to
trigger the aliasing.
As part of this, we also drop support for the
PIP_NO_VENDOR_FOR_DOWNSTREAM environment variable because it was
never fully supported and now that we have wheel caching, actually
using it could possibly trigger a bad wheel to be cached. The new
mechanism requires some light patching by downstream to opt into
the mechanism, so they can also easily remove all of the files
in pip/_vendor/ except for __init__.py.
Using --install-options, --build-options, --global-options changes
the way that setup.py behaves, and isn't honoured by the wheel code.
The new wheel autobuilding code made this very obvious - disable
the use of wheels when these options are supplied.
With wheel autobuilding in place a release blocker is some granular
way to opt-out of wheels for known-bad packages. This patch introduces
two new options: --no-binary and --only-binary to control what
archives we are willing to use on both a global and per-package basis.
This also closes#2084
All uses but one of _package_versions want a list, and the last one
is not special in terms of memory footprint: just return a list from
_package_versions.
We currently recalculate safe_name on every archive we assess, and
with the upcoming per-package check for binary and source use we
either need to recalculate that too, or - as this patch does - hoist
this essentially static data out of the helper function innards into a
static data structure.
We can use the same sort algorithm always, as long as we don't add
wheels to the collection we can't ever select them. We need to have
the same sort algorithm always since we're getting rid of use_wheel,
and being much more sophisticated.
Because I saw this:
URLs to search for versions for setuptools:
Skipping link . (from -f); not a file
Skipping link /Users/marca/dev/git-repos/virtualenv (from -f); not a file
Skipping link /Users/marca/dev/git-repos/virtualenv/virtualenv_support (from -f); not a file
and I didn't know if there were no URLs to search or if the code was
buggy and it was forgetting to list them (it turned out to be the
former).