python.pkgs.tensorflow-probability: 0.7 -> 0.8.0

This unbreaks the build by updating to a newer version, adding new
dependencies and backporting some patches.

0.9 is released already, but that version is no longer compatible with
tf1. 0.8.0 is compatible with tf1 and tf2.
This commit is contained in:
Timo Kaufmann 2020-04-07 16:43:11 +02:00
parent bbdd169400
commit 04d3adb82f

View File

@ -1,15 +1,18 @@
{ lib { lib
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, buildBazelPackage , buildBazelPackage
, buildPythonPackage , buildPythonPackage
, python , python
, setuptools , setuptools
, wheel , wheel
, absl-py
, tensorflow , tensorflow
, six , six
, numpy , numpy
, decorator , decorator
, cloudpickle , cloudpickle
, gast
, hypothesis , hypothesis
, scipy , scipy
, matplotlib , matplotlib
@ -18,7 +21,7 @@
}: }:
let let
version = "0.7"; version = "0.8.0";
pname = "tensorflow_probability"; pname = "tensorflow_probability";
# first build all binaries and generate setup.py using bazel # first build all binaries and generate setup.py using bazel
@ -28,21 +31,37 @@ let
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "tensorflow"; owner = "tensorflow";
repo = "probability"; repo = "probability";
rev = "v${version}"; rev = "${version}";
sha256 = "0sy9gmjcvmwciamqvd7kd9qw2wd7ksklk80815fsn7sj0wiqxjyd"; sha256 = "07cm8zba8n0ihzdm3k4a4rsg5v62xxsfvcw4h0niz91c0parqjqy";
}; };
patches = [
(fetchpatch {
name = "gast-0.3.patch";
url = "https://github.com/tensorflow/probability/commit/ae7a9d9771771ec1e7755a3588b9325f050a84cc.patch";
sha256 = "0kfhx30gshm8f3945na9yjjik71r20qmjzifbigaj4l8dwd9dz1a";
excludes = ["testing/*"];
})
(fetchpatch {
name = "cloudpickle-1.2.patch";
url = "https://github.com/tensorflow/probability/commit/78ef12b5afe3f567d16c70b74015ed1ddff1b0c8.patch";
sha256 = "12ms2xcljvvrnig0j78s3wfv4yf3bm5ps4rgfgv5lg2a8mzpc1ga";
})
];
nativeBuildInputs = [ nativeBuildInputs = [
# needed to create the output wheel in installPhase # needed to create the output wheel in installPhase
python python
setuptools setuptools
wheel wheel
absl-py
tensorflow
]; ];
bazelTarget = ":pip_pkg"; bazelTarget = ":pip_pkg";
fetchAttrs = { fetchAttrs = {
sha256 = "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5"; sha256 = "0135nxxvkmjzpd80r1g9fdkk9h62g0xlvp32g5zgk0hkma5kq0bx";
}; };
buildAttrs = { buildAttrs = {
@ -75,6 +94,7 @@ in buildPythonPackage {
numpy numpy
decorator decorator
cloudpickle cloudpickle
gast
]; ];
# Listed here: # Listed here: