setup: show code-coverage tool versions in show-tools-versions.py

This commit is contained in:
Zooko O'Whielacronx 2010-05-09 23:29:55 -07:00
parent 82b9b91775
commit 77189291c4

View File

@ -73,3 +73,28 @@ try:
except EnvironmentError, le:
sys.stderr.write("Got exception invoking 'darcs': %s" % (le,))
pass
try:
import pkg_resources
out = str(pkg_resources.require("coverage"))
print
print "coverage:", out.replace("\n", " ")
except (ImportError, EnvironmentError), le:
sys.stderr.write("Got exception using 'pkg_resources' to get the version of coverage: %s" % (le,))
pass
except pkg_resources.DistributionNotFound, le:
sys.stderr.write("pkg_resources reported no trialcoverage package installed: %s" % (le,))
pass
try:
import pkg_resources
out = str(pkg_resources.require("trialcoverage"))
print
print "trialcoverage:", out.replace("\n", " ")
except (ImportError, EnvironmentError), le:
sys.stderr.write("Got exception using 'pkg_resources' to get the version of trialcoverage: %s" % (le,))
pass
except pkg_resources.DistributionNotFound, le:
sys.stderr.write("pkg_resources reported no trialcoverage package installed: %s" % (le,))
pass