Commit 615d0393 authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

python3Packages.ray: fix `optional-dependencies.all` eval

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)
parent bb884bb8
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -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}