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

2 comments on commit 10a2dcb

@blueyed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atugushev
Just a heads up: passing require_hashes is done for pip 20 now, but has been refactored there already again: pypa/pip#7324 (0612685e).

@atugushev
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! That's fixed in #1024

Please sign in to comment.