From ca0823c4602f1da1d2cb971a9242ddca79cbdfca Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 8 Jan 2022 22:29:02 +0000 Subject: [PATCH] Fix optional dependencies being presolved --- app/blueprints/api/endpoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/blueprints/api/endpoints.py b/app/blueprints/api/endpoints.py index 54d739a6..a433851d 100644 --- a/app/blueprints/api/endpoints.py +++ b/app/blueprints/api/endpoints.py @@ -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)