From 9377fd4e9c324556d4be0cf256ca1a5e5515df55 Mon Sep 17 00:00:00 2001 From: James Baker Date: Wed, 23 Aug 2023 11:49:07 +0100 Subject: [PATCH 1/2] allow usage of universal2 wheels --- pep425.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pep425.nix b/pep425.nix index cfa16badd..7628b8bf5 100644 --- a/pep425.nix +++ b/pep425.nix @@ -105,8 +105,8 @@ let if stdenv.isDarwin then if stdenv.targetPlatform.isAarch64 - then (p: p == "any" || (hasInfix "macosx" p && lib.lists.any (e: hasSuffix e p) [ "arm64" "aarch64" ])) - else (p: p == "any" || (hasInfix "macosx" p && hasSuffix "x86_64" p)) + then (p: p == "any" || (hasInfix "macosx" p && lib.lists.any (e: hasSuffix e p) [ "arm64" "aarch64" "universal2" ])) + else (p: p == "any" || (hasInfix "macosx" p && lib.lists.any (e: hasSuffix e p) [ "x86_64" "universal2" ])) else (p: p == "any"); withPlatforms = x: lib.lists.any withPlatform (splitString "." x.platform); filterWheel = x: From a01aa57cfa48e8643e3693d644f6bdbcb87241e3 Mon Sep 17 00:00:00 2001 From: "james.baker@helsing.ai" Date: Thu, 26 Oct 2023 09:33:46 +0200 Subject: [PATCH 2/2] fix --- default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index e53090517..5351cecc9 100644 --- a/default.nix +++ b/default.nix @@ -58,7 +58,9 @@ let rawDeps = pyProject.tool.poetry."dependencies" or { }; - rawRequiredDeps = lib.filterAttrs (_: v: !(v.optional or false)) rawDeps; + isRequired = (dep: !((dep.optional or false) || (builtins.isList dep && !(lib.lists.any isRequired dep)))); + + rawRequiredDeps = lib.filterAttrs (_: v: isRequired v) rawDeps; desiredExtrasDeps = lib.unique (lib.concatMap (extra: pyProject.tool.poetry.extras.${extra}) extras);