Skip to content

Instantly share code, notes, and snippets.

@aodag
Created February 14, 2015 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aodag/78cca8a64f2678a4e182 to your computer and use it in GitHub Desktop.
Save aodag/78cca8a64f2678a4e182 to your computer and use it in GitHub Desktop.
指定パッケージと依存ライブラリのインストールバージョンを確認するスクリプト。現在のwheelがpydist.jsonでなくpackage.jsonを作るのでパッチを当てる。
import sys
from pprint import pprint
import distlib.database
dist_name = sys.argv[1]
dist_path = distlib.database.DistributionPath(include_egg=True)
dists = list(dist_path.get_distributions())
dist = dist_path.get_distribution(dist_name)
if dist is None:
print("%s is not installed" % dist_name)
sys.exit()
graph = distlib.database.make_graph(dists)
deps = graph.adjacency_list[dist]
print(graph.repr_node(dist))
diff -r 471427909ebb distlib/metadata.py
--- a/distlib/metadata.py Fri Feb 13 20:01:09 2015 +0000
+++ b/distlib/metadata.py Sat Feb 14 18:17:44 2015 +0900
@@ -616,7 +616,8 @@
self.version)
-METADATA_FILENAME = 'pydist.json'
+# METADATA_FILENAME = 'pydist.json'
+METADATA_FILENAME = 'metadata.json'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment