Skip to content

Commit d3e9126

Browse files
committed
Implement find_distributions for _BackendPathFinder
1 parent 721d2ee commit d3e9126

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pyproject_hooks/_in_process/_in_process.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def find_spec(self, fullname, _path, _target=None):
106106

107107
return spec
108108

109+
def find_distributions(self, context=None):
110+
# Delayed import: Python 3.7 does not contain importlib.metadata
111+
from importlib.metadata import DistributionFinder, MetadataPathFinder
112+
113+
context = DistributionFinder.Context(path=self.backend_path)
114+
return MetadataPathFinder.find_distributions(context=context)
115+
109116

110117
def _supported_features():
111118
"""Return the list of options features supported by the backend.

0 commit comments

Comments
 (0)