about summary refs log tree commit diff
path: root/pkgs/development/python-modules/keras/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/keras/default.nix')
-rw-r--r--pkgs/development/python-modules/keras/default.nix71
1 files changed, 48 insertions, 23 deletions
diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix
index 55deee586c8da..4882b45aa4c90 100644
--- a/pkgs/development/python-modules/keras/default.nix
+++ b/pkgs/development/python-modules/keras/default.nix
@@ -1,39 +1,64 @@
-{ lib, buildPythonPackage, fetchPypi
-, pytest, pytest-cov, pytest-xdist
-, six, numpy, scipy, pyyaml, h5py
-, keras-applications, keras-preprocessing
+{
+  lib,
+  buildPythonPackage,
+  pythonOlder,
+  fetchFromGitHub,
+  setuptools,
+  absl-py,
+  dm-tree,
+  h5py,
+  markdown-it-py,
+  ml-dtypes,
+  namex,
+  numpy,
+  optree,
+  rich,
+  tensorflow,
 }:
 
 buildPythonPackage rec {
   pname = "keras";
-  version = "3.2.1";
-  format = "wheel";
-
-  src = fetchPypi {
-    inherit format pname version;
-    hash = "sha256-C+HomwQeaXvlYthCLsuVjuVIGs/AiZEyAJJsVh0ligM=";
-    python = "py3";
-    dist = "py3";
+  version = "3.3.3";
+  pyproject = true;
+
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "keras-team";
+    repo = "keras";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-hhY28Ocv4zacZiwFflJtufKpeKfH1MD1PZJ+NTJfpH0=";
   };
 
-  nativeCheckInputs = [
-    pytest
-    pytest-cov
-    pytest-xdist
+  build-system = [
+    setuptools
+  ];
+
+  dependencies = [
+    absl-py
+    dm-tree
+    h5py
+    markdown-it-py
+    ml-dtypes
+    namex
+    numpy
+    optree
+    rich
+    tensorflow
   ];
 
-  propagatedBuildInputs = [
-    six pyyaml numpy scipy h5py
-    keras-applications keras-preprocessing
+  pythonImportsCheck = [
+    "keras"
+    "keras._tf_keras"
   ];
 
   # Couldn't get tests working
   doCheck = false;
 
-  meta = with lib; {
-    description = "Deep Learning library for Theano and TensorFlow";
+  meta = {
+    description = "Multi-backend implementation of the Keras API, with support for TensorFlow, JAX, and PyTorch";
     homepage = "https://keras.io";
-    license = licenses.mit;
-    maintainers = with maintainers; [ NikolaMandic ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ NikolaMandic ];
   };
 }