Lib/importlib/metadata/diagnose.py
raw| 1 | import sys |
| 2 | |
| 3 | from . import Distribution |
| 4 | |
| 5 | |
| 6 | def inspect(path): |
| 7 | print("Inspecting", path) |
| 8 | dists = list(Distribution.discover(path=[path])) |
| 9 | if not dists: |
| 10 | return |
| 11 | print("Found", len(dists), "packages:", end=' ') |
| 12 | print(', '.join(dist.name for dist in dists)) |
| 13 | |
| 14 | |
| 15 | def run(): |
| 16 | for path in sys.path: |
| 17 | inspect(path) |
| 18 | |
| 19 | |
| 20 | if __name__ == '__main__': |
| 21 | run() |