diff options
author | PJ Eby <distutils-sig@python.org> | 2005-09-26 00:35:35 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-09-26 00:35:35 +0000 |
commit | cbbc6e760110c451210433ee4a89354128ca8680 (patch) | |
tree | 52eee49f6283b33e11c58d7c8871420991a9b96e /pkg_resources.py | |
parent | 20e9f30cb2de19a4d4cdc1aa53e07efc9c34bcb0 (diff) | |
download | external_python_setuptools-cbbc6e760110c451210433ee4a89354128ca8680.tar.gz external_python_setuptools-cbbc6e760110c451210433ee4a89354128ca8680.tar.bz2 external_python_setuptools-cbbc6e760110c451210433ee4a89354128ca8680.zip |
Ensure that WorkingSet.resolve() (and therefore require() as well)
returns a list of the relevant distributions, even if they are found in
the working set rather than the environment. This fixes some problems
in the 0.6a3 release.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041256
Diffstat (limited to 'pkg_resources.py')
-rw-r--r-- | pkg_resources.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 15dca3c1..f946fc4e 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -463,7 +463,7 @@ class WorkingSet(object): requirements = list(requirements)[::-1] # set up the stack processed = {} # set of processed requirements - best = dict([(d.key,d) for d in self]) # key -> dist + best = {} # key -> dist to_activate = [] while requirements: @@ -471,20 +471,20 @@ class WorkingSet(object): if req in processed: # Ignore cyclic or redundant dependencies continue - dist = best.get(req.key) if dist is None: # Find the best distribution and add it to the map - if env is None: - env = Environment(self.entries) - dist = best[req.key] = env.best_match(req, self, installer) + dist = self.by_key.get(req.key) if dist is None: - raise DistributionNotFound(req) # XXX put more info here + if env is None: + env = Environment(self.entries) + dist = best[req.key] = env.best_match(req, self, installer) + if dist is None: + raise DistributionNotFound(req) # XXX put more info here to_activate.append(dist) elif 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]) processed[req] = True |