1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 absl-py,
11 googleapis-common-protos,
12 protobuf,
13}:
14
15buildPythonPackage rec {
16 pname = "tensorflow-metadata";
17 version = "1.17.2";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "tensorflow";
22 repo = "metadata";
23 tag = "v${version}";
24 hash = "sha256-YqFQOm8K4WFUlpWqkZm8pZpfupf7ZtJTODJodjLnzK4=";
25 };
26
27 patches = [ ./build.patch ];
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 build-system = [ setuptools ];
38
39 dependencies = [
40 absl-py
41 googleapis-common-protos
42 protobuf
43 ];
44
45 # has no tests
46 doCheck = false;
47
48 pythonImportsCheck = [
49 "tensorflow_metadata"
50 "tensorflow_metadata.proto.v0"
51 "google.protobuf.runtime_version"
52 ];
53
54 meta = {
55 description = "Standard representations for metadata that are useful when training machine learning models with TensorFlow";
56 homepage = "https://github.com/tensorflow/metadata";
57 changelog = "https://github.com/tensorflow/metadata/releases/tag/v${version}";
58 license = lib.licenses.asl20;
59 maintainers = with lib.maintainers; [ ndl ];
60 };
61}