about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dm-haiku
diff options
context:
space:
mode:
authorAlexander Tsvyashchenko <ndl@endl.ch>2022-01-05 23:31:02 +0100
committerGitHub <noreply@github.com>2022-01-05 14:31:02 -0800
commit8ef375f7b37f6dd0828a99ab1d109ed64638cfe8 (patch)
treee815a2bf12eddfbf88d744fccab6a77ff62a916b /pkgs/development/python-modules/dm-haiku
parentb94d6a297c4b4a062fb1c8ddf761b1ffe8d398e8 (diff)
python3Packages.dm-haiku: init at 0.0.5 (#153122)
Diffstat (limited to 'pkgs/development/python-modules/dm-haiku')
-rw-r--r--pkgs/development/python-modules/dm-haiku/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/dm-haiku/default.nix b/pkgs/development/python-modules/dm-haiku/default.nix
new file mode 100644
index 0000000000000..5468776c72d11
--- /dev/null
+++ b/pkgs/development/python-modules/dm-haiku/default.nix
@@ -0,0 +1,59 @@
+{ buildPythonPackage
+, chex
+, cloudpickle
+, dill
+, dm-tree
+, fetchFromGitHub
+, jmp
+, lib
+, pytestCheckHook
+, tabulate
+, tensorflow
+}:
+
+buildPythonPackage rec {
+  pname = "dm-haiku";
+  version = "0.0.5";
+
+  src = fetchFromGitHub {
+    owner = "deepmind";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1mdqjcka0m1div63ngba8w8z94id4c1h8xqmnq1xpmgkc79224wa";
+  };
+
+  propagatedBuildInputs = [
+    jmp
+    tabulate
+  ];
+
+  checkInputs = [
+    chex
+    cloudpickle
+    dm-tree
+    pytestCheckHook
+    tensorflow
+  ];
+
+  pythonImportsCheck = [
+    "haiku"
+  ];
+
+  disabledTestPaths = [
+    # These tests require `bsuite` which isn't packaged in `nixpkgs`.
+    "examples/impala_lite_test.py"
+    "examples/impala/actor_test.py"
+    "examples/impala/learner_test.py"
+    # This test breaks on multiple cases with TF-related errors,
+    # likely that's the reason the upstream uses TF-nightly for tests?
+    # `nixpkgs` doesn't have the corresponding TF version packaged.
+    "haiku/_src/integration/jax2tf_test.py"
+  ];
+
+  meta = with lib; {
+    description = "Haiku is a simple neural network library for JAX developed by some of the authors of Sonnet.";
+    homepage = "https://github.com/deepmind/dm-haiku";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ ndl ];
+  };
+}