Skip to content

Commit b3918e7

Browse files
committed
Added diagnose script. Closes #461.
1 parent 4e118be commit b3918e7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

importlib_metadata/diagnose.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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()

newsfragments/461.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added diagnose script.

0 commit comments

Comments
 (0)