|
30 | 30 | from .exceptions import PipToolsError |
31 | 31 | from .logging import log |
32 | 32 | from .utils import ( |
| 33 | + PIP_VERSION, |
33 | 34 | UNSAFE_PACKAGES, |
34 | 35 | as_tuple, |
35 | 36 | copy_install_requirement, |
@@ -605,17 +606,21 @@ def resolve(self, max_rounds: int = 10) -> set[InstallRequirement]: |
605 | 606 | } |
606 | 607 | preparer = self.command.make_requirement_preparer(**preparer_kwargs) |
607 | 608 |
|
608 | | - resolver = self.command.make_resolver( |
609 | | - preparer=preparer, |
610 | | - finder=self.finder, |
611 | | - options=self.options, |
612 | | - wheel_cache=wheel_cache, |
613 | | - use_user_site=False, |
614 | | - ignore_installed=True, |
615 | | - ignore_requires_python=False, |
616 | | - force_reinstall=False, |
617 | | - upgrade_strategy="to-satisfy-only", |
618 | | - ) |
| 609 | + resolver_kwargs = { |
| 610 | + "preparer": preparer, |
| 611 | + "finder": self.finder, |
| 612 | + "options": self.options, |
| 613 | + "wheel_cache": wheel_cache, |
| 614 | + "use_user_site": False, |
| 615 | + "ignore_installed": True, |
| 616 | + "ignore_requires_python": False, |
| 617 | + "force_reinstall": False, |
| 618 | + "upgrade_strategy": "to-satisfy-only", |
| 619 | + } |
| 620 | + if PIP_VERSION[:2] < (25, 3): |
| 621 | + # Ref: https://github.com/jazzband/pip-tools/issues/2252 |
| 622 | + resolver_kwargs["use_pep517"] = self.options.use_pep517 |
| 623 | + resolver = self.command.make_resolver(**resolver_kwargs) |
619 | 624 |
|
620 | 625 | self.command.trace_basic_info(self.finder) |
621 | 626 |
|
|
0 commit comments