about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dm-haiku/default.nix
blob: 5468776c72d11cef9e02db850610d1df021f80b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 ];
  };
}