Last active
December 21, 2015 11:19
-
-
Save Qalthos/6298374 to your computer and use it in GitHub Desktop.
Get detailed dependency information from site packages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
from pprint import pprint as print | |
import pip | |
def get_all_package_dependencies(): | |
"""Return dictionary of installed packages to list of package dependencies.""" | |
return { | |
dist.key: [(r.key, r.specs) for r in dist.requires()] | |
for dist in pip.get_installed_distributions() | |
} | |
print(get_all_package_dependencies()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment