Commits

Reinout van Rees committed fdbd5d1

an error is raised when installing a 0.7 setuptools with distribute

Comments (0)

Files changed (3)

 -----
 
 * Distribute no longer shadows setuptools if we require a 0.7-series
-  setuptools. 
+  setuptools.  And an error is raised when installing a 0.7 setuptools with
+  distribute.
 
 * When run from within buildout, no attempt is made to modify an existing
   setuptools egg, whether in a shared egg directory or a system setuptools.
 
         loc = loc or self.location
 
-        # TODO: raise error if we're adding setuptools >= 0.7 as that is
-        # guaranteed to be incompatible with distribute.
+        if self.project_name == 'setuptools':
+            if '0.7' in self.version:
+                raise ValueError(
+                    "A 0.7-series setuptools cannot be installed "
+                    "with distribute")
 
         if not loc:
             return

setuptools/tests/test_resources.py

         )
         self.assertRaises(UnknownExtra, d.requires, ["foo"])
 
-
-
-
-
+    def testSetuptoolsDistributeCombination(self):
+        # Ensure that installing a 0.7-series setuptools fails.  PJE says that
+        # it will not co-exist.
+        ws = WorkingSet([])
+        d = Distribution(
+            "/some/path",
+            project_name="setuptools",
+            version="0.7a1")
+        self.assertRaises(ValueError, ws.add, d)
+        # A 0.6-series is no problem
+        d2 = Distribution(
+            "/some/path",
+            project_name="setuptools",
+            version="0.6c9")
+        ws.add(d2)