nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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.8.0";
12
13 src = fetchFromGitHub {
14 owner = "tensorflow";
15 repo = "metadata";
16 rev = "refs/tags/v${version}";
17 sha256 = "sha256-IaLr6XYEy1EcyWi5GWzDFa7TeVZ59v8Wj5qkNdVbOqw=";
18 };
19
20 patches = [
21 ./build.patch
22 ];
23
24 # Default build pulls in Bazel + extra deps, given the actual build
25 # is literally three lines (see below) - replace it with custom build.
26 preBuild = ''
27 for proto in tensorflow_metadata/proto/v0/*.proto; do
28 protoc --python_out=. $proto
29 done
30 '';
31
32 propagatedBuildInputs = [
33 absl-py
34 googleapis-common-protos
35 protobuf
36 ];
37
38 # has no tests
39 doCheck = false;
40
41 pythonImportsCheck = [
42 "tensorflow_metadata"
43 ];
44
45 meta = with lib; {
46 description = "Standard representations for metadata that are useful when training machine learning models with TensorFlow";
47 homepage = "https://github.com/tensorflow/metadata";
48 license = licenses.asl20;
49 maintainers = with maintainers; [ ndl ];
50 };
51}