From 615d0393cd27694b0a08b9e98b07ee73731aa0a8 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 19 Apr 2025 09:21:05 +0100 Subject: [PATCH] python3Packages.ray: fix `optional-dependencies.all` eval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change the eval fails as: nix-repl> python3Packages.ray.optional-dependencies.all error: … while evaluating the attribute 'ray.optional-dependencies.all' at pkgs/development/python-modules/ray/default.nix:145:5: 144| air = lib.unique (data ++ serve ++ tune ++ train); 145| all = lib.flatten (builtins.attrValues optional-dependencies); | ^ 146| cgraph = [ … while calling the 'concatMap' builtin at nixpkgs-master/lib/lists.nix:437:33: 436| */ 437| flatten = x: if isList x then concatMap (y: flatten y) x else [ x ]; | ^ 438| (stack trace truncated; use '--show-trace' to show the full, detailed trace) --- .../python-modules/ray/default.nix | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/ray/default.nix b/pkgs/development/python-modules/ray/default.nix index c824c2747c92..b01b62fc31b7 100644 --- a/pkgs/development/python-modules/ray/default.nix +++ b/pkgs/development/python-modules/ray/default.nix @@ -139,10 +139,22 @@ buildPythonPackage rec { watchfiles ]; - optional-dependencies = rec { - adag = cgraph; - air = lib.unique (data ++ serve ++ tune ++ train); - all = lib.flatten (builtins.attrValues optional-dependencies); + optional-dependencies = lib.fix (self: { + adag = self.cgraph; + air = lib.unique (self.data ++ self.serve ++ self.tune ++ self.train); + all = lib.unique ( + self.adag + ++ self.air + ++ self.cgraph + ++ self.client + ++ self.data + ++ self.default + ++ self.observability + ++ self.rllib + ++ self.serve + ++ self.train + ++ self.tune + ); cgraph = [ cupy ]; @@ -190,16 +202,16 @@ buildPythonPackage rec { uvicorn watchfiles ] - ++ default + ++ self.default ); serve-grpc = lib.unique ( [ grpcio pyopenssl ] - ++ serve + ++ self.serve ); - train = tune; + train = self.tune; tune = [ fsspec pandas @@ -207,7 +219,7 @@ buildPythonPackage rec { requests tensorboardx ]; - }; + }); postInstall = '' chmod +x $out/${python.sitePackages}/ray/core/src/ray/{gcs/gcs_server,raylet/raylet}