aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/importlib-metadata/py3/importlib_metadata/diagnose.py
blob: e405471ac4d94371b1ee9b1622227ff76b337180 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import sys

from . import Distribution


def inspect(path):
    print("Inspecting", path)
    dists = list(Distribution.discover(path=[path]))
    if not dists:
        return
    print("Found", len(dists), "packages:", end=' ')
    print(', '.join(dist.name for dist in dists))


def run():
    for path in sys.path:
        inspect(path)


if __name__ == '__main__':
    run()