Fix optional dependencies being presolved

This commit is contained in:
rubenwardy 2022-01-08 22:29:02 +00:00
parent 33d9ab4b86
commit ca0823c460

@ -103,7 +103,7 @@ def resolve_package_deps(out, package, only_hard, depth=1):
name = dep.meta_package.name
fulfilled_by = [ pkg.getId() for pkg in dep.meta_package.packages]
if depth == 1:
if depth == 1 and not dep.optional:
most_likely = next((pkg for pkg in dep.meta_package.packages if pkg.type == PackageType.MOD), None)
if most_likely:
resolve_package_deps(out, most_likely, only_hard, depth + 1)