(cls, parent=None)
| 1285 | |
| 1286 | @classmethod |
| 1287 | def discover(cls, parent=None): |
| 1288 | if parent is None: |
| 1289 | path = sys.path |
| 1290 | elif parent.submodule_search_locations is None: |
| 1291 | raise ValueError(f'{parent} is not a package module') |
| 1292 | else: |
| 1293 | path = parent.submodule_search_locations |
| 1294 | |
| 1295 | for entry in set(path): |
| 1296 | if not isinstance(entry, str): |
| 1297 | continue |
| 1298 | if (finder := cls._path_importer_cache(entry)) is None: |
| 1299 | continue |
| 1300 | if discover := getattr(finder, 'discover', None): |
| 1301 | yield from discover(parent) |
| 1302 | |
| 1303 | @staticmethod |
| 1304 | def find_distributions(*args, **kwargs): |
nothing calls this directly
no test coverage detected