Skip to content

Commit 0b59b51

Browse files
astrofrogDEKHTIARJonathan
authored andcommitted
Adjust Factory._make_requirements_from_install_req to take into account default extras if present and if extras not specified
1 parent 058e643 commit 0b59b51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ def _make_requirements_from_install_req(
504504
name=canonicalize_name(ireq.name) if ireq.name else None,
505505
version=None,
506506
)
507+
508+
extras = ireq.extras or list(cand.dist.iter_default_extras())
509+
507510
if cand is None:
508511
# There's no way we can satisfy a URL requirement if the underlying
509512
# candidate fails to build. An unnamed URL must be user-supplied, so
@@ -517,10 +520,10 @@ def _make_requirements_from_install_req(
517520
else:
518521
# require the base from the link
519522
yield self.make_requirement_from_candidate(cand)
520-
if ireq.extras:
523+
if extras:
521524
# require the extras on top of the base candidate
522525
yield self.make_requirement_from_candidate(
523-
self._make_extras_candidate(cand, frozenset(ireq.extras))
526+
self._make_extras_candidate(cand, frozenset(extras))
524527
)
525528

526529
def collect_root_requirements(

0 commit comments

Comments
 (0)