setup: show-tool-versions: emit more information about Python packages, and add Twist...
authorzooko <zooko@zooko.com>
Sat, 30 Oct 2010 06:44:59 +0000 (12:14 +0530)
committerzooko <zooko@zooko.com>
Sat, 30 Oct 2010 06:44:59 +0000 (12:14 +0530)
Ignore-this: 354f6311643ded0eb2eeba763485d43

darcs-hash:b9fd1c2cb20fb674bb4dcd9d3aac7dbdaf3e9b69

misc/build_helpers/show-tool-versions.py

index 26846c5d9944b1be2be4e3a62b0a3d3647d5d70e..b8f77478f2d39103c265dafab1bec0628a35051f 100755 (executable)
@@ -82,6 +82,17 @@ def print_py_pkg_ver(pkgname):
         traceback.print_exc(file=sys.stderr)
         sys.stderr.flush()
         pass
+    try:
+        __import__(pkgname)
+    except ImportError:
+        pass
+    else:
+        modobj = sys.modules.get(pkgname)
+        print pkgname + ' module: ' + str(modobj)
+        try:
+            print pkgname + ' __version__: ' + str(modobj.__version__)
+        except AttributeError:
+            pass
 
 print_platform()
 
@@ -102,3 +113,5 @@ print_py_pkg_ver('trialcoverage')
 print_py_pkg_ver('setuptools_trial')
 print_py_pkg_ver('setuptools_darcs')
 print_py_pkg_ver('darcsver')
+print_py_pkg_ver('twisted')
+print_py_pkg_ver('TwistedCore')