2019-12-03 01:32:54 +01:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, isPy3k
|
|
|
|
, filelock, protobuf, numpy, pytest, mock, typing-extensions
|
2017-12-28 17:43:19 +01:00
|
|
|
, cupy, cudaSupport ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "chainer";
|
2019-12-03 01:32:54 +01:00
|
|
|
version = "6.5.0";
|
|
|
|
disabled = !isPy3k; # python2.7 abandoned upstream
|
2017-12-28 17:43:19 +01:00
|
|
|
|
2019-12-03 01:32:54 +01:00
|
|
|
# no tests in Pypi tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chainer";
|
|
|
|
repo = "chainer";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0ha9fbl6sa3fbnsz3y1pg335iiskdbxw838m5j06zgzy156zna1x";
|
2017-12-28 17:43:19 +01:00
|
|
|
};
|
|
|
|
|
2019-12-03 01:32:54 +01:00
|
|
|
# remove on 7.0 or 6.6 release
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/typing/d' setup.py
|
|
|
|
'';
|
|
|
|
|
2017-12-28 17:43:19 +01:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
mock
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
filelock
|
|
|
|
protobuf
|
|
|
|
numpy
|
2019-12-03 01:32:54 +01:00
|
|
|
typing-extensions
|
2017-12-28 17:43:19 +01:00
|
|
|
] ++ lib.optionals cudaSupport [ cupy ];
|
|
|
|
|
2019-12-03 01:32:54 +01:00
|
|
|
# avoid gpu tests
|
|
|
|
checkPhase = ''
|
|
|
|
pytest tests/chainer_tests/utils_tests -k 'not gpu and not cupy'
|
|
|
|
'';
|
2017-12-28 17:43:19 +01:00
|
|
|
|
2019-12-03 01:32:54 +01:00
|
|
|
meta = with lib; {
|
2017-12-28 17:43:19 +01:00
|
|
|
description = "A flexible framework of neural networks for deep learning";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://chainer.org/";
|
2017-12-28 17:43:19 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hyphon81 ];
|
|
|
|
};
|
|
|
|
}
|