26 pname = "tensorflow_probability";
28 # first build all binaries and generate setup.py using bazel
29 bazel-wheel = buildBazelPackage {
32 name = "${pname}-${version}-py2.py3-none-any.whl";
34 src = fetchFromGitHub {
38 sha256 = "07cm8zba8n0ihzdm3k4a4rsg5v62xxsfvcw4h0niz91c0parqjqy";
43 name = "gast-0.3.patch";
44 url = "https://github.com/tensorflow/probability/commit/ae7a9d9771771ec1e7755a3588b9325f050a84cc.patch";
45 sha256 = "0kfhx30gshm8f3945na9yjjik71r20qmjzifbigaj4l8dwd9dz1a";
46 excludes = ["testing/*"];
49 name = "cloudpickle-1.2.patch";
50 url = "https://github.com/tensorflow/probability/commit/78ef12b5afe3f567d16c70b74015ed1ddff1b0c8.patch";
51 sha256 = "12ms2xcljvvrnig0j78s3wfv4yf3bm5ps4rgfgv5lg2a8mzpc1ga";
56 # needed to create the output wheel in installPhase
64 bazelTarget = ":pip_pkg";
67 sha256 = "1qw7vkwnxy45z4vm94isq5m96xiz35sigag7vjg1xb2sklbymxh8";
76 # work around timestamp issues
77 # https://github.com/NixOS/nixpkgs/issues/270#issuecomment-467583872
78 export SOURCE_DATE_EPOCH=315532800
80 # First build, then move. Otherwise pip_pkg would create the dir $out
81 # and then put the wheel in that directory. However we want $out to
82 # point directly to the wheel file.
83 ./bazel-bin/pip_pkg . --release
88 in buildPythonPackage {
89 inherit version pname;
94 propagatedBuildInputs = [
104 # https://github.com/tensorflow/probability/blob/f01d27a6f256430f03b14beb14d37def726cb257/testing/run_tests.sh#L58
113 # actual checks currently fail because for some reason
114 # tf.enable_eager_execution is called too late. Probably because upstream
115 # intents these tests to be run by bazel, not plain pytest.
117 # # tests need to import from other test files
118 # export PYTHONPATH="$PWD/tensorflow-probability:$PYTHONPATH"
124 python -c 'import tensorflow_probability'
128 broken = true; # tf-probability 0.8.0 is not compatible with tensorflow 2.3.2
129 description = "Library for probabilistic reasoning and statistical analysis";
130 homepage = "https://www.tensorflow.org/probability/";
131 license = licenses.asl20;
132 maintainers = with maintainers; []; # This package is maintainerless.