From 77189291c40c9074d895399ae21274e10ea4e94f Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx <zooko@zooko.com> Date: Sun, 9 May 2010 23:29:55 -0700 Subject: [PATCH] setup: show code-coverage tool versions in show-tools-versions.py --- misc/show-tool-versions.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/misc/show-tool-versions.py b/misc/show-tool-versions.py index ee111dc3..7f1e84db 100644 --- a/misc/show-tool-versions.py +++ b/misc/show-tool-versions.py @@ -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 + -- 2.45.2