summaryrefslogtreecommitdiff
path: root/pkg_resources.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index 0792adba..1f9be67c 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -250,12 +250,12 @@ class AvailableDistributions(object):
if path is None:
path = sys.path
- requirements = list(requirements)[::1] # set up the stack
+ requirements = list(requirements)[::-1] # set up the stack
processed = {} # set of processed requirements
best = {} # key -> dist
+ to_install = []
while requirements:
-
req = requirements.pop()
if req in processed:
# Ignore cyclic or redundant dependencies
@@ -268,15 +268,16 @@ class AvailableDistributions(object):
dist = best[req.key] = self.best_match(req,path)
if dist is None:
raise DistributionNotFound(req) # XXX put more info here
+ to_install.append(dist)
- elif dist not in requirement:
+ elif dist not in req:
# Oops, the "best" so far conflicts with a dependency
raise VersionConflict(req,dist) # XXX put more info here
requirements.extend(dist.depends(req.options)[::-1])
processed[req] = True
- return best.values() # return list of distros to install
+ return to_install # return list of distros to install
def obtain(self, requirement):
@@ -284,7 +285,6 @@ class AvailableDistributions(object):
return None # override this in subclasses
-
class ResourceManager:
"""Manage resource extraction and packages"""
@@ -418,7 +418,6 @@ def require(*requirements):
* get_distro_source() isn't implemented
* Distribution.install_on() isn't implemented
- * AvailableDistributions.resolve() is untested
* AvailableDistributions.scan() is untested
There may be other things missing as well, but this definitely won't work
@@ -449,6 +448,7 @@ def require(*requirements):
+
class DefaultProvider:
"""Provides access to package resources in the filesystem"""