Skip to content

Commit

Permalink
Move require_hashes to Resolver._resolve_one()
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Oct 20, 2019
1 parent 6cc924a commit 10a2dcb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,16 @@ def resolve_reqs(self, download_dir, ireq, wheel_cache):
reqset = RequirementSet()
ireq.is_direct = True
reqset.add_requirement(ireq)

resolver = PipResolver(**resolver_kwargs)
resolver.require_hashes = False
results = resolver._resolve_one(reqset, ireq)
require_hashes = False
if PIP_VERSION < (19, 4):
resolver.require_hashes = require_hashes
results = resolver._resolve_one(reqset, ireq)
else: # pragma: no cover
# TODO remove pragma after pip==19.4 being released
results = resolver._resolve_one(reqset, ireq, require_hashes)

reqset.cleanup_files()

return set(results)
Expand Down

0 comments on commit 10a2dcb

Please sign in to comment.