Certain environments seem to be leaving behind empty folders in this
directory -- There was an older pip release that included a source/
folder here which isn't getting deleted for some reason. I have not
figured out the root cause why this happens yet. This is resulting in
ImportErrors since Python imports have a higher precedence for packages
compared to modules.
This commit changes the name we're trying to import from, which should
help prevent this mode of failure.
We now extract all metadata files from the wheel directly into memory
and make them available to the wrapping pkg_resources.Distribution via
the DictMetadata introduced earlier.
Why: Based on some more experience from refactoring metadata generation,
it became clear to me that the separation of legacy vs modern codepaths
should happen at lower level than this abstraction.
Also, create a new utility function for showing a spinner when running
a subprocess.
Why: The subprocess_runner API was specifically added to make it
possible for pip to stop monkey-patching Pep517HookCaller, while still
maintaining its output style. The relevant monkeypatch will be removed
in a follow up commit.
This moves the DistAbstraction logic into a dedicated 'distributions'
sub-package, with separated modules for the concrete implementations of
various distribution handling logic.