From 77c70abb813783ff71af5c362e1c028f2f870d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 30 Dec 2020 00:04:35 +0100 Subject: [PATCH] torchvision: 0.2.1 -> 0.8.2 --- .../python-modules/torchvision/default.nix | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/torchvision/default.nix b/pkgs/development/python-modules/torchvision/default.nix index 4d371579099..12af086a07d 100644 --- a/pkgs/development/python-modules/torchvision/default.nix +++ b/pkgs/development/python-modules/torchvision/default.nix @@ -1,30 +1,48 @@ -{ buildPythonPackage -, fetchPypi -, six +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, ninja +, which +, libjpeg_turbo +, libpng , numpy +, scipy , pillow , pytorch -, lib +, pytestCheckHook }: buildPythonPackage rec { - version = "0.2.1"; - pname = "torchvision"; + pname = "torchvision"; + version = "0.8.2"; - format = "wheel"; - - src = fetchPypi { - inherit pname version; - format = "wheel"; - sha256 = "18gvdabkmzfjg47ns0lw38mf85ry28nq1mas5rzlwvb4l5zmw2ms"; + src = fetchFromGitHub { + owner = "pytorch"; + repo = "vision"; + rev = "v${version}"; + sha256 = "0yhpbq7linrk2qp5jxsvlgkmwa5bn38s9kcswy4jzvmx1fjbkpq0"; }; - propagatedBuildInputs = [ six numpy pillow pytorch ]; + nativeBuildInputs = [ libpng ninja which ]; - meta = { + TORCHVISION_INCLUDE="${libjpeg_turbo.dev}/include/"; + TORCHVISION_LIBRARY="${libjpeg_turbo}/lib/"; + + buildInputs = [ libjpeg_turbo libpng ]; + + propagatedBuildInputs = [ numpy pillow pytorch scipy ]; + + # checks fail to import _C.so and various other failures + doCheck = false; + + checkInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "--ignore=test/test_datasets_download.py" ]; + + meta = with stdenv.lib; { description = "PyTorch vision library"; - homepage = "https://pytorch.org/"; - license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ ericsagnes ]; + homepage = "https://pytorch.org/"; + license = licenses.bsd3; + maintainers = with maintainers; [ ericsagnes SuperSandro2000 ]; }; }