2021-08-27 14:25:00 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
2022-02-10 20:34:41 +00:00
|
|
|
, pythonAtLeast
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
|
|
|
, wheel
|
|
|
|
, werkzeug
|
|
|
|
, protobuf
|
|
|
|
, grpcio
|
|
|
|
, markdown
|
|
|
|
, absl-py
|
|
|
|
, google-auth-oauthlib
|
2021-08-27 14:25:00 +00:00
|
|
|
, setuptools
|
|
|
|
, tensorboard-data-server
|
2021-01-15 22:18:51 +00:00
|
|
|
, tensorboard-plugin-wit
|
|
|
|
, tensorboard-plugin-profile
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# tensorflow/tensorboard is built from a downloaded wheel, because
|
|
|
|
# https://github.com/tensorflow/tensorboard/issues/719 blocks
|
|
|
|
# buildBazelPackage.
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-04-15 01:41:22 +00:00
|
|
|
pname = "tensorboard";
|
|
|
|
version = "2.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "wheel";
|
2022-04-15 01:41:22 +00:00
|
|
|
disabled = pythonOlder "3.6" || pythonAtLeast "3.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
src = fetchPypi {
|
2022-04-15 01:41:22 +00:00
|
|
|
inherit pname version format;
|
2021-08-27 14:25:00 +00:00
|
|
|
dist = "py3";
|
2020-04-24 23:36:52 +00:00
|
|
|
python = "py3";
|
2022-04-15 01:41:22 +00:00
|
|
|
hash = "sha256-ZaM45EJOkHnyYEkjvb4wF5KtzirOG+aNprPd8AUXDe8=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
chmod u+rwx -R ./dist
|
|
|
|
pushd dist
|
|
|
|
wheel unpack --dest unpacked ./*.whl
|
|
|
|
pushd unpacked/tensorboard-${version}
|
|
|
|
|
|
|
|
substituteInPlace tensorboard-${version}.dist-info/METADATA \
|
2022-03-30 09:31:56 +00:00
|
|
|
--replace "google-auth (<2,>=1.6.3)" "google-auth (<3,>=1.6.3)" \
|
|
|
|
--replace "google-auth-oauthlib (<0.5,>=0.4.1)" "google-auth-oauthlib (<0.6,>=0.4.1)"
|
2021-08-27 14:25:00 +00:00
|
|
|
|
|
|
|
popd
|
|
|
|
wheel pack ./unpacked/tensorboard-${version}
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
absl-py
|
2021-08-27 14:25:00 +00:00
|
|
|
grpcio
|
2020-04-24 23:36:52 +00:00
|
|
|
google-auth-oauthlib
|
2021-08-27 14:25:00 +00:00
|
|
|
markdown
|
|
|
|
numpy
|
|
|
|
protobuf
|
|
|
|
setuptools
|
|
|
|
tensorboard-data-server
|
2021-01-15 22:18:51 +00:00
|
|
|
tensorboard-plugin-profile
|
|
|
|
tensorboard-plugin-wit
|
2021-08-27 14:25:00 +00:00
|
|
|
werkzeug
|
2020-04-24 23:36:52 +00:00
|
|
|
# not declared in install_requires, but used at runtime
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/73840
|
|
|
|
wheel
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# in the absence of a real test suite, run cli and imports
|
|
|
|
checkPhase = ''
|
|
|
|
$out/bin/tensorboard --help > /dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"tensorboard"
|
|
|
|
"tensorboard.backend"
|
|
|
|
"tensorboard.compat"
|
|
|
|
"tensorboard.data"
|
|
|
|
"tensorboard.plugins"
|
|
|
|
"tensorboard.summary"
|
|
|
|
"tensorboard.util"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "TensorFlow's Visualization Toolkit";
|
2021-08-27 14:25:00 +00:00
|
|
|
homepage = "https://www.tensorflow.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|