about summary refs log tree commit diff
diff options
context:
space:
mode:
authornicoo <nicoo@debian.org>2024-05-13 09:20:54 +0000
committerGitHub <noreply@github.com>2024-05-13 09:20:54 +0000
commit2b598dee5f450c635f848fe9fca4ffa049d1e896 (patch)
treeb5c9616ec860e2f06ca019978ce92567a72731dc
parenteb950ffb836c3f95bf532649b246d1d1187a73ee (diff)
parente1476ef1535f8eed849bd0115dd1ad4d702c7922 (diff)
Merge #311208: add missing dependency of keras
-rw-r--r--maintainers/maintainer-list.nix6
-rw-r--r--pkgs/development/python-modules/keras/default.nix2
-rw-r--r--pkgs/development/python-modules/optree/default.nix60
-rw-r--r--pkgs/top-level/python-packages.nix2
4 files changed, 69 insertions, 1 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index c23b36585d4f9..9bdad4805dfad 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -13940,6 +13940,12 @@
     githubId = 1788628;
     name = "pandaman";
   };
+  pandapip1 = {
+    email = "gavinnjohn@gmail.com";
+    github = "Pandapip1";
+    githubId = 45835846;
+    name = "Gavin John";
+  };
   panicgh = {
     email = "nbenes.gh@xandea.de";
     github = "panicgh";
diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix
index f5275ea1a2a67..d508f4b708044 100644
--- a/pkgs/development/python-modules/keras/default.nix
+++ b/pkgs/development/python-modules/keras/default.nix
@@ -1,6 +1,6 @@
 { lib, buildPythonPackage, fetchPypi
 , pytest, pytest-cov, pytest-xdist
-, six, numpy, scipy, pyyaml, h5py
+, six, numpy, scipy, pyyaml, h5py, optree
 , keras-applications, keras-preprocessing
 }:
 
diff --git a/pkgs/development/python-modules/optree/default.nix b/pkgs/development/python-modules/optree/default.nix
new file mode 100644
index 0000000000000..d592c6d51f399
--- /dev/null
+++ b/pkgs/development/python-modules/optree/default.nix
@@ -0,0 +1,60 @@
+{ stdenv
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, lib
+, cmake
+, setuptools
+, typing-extensions
+, pybind11
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "optree";
+  version = "0.11.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "metaopt";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-VnnnEoXkYJO+S7baH+JZvsW18Tk3TiY9+Cd230OlZWo=";
+  };
+
+  dontUseCmakeConfigure = true;
+
+  propagatedBuildInputs = [
+    typing-extensions
+  ];
+  nativeBuildInputs = [
+    setuptools
+    pybind11
+    cmake
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+  # prevent import failures from pytest
+  preCheck = ''
+    rm -r optree
+  '';
+  disabledTests = [
+    # Fails because the 'test_treespec' module can't be found
+    "test_treespec_pickle_missing_registration"
+  ];
+  pythonImportsCheck = [
+    "optree"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/metaopt/optree";
+    changelog = "https://github.com/metaopt/optree/releases/tag/v${version}";
+    description = "Optimized PyTree Utilities";
+    maintainers = with maintainers; [ pandapip1 ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 2c35edd358264..4ca788dc3dcc5 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -8620,6 +8620,8 @@ self: super: with self; {
 
   optimum = callPackage ../development/python-modules/optimum { };
 
+  optree = callPackage ../development/python-modules/optree { };
+
   optuna = callPackage ../development/python-modules/optuna { };
 
   opuslib = callPackage ../development/python-modules/opuslib { };