summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniël de Kok <me@danieldk.eu>2020-10-28 14:03:59 +0100
committerDaniël de Kok <me@danieldk.eu>2020-10-28 14:04:31 +0100
commit92041430d417bc5fa3d9b4e37b8e2ace05ebba52 (patch)
tree78372a4dd46bf056b222244b789971718cef00ce
parent533965957eaf8b7a23433ec178c09faa11a682a2 (diff)
downloadnixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.tar
nixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.tar.gz
nixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.tar.bz2
nixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.tar.lz
nixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.tar.xz
nixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.tar.zst
nixpkgs-92041430d417bc5fa3d9b4e37b8e2ace05ebba52.zip
python3Packages.pytorch-bin: 1.6.0 -> 1.7.0
Changelog:

https://github.com/pytorch/pytorch/releases/tag/v1.7.0
-rw-r--r--pkgs/development/python-modules/pytorch/bin.nix18
-rw-r--r--pkgs/development/python-modules/pytorch/binary-hashes.nix10
2 files changed, 21 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/pytorch/bin.nix b/pkgs/development/python-modules/pytorch/bin.nix
index b1b662e95b3..f073c408f70 100644
--- a/pkgs/development/python-modules/pytorch/bin.nix
+++ b/pkgs/development/python-modules/pytorch/bin.nix
@@ -11,17 +11,20 @@
 , patchelf
 , pyyaml
 , requests
+, typing-extensions
 }:
 
 let
   pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
   platform = if stdenv.isDarwin then "darwin" else "linux";
-  srcs = import ./binary-hashes.nix;
+  srcs = import ./binary-hashes.nix version;
   unsupported = throw "Unsupported system";
+  version = "1.7.0";
 in buildPythonPackage {
+  inherit version;
+
   pname = "pytorch";
   # Don't forget to update pytorch to the same version.
-  version = "1.6.0";
 
   format = "wheel";
 
@@ -39,6 +42,17 @@ in buildPythonPackage {
     numpy
     pyyaml
     requests
+    typing-extensions
+  ];
+
+  # PyTorch are broken: the dataclasses wheel is required, but ships with
+  # Python >= 3.7. Our dataclasses derivation is incompatible with >= 3.7.
+  #
+  # https://github.com/pytorch/pytorch/issues/46930
+  #
+  # Should be removed with the next PyTorch version.
+  pipInstallFlags = [
+    "--no-deps"
   ];
 
   postInstall = ''
diff --git a/pkgs/development/python-modules/pytorch/binary-hashes.nix b/pkgs/development/python-modules/pytorch/binary-hashes.nix
index 481dc6825c7..afdde5057db 100644
--- a/pkgs/development/python-modules/pytorch/binary-hashes.nix
+++ b/pkgs/development/python-modules/pytorch/binary-hashes.nix
@@ -1,10 +1,10 @@
-{
+version: {
   x86_64-linux-37 = {
-    url = "https://download.pytorch.org/whl/cu102/torch-1.6.0-cp37-cp37m-linux_x86_64.whl";
-    sha256 = "0xhwv68j8gvahfzcp43bqp2x71iwv6zjhkw2f1hb82xps40mrml7";
+    url = "https://download.pytorch.org/whl/cu102/torch-${version}-cp37-cp37m-linux_x86_64.whl";
+    sha256 = "0cvafwzd44d7i2d0y01lyk75lhxffcf6c94cx0wla0cnhcg9mqlf";
   };
   x86_64-linux-38 = {
-    url = "https://download.pytorch.org/whl/cu102/torch-1.6.0-cp38-cp38-linux_x86_64.whl";
-    sha256 = "05m2l04wqzw5xvjam6zwvlmc3979cksl3hrdqc2aikrv4hz8fmsk";
+    url = "https://download.pytorch.org/whl/cu102/torch-${version}-cp38-cp38-linux_x86_64.whl";
+    sha256 = "1vxswkb2gzp87sbb5ycvyvs8aw1szp3v2mwdn4mp47yarlnbx8r6";
   };
 }