git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #107925 from SuperSandro2000/pytorch
commit1e7ffa274192686b3a5d29f897b5f42162559409 authorJörg Thalheim <Mic92@users.noreply.github.com> dateWed 30 Dec 2020, 06:43 (6 years ago) parentf423aead198cba
1 file changed+37−17
pkgs/development/python-modules/torchvision/default.nix+37−17
pkgs/development/python-modules/torchvision/default.nix+37−17
@@ -1,30 +1,50 @@
1−{ buildPythonPackage
2−, fetchPypi
3−, six
1+{ stdenv
2+, buildPythonPackage
3+, fetchFromGitHub
4+, ninja
5+, which
6+, libjpeg_turbo
7+, libpng
48, numpy
9+, scipy
510, pillow
611, pytorch
7−, lib
12+, pytest
813}:
914
1015buildPythonPackage rec {
11− version = "0.2.1";
12− pname = "torchvision";
16+ pname = "torchvision";
17+ version = "0.8.2";
1318
14− format = "wheel";
15−
16− src = fetchPypi {
17− inherit pname version;
18− format = "wheel";
19− sha256 = "18gvdabkmzfjg47ns0lw38mf85ry28nq1mas5rzlwvb4l5zmw2ms";
19+ src = fetchFromGitHub {
20+ owner = "pytorch";
21+ repo = "vision";
22+ rev = "v${version}";
23+ sha256 = "0yhpbq7linrk2qp5jxsvlgkmwa5bn38s9kcswy4jzvmx1fjbkpq0";
2024 };
2125
22− propagatedBuildInputs = [ six numpy pillow pytorch ];
26+ nativeBuildInputs = [ libpng ninja which ];
27+
28+ TORCHVISION_INCLUDE = "${libjpeg_turbo.dev}/include/";
29+ TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/";
30+
31+ buildInputs = [ libjpeg_turbo libpng ];
32+
33+ propagatedBuildInputs = [ numpy pillow pytorch scipy ];
34+
35+ # tries to download many datasets for tests
36+ doCheck = false;
37+
38+ checkPhase = ''
39+ HOME=$TMPDIR py.test test --ignore=test/test_datasets_download.py
40+ '';
41+
42+ checkInputs = [ pytest ];
2343
24− meta = {
44+ meta = with stdenv.lib; {
2545 description = "PyTorch vision library";
26− homepage = "https://pytorch.org/";
27− license = lib.licenses.bsd3;
28− maintainers = with lib.maintainers; [ ericsagnes ];
46+ homepage = "https://pytorch.org/";
47+ license = licenses.bsd3;
48+ maintainers = with maintainers; [ ericsagnes SuperSandro2000 ];
2949 };
3050}