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