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)