1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Use is_direct rather than an explicit root parameter

This commit is contained in:
Paul Moore 2020-04-24 14:29:34 +01:00
parent 04bf571521
commit 7a54b2b3a8
2 changed files with 4 additions and 4 deletions

View file

@ -166,9 +166,9 @@ class Factory(object):
parent=ireq,
)
def make_requirement_from_install_req(self, ireq, root=False):
# type: (InstallRequirement, bool) -> Requirement
if root and ireq.name:
def make_requirement_from_install_req(self, ireq):
# type: (InstallRequirement) -> Requirement
if ireq.is_direct and ireq.name:
self.root_reqs.add(canonicalize_name(ireq.name))
if ireq.link:

View file

@ -73,7 +73,7 @@ class Resolver(BaseResolver):
resolver = RLResolver(provider, reporter)
requirements = [
self.factory.make_requirement_from_install_req(r, root=True)
self.factory.make_requirement_from_install_req(r)
for r in root_reqs
]