@@ -0,0 +1,46 @@
1+{ absl-py
2+, buildPythonPackage
3+, fetchFromGitHub
4+, googleapis-common-protos
5+, lib
6+}:
7+
8+buildPythonPackage rec {
9+ pname = "tensorflow-metadata";
10+ version = "1.5.0";
11+
12+ src = fetchFromGitHub {
13+ owner = "tensorflow";
14+ repo = "metadata";
15+ rev = "v${version}";
16+ sha256 = "17p74k6rwswpmj7m16cw9hdam6b4m7v5bahirmc2l1kwfvrn4w33";
17+ };
18+
19+ patches = [
20+ ./build.patch
21+ ];
22+
23+ # Default build pulls in Bazel + extra deps, given the actual build
24+ # is literally three lines (see below) - replace it with custom build.
25+ preBuild = ''
26+ for proto in tensorflow_metadata/proto/v0/*.proto; do
27+ protoc --python_out=. $proto
28+ done
29+ '';
30+
31+ propagatedBuildInputs = [
32+ absl-py
33+ googleapis-common-protos
34+ ];
35+
36+ pythonImportsCheck = [
37+ "tensorflow_metadata"
38+ ];
39+
40+ meta = with lib; {
41+ description = "Standard representations for metadata that are useful when training machine learning models with TensorFlow";
42+ homepage = "https://github.com/tensorflow/metadata";
43+ license = licenses.asl20;
44+ maintainers = with maintainers; [ ndl ];
45+ };
46+}