diff options
-rw-r--r-- | pkg_resources.py | 2 | ||||
-rwxr-xr-x | pkg_resources.txt | 4 | ||||
-rw-r--r-- | setuptools/tests/test_resources.py | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index e03e104d..d2398cad 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -482,7 +482,7 @@ class WorkingSet(object): if dist is None: raise DistributionNotFound(req) # XXX put more info here to_activate.append(dist) - elif dist not in req: + if dist not in req: # Oops, the "best" so far conflicts with a dependency raise VersionConflict(dist,req) # XXX put more info here requirements.extend(dist.requires(req.extras)[::-1]) diff --git a/pkg_resources.txt b/pkg_resources.txt index 39dbfb87..e0bca237 100755 --- a/pkg_resources.txt +++ b/pkg_resources.txt @@ -1488,6 +1488,10 @@ File/Path Utilities Release Notes/Change History ---------------------------- +0.6a8 + * Fixed a problem with ``WorkingSet.resolve()`` that prevented version + conflicts from being detected at runtime. + 0.6a6 * Activated distributions are now inserted in ``sys.path`` (and the working set) just before the directory that contains them, instead of at the end. diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 16531de3..723bd730 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -125,7 +125,6 @@ class DistroTests(TestCase): ad = Environment([]); ws = WorkingSet([]) # Resolving no requirements -> nothing to install self.assertEqual( list(ws.resolve([],ad)), [] ) - # Request something not in the collection -> DistributionNotFound self.assertRaises( DistributionNotFound, ws.resolve, parse_requirements("Foo"), ad @@ -141,6 +140,8 @@ class DistroTests(TestCase): targets = list(ws.resolve(parse_requirements("Foo"), ad)) self.assertEqual(targets, [Foo]) map(ws.add,targets) + self.assertRaises(VersionConflict, ws.resolve, + parse_requirements("Foo==0.9"), ad) ws = WorkingSet([]) # reset # Request an extra that causes an unresolved dependency for "Baz" @@ -157,11 +158,10 @@ class DistroTests(TestCase): list(ws.resolve(parse_requirements("Foo[bar]"), ad)), [Foo,Baz] ) # Requests for conflicting versions produce VersionConflict - self.assertRaises( - VersionConflict, + self.assertRaises( VersionConflict, ws.resolve, parse_requirements("Foo==1.2\nFoo!=1.2"), ad ) - + def testDistroDependsOptions(self): d = self.distRequires(""" Twisted>=1.5 |