[Checkins] SVN: z3c.recipe.compattest/trunk/ - Fixed bug in using exclude (.remove on a set() doesn't work).

Reinout van Rees reinout at vanrees.org
Mon Dec 14 13:46:47 EST 2009


Log message for revision 106501:
  - Fixed bug in using exclude (.remove on a set() doesn't work).
  - Added test to make sure it doesn't happen again.
  - Added normalization for setuptools/distribute difference.
  

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

-=-
Modified: z3c.recipe.compattest/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.compattest/trunk/CHANGES.txt	2009-12-14 18:11:20 UTC (rev 106500)
+++ z3c.recipe.compattest/trunk/CHANGES.txt	2009-12-14 18:46:46 UTC (rev 106501)
@@ -5,7 +5,8 @@
 0.13 (unreleased)
 =================
 
-- Nothing changed yet.
+- Fixed bug in using exclude introduced in 0.12 (including test to make sure
+  it doesn't happen again).
 
 
 0.12 (2009-12-14)

Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt
===================================================================
--- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt	2009-12-14 18:11:20 UTC (rev 106500)
+++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/README.txt	2009-12-14 18:46:46 UTC (rev 106501)
@@ -85,7 +85,33 @@
 - compattest-zc.buildout
 - compattest-zc.recipe.testrunner
 
+And if you want to exclude one of the automatically included dependencies, use
+the ``exclude`` option:
 
+>>> write('buildout.cfg', """
+... [buildout]
+... parts = compattest
+...
+... [compattest]
+... recipe = z3c.recipe.compattest
+... include-dependencies = z3c.recipe.compattest
+... exclude = zc.buildout
+... """)
+>>> print 'start', system(buildout)
+start ...
+Generated script '/sample-buildout/bin/compattest'.
+
+``bin/compattest-zc.buildout`` is now missing:
+
+>>> ls('bin')
+- buildout
+- compattest
+- compattest-setuptools
+- compattest-z3c.recipe.compattest
+- compattest-zc.recipe.testrunner
+
+
+
 Passing options to the test runners
 ===================================
 

Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py
===================================================================
--- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py	2009-12-14 18:11:20 UTC (rev 106500)
+++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/recipe.py	2009-12-14 18:46:46 UTC (rev 106501)
@@ -97,7 +97,7 @@
 
     def _wanted_packages(self):
         projects = self.include + self._find_dependencies()
-        projects = set(projects) # Filter out duplicates.
+        projects = list(set(projects)) # Filter out duplicates.
         for project in projects:
             for regex in self.exclude:
                 if re.compile(regex).search(project):

Modified: z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/testing.py
===================================================================
--- z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/testing.py	2009-12-14 18:11:20 UTC (rev 106500)
+++ z3c.recipe.compattest/trunk/src/z3c/recipe/compattest/testing.py	2009-12-14 18:46:46 UTC (rev 106501)
@@ -8,6 +8,13 @@
     re.compile('(\n?)-  ([a-zA-Z0-9_.-]+)-script.py\n-  \\2.exe\n'),
     '\\1-  \\2\n')
 
+# Distribute does not result in a setuptools compattest binary, so filter that
+# out.
+normalize_setuptools = (
+    re.compile('- compattest-setuptools\n'),
+    '')
+
+
 def DocFileSuite(*args, **kw):
     def setUp(test):
         zc.buildout.testing.buildoutSetUp(test)
@@ -30,8 +37,9 @@
     kw['optionflags'] = (doctest.ELLIPSIS
                          | doctest.NORMALIZE_WHITESPACE)
     kw['checker'] = renormalizing.RENormalizing([
-               zc.buildout.testing.normalize_path,
-               normalize_script,
-               ])
+        zc.buildout.testing.normalize_path,
+        normalize_script,
+        normalize_setuptools,
+        ])
 
     return doctest.DocFileSuite(*args, **kw)



More information about the checkins mailing list