14 , tensorflow-probability
15 , tensorflow-estimator
21 # first build all binaries and generate setup.py using bazel
22 bazel-build = buildBazelPackage {
25 name = "dm-sonnet-bazel-${version}";
27 src = fetchFromGitHub {
31 sha256 = "1nqsja1s8jrkq6v1whgh7smk17313mjr9vs3k5c1m8px4yblzhqc";
35 git # needed to fetch the bazel deps (protobuf in particular)
38 # see https://github.com/deepmind/sonnet/blob/master/docs/INSTALL.md
39 bazelTarget = ":install";
42 sha256 = "09dzxs2v5wpiaxrz7qj257q1fbx0gxwbk0jyx58n81m5kys7yj9k";
51 # do not generate a wheel, instead just copy the generated files to $out to be installed by buildPythonPackage
52 sed -i 's,.*bdist_wheel.*,cp -rL . "$out"; exit 0,' bazel-bin/install
54 # the target directory "dist" does not actually matter since we're not generating a wheel
55 bazel-bin/install dist
60 # now use pip to install the package prepared by bazel
61 in buildPythonPackage {
67 propagatedBuildInputs = [
74 tensorflow-probability
78 # not sure how to properly run the real test suite -- through bazel?
80 ${python.interpreter} -c "import sonnet"
84 description = "TensorFlow-based neural network library";
85 homepage = "https://sonnet.dev";
86 license = licenses.asl20;
87 maintainers = with maintainers; [ timokau ];
88 platforms = platforms.linux;