about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/dm-sonnet/default.nix
blob: 1947a07b835a19df9768b3943ed1916d567c846e (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
60
61
62
63
64
65
66
67
68
69
70
{ lib
, buildPythonPackage
, click
, dm-tree
, docutils
, etils
, fetchFromGitHub
, fetchpatch
, numpy
, pythonOlder
, tabulate
, tensorflow
, tensorflow-datasets
, wrapt
}:

buildPythonPackage rec {
  pname = "dm-sonnet";
  version = "2.0.0";
  format = "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "deepmind";
    repo = "sonnet";
    rev = "v${version}";
    hash = "sha256-YSMeH5ZTfP1OdLBepsxXAVczBG/ghSjCWjoz/I+TFl8=";
  };

  patches = [
    (fetchpatch {
      name = "replace-np-bool-with-np-bool_.patch";
      url = "https://github.com/deepmind/sonnet/commit/df5d099d4557a9a81a0eb969e5a81ed917bcd612.patch";
      hash = "sha256-s7abl83osD4wa0ZhqgDyjqQ3gagwGYCdQifwFqhNp34=";
    })
  ];

  propagatedBuildInputs = [
    dm-tree
    etils
    numpy
    tabulate
    wrapt
  ] ++ etils.optional-dependencies.epath;

  passthru.optional-dependencies = {
    tensorflow = [
      tensorflow
    ];
  };

  nativeCheckInputs = [
    click
    docutils
    tensorflow
    tensorflow-datasets
  ];

  pythonImportsCheck = [
    "sonnet"
  ];

  meta = with lib; {
    description = "Library for building neural networks in TensorFlow";
    homepage = "https://github.com/deepmind/sonnet";
    license = licenses.asl20;
    maintainers = with maintainers; [ onny ];
  };
}