diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 5a4448e3f..ba3421b24 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -11,6 +11,7 @@ from click import progressbar from pip._internal.cache import WheelCache +from pip._internal.cli.cmdoptions import make_target_python from pip._internal.commands import create_command from pip._internal.commands.install import InstallCommand from pip._internal.index.package_finder import PackageFinder @@ -74,8 +75,9 @@ def __init__(self, pip_args: list[str], cache_dir: str): self._options: optparse.Values = options self._session = self.command._build_session(options) + target_python = make_target_python(options) self._finder = self.command._build_package_finder( - options=options, session=self.session + options=options, session=self.session, target_python=target_python ) # Caches