Skip to content

Commit 2bbf7b4

Browse files
committed
Check Requires-Python before other dependencies
This makes the resolver fail quicker when there's a interpreter version conflict, and avoid additional (useless) downloads.
1 parent e6414d6 commit 2bbf7b4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

news/9925.feature.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
New resolver: A distribution's ``Requires-Python`` metadata is now checked
2+
before its Python dependencies. This makes the resolver fail quicker when
3+
there's a interpreter version conflict.

src/pip/_internal/resolution/resolvelib/candidates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ def _get_requires_python_dependency(self):
256256

257257
def iter_dependencies(self, with_requires):
258258
# type: (bool) -> Iterable[Optional[Requirement]]
259+
yield self._get_requires_python_dependency()
259260
requires = self.dist.requires() if with_requires else ()
260261
for r in requires:
261262
yield self._factory.make_requirement_from_spec(str(r), self._ireq)
262-
yield self._get_requires_python_dependency()
263263

264264
def get_install_requirement(self):
265265
# type: () -> Optional[InstallRequirement]

0 commit comments

Comments
 (0)