From 10a2dcb83598986c2ada19baaa5d7312a1324523 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Sun, 20 Oct 2019 23:24:39 +0700 Subject: [PATCH] Move require_hashes to Resolver._resolve_one() See: https://github.com/pypa/pip/pull/7068 --- piptools/repositories/pypi.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 588a8dc23..9a81ec9fe 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -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)