1{ lib
2, fetchPypi
3, buildPythonPackage
4, pythonOlder
5, numpy
6, wheel
7, werkzeug
8, protobuf
9, grpcio
10, markdown
11, absl-py
12, google-auth-oauthlib
13, setuptools
14, tensorboard-data-server
15, tensorboard-plugin-wit
16, tensorboard-plugin-profile
17}:
18
19# tensorflow/tensorboard is built from a downloaded wheel, because
20# https://github.com/tensorflow/tensorboard/issues/719 blocks
21# buildBazelPackage.
22
23buildPythonPackage rec {
24 pname = "tensorflow-tensorboard";
25 version = "2.6.0";
26 format = "wheel";
27 disabled = pythonOlder "3.6";
28
29 src = fetchPypi {
30 pname = "tensorboard";
31 inherit version format;
32 dist = "py3";
33 python = "py3";
34 sha256 = "sha256-99rEzftS0UyeP3RYXOKq+OYgNiCoZOUfr4SYiwn3u9s=";
35 };
36
37 postPatch = ''
38 chmod u+rwx -R ./dist
39 pushd dist
40 wheel unpack --dest unpacked ./*.whl
41 pushd unpacked/tensorboard-${version}
42
43 substituteInPlace tensorboard-${version}.dist-info/METADATA \
44 --replace "google-auth (<2,>=1.6.3)" "google-auth (<3,>=1.6.3)"
45
46 popd
47 wheel pack ./unpacked/tensorboard-${version}
48 popd
49 '';
50
51 propagatedBuildInputs = [
52 absl-py
53 grpcio
54 google-auth-oauthlib
55 markdown
56 numpy
57 protobuf
58 setuptools
59 tensorboard-data-server
60 tensorboard-plugin-profile
61 tensorboard-plugin-wit
62 werkzeug
63 # not declared in install_requires, but used at runtime
64 # https://github.com/NixOS/nixpkgs/issues/73840
65 wheel
66 ];
67
68 # in the absence of a real test suite, run cli and imports
69 checkPhase = ''
70 $out/bin/tensorboard --help > /dev/null
71 '';
72
73 pythonImportsCheck = [
74 "tensorboard"
75 "tensorboard.backend"
76 "tensorboard.compat"
77 "tensorboard.data"
78 "tensorboard.plugins"
79 "tensorboard.summary"
80 "tensorboard.util"
81 ];
82
83 meta = with lib; {
84 description = "TensorFlow's Visualization Toolkit";
85 homepage = "https://www.tensorflow.org/";
86 license = licenses.asl20;
87 maintainers = with maintainers; [ abbradar ];
88 };
89}