2022-01-13 20:06:32 +00:00
|
|
|
{ absl-py
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, googleapis-common-protos
|
2022-04-15 01:41:22 +00:00
|
|
|
, protobuf
|
2022-01-13 20:06:32 +00:00
|
|
|
, lib
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tensorflow-metadata";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "1.9.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tensorflow";
|
|
|
|
repo = "metadata";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "sha256-6BtKHyVrprtEb2Bi7g2YuctUykWSRXmKwADfHzGkYjc=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./build.patch
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'protobuf>=3.13,<4' 'protobuf>=3.13'
|
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
# Default build pulls in Bazel + extra deps, given the actual build
|
|
|
|
# is literally three lines (see below) - replace it with custom build.
|
|
|
|
preBuild = ''
|
|
|
|
for proto in tensorflow_metadata/proto/v0/*.proto; do
|
|
|
|
protoc --python_out=. $proto
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
absl-py
|
|
|
|
googleapis-common-protos
|
2022-04-15 01:41:22 +00:00
|
|
|
protobuf
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
# has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"tensorflow_metadata"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Standard representations for metadata that are useful when training machine learning models with TensorFlow";
|
|
|
|
homepage = "https://github.com/tensorflow/metadata";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|