From 92041430d417bc5fa3d9b4e37b8e2ace05ebba52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Wed, 28 Oct 2020 14:03:59 +0100 Subject: [PATCH] python3Packages.pytorch-bin: 1.6.0 -> 1.7.0 Changelog: https://github.com/pytorch/pytorch/releases/tag/v1.7.0 --- .../development/python-modules/pytorch/bin.nix | 18 ++++++++++++++++-- .../python-modules/pytorch/binary-hashes.nix | 10 +++++----- 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 b1b662e95b3e..f073c408f709 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 481dc6825c7d..afdde5057dbd 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"; }; }