We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c124a26 commit 8a62944Copy full SHA for 8a62944
importlib_metadata/__init__.py
@@ -199,8 +199,18 @@ def _discover_resolvers():
199
200
@classmethod
201
def find_local(cls):
202
+ return cls._from_pyproject() or cls._heuristic_local()
203
+
204
+ @staticmethod
205
+ def _from_pyproject():
206
+ with suppress(Exception):
207
+ from pep517.build_meta import build_meta_as_zip
208
+ return PathDistribution(build_meta_as_zip())
209
210
+ @classmethod
211
+ def _heuristic_local(cls):
212
dists = itertools.chain.from_iterable(
- resolver(path=['.'])
213
+ resolver(path=['.', 'src'])
214
for resolver in cls._discover_resolvers()
215
)
216
dist, = dists
0 commit comments