Merge pull request #63809 from timokau/dm-sonnet-1.33

python.pkgs.dm-sonnet: 1.30 -> 1.33
This commit is contained in:
Timo Kaufmann 2019-07-02 11:19:20 +02:00 committed by GitHub
commit 63e15d588a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 13 deletions

View File

@ -51,8 +51,10 @@ in stdenv.mkDerivation (fBuildAttrs // {
rm -rf $bazelOut/external/{local_*,\@local_*} rm -rf $bazelOut/external/{local_*,\@local_*}
# Patching markers to make them deterministic # Patching markers to make them deterministic
sed -i 's, -\?[0-9][0-9]*$, 1,' $bazelOut/external/\@*.marker find $bazelOut/external -name '@*\.marker' -exec sed -i \
sed -i '/^ENV:TMP.*/d' $bazelOut/external/\@*.marker -e 's, -\?[0-9][0-9]*$, 1,' \
-e '/^ENV:TMP.*/d' \
'{}' \;
# Remove all vcs files # Remove all vcs files
rm -rf $(find $bazelOut/external -type d -name .git) rm -rf $(find $bazelOut/external -type d -name .git)
@ -86,8 +88,8 @@ in stdenv.mkDerivation (fBuildAttrs // {
''; '';
preConfigure = '' preConfigure = ''
mkdir -p $bazelOut/external mkdir -p "$bazelOut"
cp -r $deps/* $bazelOut/external cp -r $deps $bazelOut/external
chmod -R +w $bazelOut chmod -R +w $bazelOut
find $bazelOut -type l | while read symlink; do find $bazelOut -type l | while read symlink; do
ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink" ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink"

View File

@ -15,7 +15,7 @@
}: }:
let let
version = "1.30"; version = "1.33";
# first build all binaries and generate setup.py using bazel # first build all binaries and generate setup.py using bazel
bazel-build = buildBazelPackage rec { bazel-build = buildBazelPackage rec {
@ -25,7 +25,7 @@ let
owner = "deepmind"; owner = "deepmind";
repo = "sonnet"; repo = "sonnet";
rev = "v${version}"; rev = "v${version}";
sha256 = "1dli4a4arx2gmb4p676pfibvnpag9f13znisrk9381g7xpqqmaw6"; sha256 = "1nqsja1s8jrkq6v1whgh7smk17313mjr9vs3k5c1m8px4yblzhqc";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -1,8 +1,13 @@
{ lib { lib
, fetchFromGitHub , fetchFromGitHub
, buildBazelPackage
, buildPythonPackage , buildPythonPackage
, python , python
, setuptools
, wheel
, tensorflow , tensorflow
, six
, numpy
, decorator , decorator
, cloudpickle , cloudpickle
, hypothesis , hypothesis
@ -12,19 +17,62 @@
, pytest , pytest
}: }:
buildPythonPackage rec { let
pname = "tensorflow-probability";
version = "0.7"; version = "0.7";
pname = "tensorflow_probability";
src = fetchFromGitHub { # first build all binaries and generate setup.py using bazel
owner = "tensorflow"; bazel-wheel = buildBazelPackage {
repo = "probability"; name = "${pname}-${version}-py2.py3-none-any.whl";
rev = "v${version}";
sha256 = "0sy9gmjcvmwciamqvd7kd9qw2wd7ksklk80815fsn7sj0wiqxjyd"; src = fetchFromGitHub {
owner = "tensorflow";
repo = "probability";
rev = "v${version}";
sha256 = "0sy9gmjcvmwciamqvd7kd9qw2wd7ksklk80815fsn7sj0wiqxjyd";
};
nativeBuildInputs = [
# needed to create the output wheel in installPhase
python
setuptools
wheel
];
bazelTarget = ":pip_pkg";
fetchAttrs = {
sha256 = "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5";
};
buildAttrs = {
preBuild = ''
patchShebangs .
'';
installPhase = ''
# work around timestamp issues
# https://github.com/NixOS/nixpkgs/issues/270#issuecomment-467583872
export SOURCE_DATE_EPOCH=315532800
# First build, then move. Otherwise pip_pkg would create the dir $out
# and then put the wheel in that directory. However we want $out to
# point directly to the wheel file.
./bazel-bin/pip_pkg . --release
mv *.whl "$out"
'';
};
}; };
in buildPythonPackage rec {
inherit version pname;
format = "wheel";
src = bazel-wheel;
propagatedBuildInputs = [ propagatedBuildInputs = [
tensorflow tensorflow
six
numpy
decorator decorator
cloudpickle cloudpickle
]; ];