summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinout van Rees <reinout@vanrees.org>2009-10-14 15:22:44 +0200
committerReinout van Rees <reinout@vanrees.org>2009-10-14 15:22:44 +0200
commit03a95e191c1e128a04911ae415a36cbcb6ab1901 (patch)
tree7e882ad4026949441a43528aeee89e89a5816474
parentdd2b4ffb2f582bf8270c0ceed490bf035a9e553b (diff)
downloadpython-setuptools-git-03a95e191c1e128a04911ae415a36cbcb6ab1901.tar.gz
an error is raised when installing a 0.7 setuptools with distribute
--HG-- branch : distribute extra : rebase_source : f68fe9818972a09d858f2bb59ef47682353f600d
-rw-r--r--CHANGES.txt3
-rw-r--r--pkg_resources.py7
-rw-r--r--setuptools/tests/test_resources.py19
3 files changed, 22 insertions, 7 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 73a10b36..3229a831 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,7 +7,8 @@ CHANGES
-----
* 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.
diff --git a/pkg_resources.py b/pkg_resources.py
index 510be536..c0371864 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -2239,8 +2239,11 @@ class Distribution(object):
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
diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py
index c9236e88..6a89e8a8 100644
--- a/setuptools/tests/test_resources.py
+++ b/setuptools/tests/test_resources.py
@@ -187,10 +187,21 @@ class DistroTests(TestCase):
)
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)