diff options
author | Pradyun S. Gedam <pradyunsg@gmail.com> | 2017-05-31 15:11:17 +0530 |
---|---|---|
committer | Pradyun S. Gedam <pradyunsg@gmail.com> | 2017-05-31 15:11:17 +0530 |
commit | a2447ff19b7a810145920b2bea37616047c1ff65 (patch) | |
tree | f8f0099ecd9defadfcd4f8ac1bfe00f63f82a5fb /pip/resolve.py | |
parent | d6d26a5f14857ccf2e49c34df570d0687d6fbc2b (diff) | |
download | pip-a2447ff19b7a810145920b2bea37616047c1ff65.tar.gz |
Make finder an initialization argument
Diffstat (limited to 'pip/resolve.py')
-rw-r--r-- | pip/resolve.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pip/resolve.py b/pip/resolve.py index e0bfae7d4..1dac8b520 100644 --- a/pip/resolve.py +++ b/pip/resolve.py @@ -123,12 +123,13 @@ class Resolver(object): the requested operation without breaking the requirements of any package. """ - def __init__(self, upgrade_strategy): + def __init__(self, upgrade_strategy, finder): super(Resolver, self).__init__() assert upgrade_strategy in ["eager", "only-if-needed", "not-allowed"] self.upgrade_strategy = upgrade_strategy + self.finder = finder - def resolve(self, requirement_set, finder): + def resolve(self, requirement_set): """Resolve what operations need to be done As a side-effect of this method, the packages (and their dependencies) @@ -163,7 +164,6 @@ class Resolver(object): try: discovered_reqs.extend(self._resolve_one( requirement_set, - finder, req, require_hashes=require_hashes, ignore_dependencies=requirement_set.ignore_dependencies)) @@ -215,7 +215,7 @@ class Resolver(object): # its handled way down. if not (requirement_set.force_reinstall or req_to_install.link): try: - finder.find_requirement( + self.finder.find_requirement( req_to_install, upgrade_allowed) except BestVersionAlreadyInstalled: best_installed = True @@ -247,7 +247,7 @@ class Resolver(object): else: return None - def _resolve_one(self, requirement_set, finder, req_to_install, + def _resolve_one(self, requirement_set, req_to_install, require_hashes=False, ignore_dependencies=False): """Prepare a single requirements file. @@ -339,7 +339,7 @@ class Resolver(object): % (req_to_install, req_to_install.source_dir) ) req_to_install.populate_link( - finder, + self.finder, self._is_upgrade_allowed(req_to_install), require_hashes ) @@ -460,7 +460,7 @@ class Resolver(object): # # parse dependencies # # # ###################### # - dist = abstract_dist.dist(finder) + dist = abstract_dist.dist(self.finder) try: check_dist_requires_python(dist) except UnsupportedPythonVersion as err: |