2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
absl-py,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
googleapis-common-protos,
|
|
|
|
protobuf,
|
|
|
|
lib,
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tensorflow-metadata";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.14.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-ZfX25CaV+tZVdas+n7O6Gqv1GxOP1iwippIXxfhcOfg=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [ ./build.patch ];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
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;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "tensorflow_metadata" ];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|