From: zooko <zooko@zooko.com>
Date: Sun, 1 Aug 2010 06:17:23 +0000 (+0530)
Subject: setup: tests require twisted and trialcoverage if the "--reporter=bwverbose-coverage... 
X-Git-Url: https://git.rkrishnan.org/Site/Content/Exhibitors/install-details.html?a=commitdiff_plain;h=6de7728e79135fe9e6614169c90d2eeba6322d90;p=tahoe-lafs%2Fzfec.git

setup: tests require twisted and trialcoverage if the "--reporter=bwverbose-coverage" argument is present

Ignore-this: 383b0c85a9b89f043acbe7dffa45674b

darcs-hash:8cf8f81977e6cfc54b272eaa94ea7cb4068a29ac
---

diff --git a/zfec/setup.cfg b/zfec/setup.cfg
index bf345ea..3b0349f 100644
--- a/zfec/setup.cfg
+++ b/zfec/setup.cfg
@@ -8,7 +8,7 @@ zip_ok=False
 
 [aliases]
 build = darcsver --count-all-patches build
-test = darcsver --count-all-patches test
+test = darcsver --count-all-patches trial
 sdist = darcsver --count-all-patches sdist
 install = darcsver --count-all-patches install
 bdist_egg = darcsver --count-all-patches bdist_egg
diff --git a/zfec/setup.py b/zfec/setup.py
index fcd470e..eb6291c 100755
--- a/zfec/setup.py
+++ b/zfec/setup.py
@@ -96,6 +96,9 @@ else:
         raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
 
 setup_requires = []
+tests_require = []
+
+tests_require.append("pyutil >= 1.3.19")
 
 # The darcsver command from the darcsver plugin is needed to initialize the
 # distribution's .version attribute correctly. (It does this either by
@@ -117,6 +120,14 @@ setup_requires.append('darcsver >= 1.2.0')
 # http://pypi.python.org/pypi/setuptools_darcs
 setup_requires.append('setuptools_darcs >= 1.1.0')
 
+# trialcoverage is required if you want the "trial" unit test runner to have a
+# "--reporter=bwverbose-coverage" option which produces code-coverage results.
+# The required version is 0.3.3, because that is the latest version that only
+# depends on a version of pycoverage for which binary packages are available.
+if "--reporter=bwverbose-coverage" in sys.argv:
+    tests_require.append('trialcoverage >= 0.3.3')
+    tests_require.append('twisted >= 2.4.0')
+
 # stdeb is required to build Debian dsc files.
 if "sdist_dsc" in sys.argv:
     setup_requires.append('stdeb')
@@ -138,7 +149,7 @@ def _setup(test_suite):
           url='http://allmydata.org/trac/'+PKG,
           license='GNU GPL',
           install_requires=["argparse >= 0.8", "pyutil >= 1.3.19"],
-          tests_require=["pyutil >= 1.3.19"],
+          tests_require=tests_require,
           packages=find_packages(),
           include_package_data=True,
           data_files=data_files,