1{
2 lib,
3 buildPythonPackage,
4 config,
5 cudaSupport ? config.cudaSupport,
6 cupy,
7 fetchFromGitHub,
8 filelock,
9 mock,
10 numpy,
11 protobuf,
12 pytestCheckHook,
13 pythonOlder,
14 six,
15 typing-extensions,
16}:
17
18buildPythonPackage rec {
19 pname = "chainer";
20 version = "7.8.1.post1";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "chainer";
27 repo = "chainer";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-epwnExmyCWmwaOz+mJnAl1peEeHLBdQGC62BlLfSTQQ=";
30 };
31
32 propagatedBuildInputs = [
33 filelock
34 numpy
35 protobuf
36 six
37 typing-extensions
38 ] ++ lib.optionals cudaSupport [ cupy ];
39
40 nativeCheckInputs = [
41 mock
42 pytestCheckHook
43 ];
44
45 pytestFlagsArray = [ "tests/chainer_tests/utils_tests" ];
46
47 preCheck = ''
48 # cf. https://github.com/chainer/chainer/issues/8621
49 export CHAINER_WARN_VERSION_MISMATCH=0
50
51 # ignore pytest warnings not listed
52 rm setup.cfg
53 '';
54
55 disabledTests = [
56 "gpu"
57 "cupy"
58 "ideep"
59 ];
60
61 pythonImportsCheck = [ "chainer" ];
62
63 meta = with lib; {
64 description = "Flexible framework of neural networks for deep learning";
65 homepage = "https://chainer.org/";
66 license = licenses.mit;
67 maintainers = with maintainers; [ hyphon81 ];
68 };
69}