Simpler integration
As suggested in option (1) from #88 (closed), this change proposes to move the functionality of PathFinder.find_distributions back into importlib.metadata and simply change PathFinder.find_distributions into a minimal proxy:
@classmethod
def find_distributions(cls, *args, **kwargs):
"""
Find distributions.
Return an iterable of all Distribution instances capable of
loading the metadata for packages matching ``context.name``
(or all names if ``None`` indicated) along the paths in the list
of directories ``context.path``.
"""
import importlib.metadata
return importlib.metadata.MetadataPathFinder.find_distributions(*args, **kwargs)
This change would minimize the flux on _bootstrap_external.py and the conflicts that creates in the generated files. It also avoids the awkward late imports and aligns the code more nicely with the importlib_metadata, while still retaining the naturally installed by default behavior of the PathFinder.
Note, this change is to the cpython branch only and does not affect importlib_metadata.
Edited by Jason R. Coombs