1{ lib
2, buildPythonPackage
3, click
4, dm-tree
5, docutils
6, etils
7, fetchFromGitHub
8, fetchpatch
9, numpy
10, pythonOlder
11, tabulate
12, tensorflow
13, tensorflow-datasets
14, wrapt
15}:
16
17buildPythonPackage rec {
18 pname = "dm-sonnet";
19 version = "2.0.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.6";
23
24 src = fetchFromGitHub {
25 owner = "deepmind";
26 repo = "sonnet";
27 rev = "v${version}";
28 hash = "sha256-YSMeH5ZTfP1OdLBepsxXAVczBG/ghSjCWjoz/I+TFl8=";
29 };
30
31 patches = [
32 (fetchpatch {
33 name = "replace-np-bool-with-np-bool_.patch";
34 url = "https://github.com/deepmind/sonnet/commit/df5d099d4557a9a81a0eb969e5a81ed917bcd612.patch";
35 hash = "sha256-s7abl83osD4wa0ZhqgDyjqQ3gagwGYCdQifwFqhNp34=";
36 })
37 ];
38
39 propagatedBuildInputs = [
40 dm-tree
41 etils
42 numpy
43 tabulate
44 wrapt
45 ] ++ etils.optional-dependencies.epath;
46
47 passthru.optional-dependencies = {
48 tensorflow = [
49 tensorflow
50 ];
51 };
52
53 nativeCheckInputs = [
54 click
55 docutils
56 tensorflow
57 tensorflow-datasets
58 ];
59
60 pythonImportsCheck = [
61 "sonnet"
62 ];
63
64 meta = with lib; {
65 description = "Library for building neural networks in TensorFlow";
66 homepage = "https://github.com/deepmind/sonnet";
67 license = licenses.asl20;
68 maintainers = with maintainers; [ onny ];
69 };
70}