Skip to content

Commit 1719fc3

Browse files
committed
Merge spec->req constructors
Since both functions now return Optional[Requirement], we can just use the same implementation.
1 parent d5204dd commit 1719fc3

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def iter_dependencies(self):
445445
yield factory.make_requirement_from_candidate(self.base)
446446

447447
for r in self.base.dist.requires(valid_extras):
448-
requirement = factory.make_requirement_from_spec_matching_extras(
448+
requirement = factory.make_requirement_from_spec(
449449
str(r), self.base._ireq, valid_extras,
450450
)
451451
if requirement:

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,7 @@ def make_requirement_from_candidate(self, candidate):
256256
# type: (Candidate) -> ExplicitRequirement
257257
return ExplicitRequirement(candidate)
258258

259-
def make_requirement_from_spec(self, specifier, comes_from):
260-
# type: (str, InstallRequirement) -> Requirement
261-
ireq = self._make_install_req_from_spec(specifier, comes_from)
262-
return self.make_requirement_from_install_req(ireq, ())
263-
264-
def make_requirement_from_spec_matching_extras(
259+
def make_requirement_from_spec(
265260
self,
266261
specifier, # type: str
267262
comes_from, # type: InstallRequirement

0 commit comments

Comments
 (0)