Skip to content

Commit

Permalink
Incorporate changes from #666 (comment)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan@danryan.co>
  • Loading branch information
techalchemy committed Aug 4, 2018
1 parent b2ab11b commit 1db139c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def resolve_reqs(self, download_dir, ireq):
preparer = RequirementPreparer(**preparer_kwargs)
resolver_kwargs['preparer'] = preparer
resolver = PipResolver(**resolver_kwargs)
resolver.resolve(reqset)
results = reqset.requirements.values()
resolver.require_hashes = False
results = resolver._resolve_one(reqset, ireq)
reqset.cleanup_files()
finally:
if 'PIP_REQ_TRACKER' in os.environ:
Expand Down Expand Up @@ -217,7 +217,11 @@ def get_dependencies(self, ireq):
if not os.path.isdir(self._wheel_download_dir):
os.makedirs(self._wheel_download_dir)

self._dependencies_cache[ireq] = self.resolve_reqs(download_dir, ireq)
try:
self._dependencies_cache[ireq] = self.resolve_reqs(download_dir, ireq)
finally:
if callable(getattr(self.wheel_cache, 'cleanup', None)):
self.wheel_cache.cleanup()
return set(self._dependencies_cache[ireq])

def get_hashes(self, ireq):
Expand Down

0 comments on commit 1db139c

Please sign in to comment.