def distributions(path: list[str]) -> Iterable[im.Distribution]:
    """Find distributions in the paths. Similar to `importlib.metadata`'s
    implementation but with the ability to discover egg-links.
    """
    context = im.DistributionFinder.Context(path=path)
    resolvers = itertools.chain(
        filter(
            None,
            (getattr(finder, "find_distributions", None) for finder in sys.meta_path),
        ),
        (EgglinkFinder.find_distributions,),
    )
    return itertools.chain.from_iterable(resolver(context) for resolver in resolvers)
Find distributions in the paths. Similar to `importlib.metadata`'s
    implementation but with the ability to discover egg-links.
    
src/pdm/models/working_set.py