[Checkins] SVN: z3c.recipe.compattest/trunk/ Always enable all extras for packages under test.

Christian Theune ct at gocept.com
Thu Jan 29 05:24:21 EST 2009


Log message for revision 95397:
  Always enable all extras for packages under test.
  

Changed:
  U   z3c.recipe.compattest/trunk/CHANGES.txt
  U   z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py

-=-
Modified: z3c.recipe.compattest/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.compattest/trunk/CHANGES.txt	2009-01-29 10:12:53 UTC (rev 95396)
+++ z3c.recipe.compattest/trunk/CHANGES.txt	2009-01-29 10:24:21 UTC (rev 95397)
@@ -5,7 +5,7 @@
 0.6 (unreleased)
 ================
 
-- ...
+- Always enable all extras of packages under test.
 
 0.5 (2009-01-29)
 ================

Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py
===================================================================
--- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py	2009-01-29 10:12:53 UTC (rev 95396)
+++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py	2009-01-29 10:24:21 UTC (rev 95397)
@@ -95,7 +95,9 @@
         installed = []
         for package in self.wanted_packages:
             try:
-                needs_test = self._needs_test_dependencies(package)
+                ws = self._working_set(package)
+                package_ = ws.find(pkg_resources.Requirement.parse(package))
+                extras = '[' + ','.join(package_.extras) + ']'
             except zc.buildout.easy_install.MissingDistribution, e:
                 if e.data[0].project_name == package and not self.use_svn:
                     # This package has a project in subversion but no
@@ -103,11 +105,7 @@
                     print "No release found for %s. Ignoring." % package
                     continue
                 raise
-            if needs_test:
-                extra = ' [test]'
-            else:
-                extra = ''
-            options = dict(eggs=package + extra)
+            options = dict(eggs=package + extras)
             recipe = zc.recipe.testrunner.TestRunner(
                 self.buildout, '%s-%s' % (self.name, package), options)
             installed.extend(recipe.install())
@@ -144,11 +142,6 @@
                 projects.append(project)
         return projects
 
-    def _needs_test_dependencies(self, package):
-        ws = self._working_set(package)
-        package = ws.find(pkg_resources.Requirement.parse(package))
-        return 'test' in package.extras
-
     def _working_set(self, package):
         eggs = zc.recipe.egg.Egg(self.buildout, self.name, dict(eggs=package))
         _, ws = eggs.working_set()



More information about the Checkins mailing list