From 7416e44047378476703aeef328f3cd19ba666a27 Mon Sep 17 00:00:00 2001 From: phaer Date: Fri, 7 Apr 2023 01:15:10 +0200 Subject: [PATCH] fix(fetchPipMetadata): fix requirements... ...using a map() instead of list-comprehension resulted in an iterator which was consumed in the first branch of our dependency tree where it was encountered, resulting in an empty set of requirements in other branches. --- v1/nix/pkgs/fetchPipMetadata/fetchPipMetadata.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v1/nix/pkgs/fetchPipMetadata/fetchPipMetadata.py b/v1/nix/pkgs/fetchPipMetadata/fetchPipMetadata.py index d09040c6..5b71830f 100644 --- a/v1/nix/pkgs/fetchPipMetadata/fetchPipMetadata.py +++ b/v1/nix/pkgs/fetchPipMetadata/fetchPipMetadata.py @@ -289,15 +289,15 @@ def lock_file_from_report(report): # packages in the report are a list, so we cache their requirement # strings in a list for faster lookups while we walk the tree below. requirements = dict() - # iterate over all packages pip installed to find roots # of the tree and gather basic information, such as urls for install in report["install"]: name, package = lock_entry_from_report_entry(install) packages[name] = package - requirements[name] = map( - Requirement, install["metadata"].get("requires_dist", []) - ) + requirements[name] = [ + Requirement(r) + for r in install["metadata"].get("requires_dist", []) # noqa: 501 + ] if install.get("requested", False): roots[name] = install.get("requested_extras", set())