about summary refs log tree commit diff
path: root/pkgs/development/python-modules/chainer/default.nix
blob: 1f5be76e2d219638dee4629dfe4cd1730b2e3b82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ lib
, buildPythonPackage
, config
, cudaSupport ? config.cudaSupport
, cupy
, fetchFromGitHub
, filelock
, mock
, numpy
, protobuf
, pytestCheckHook
, pythonOlder
, six
, typing-extensions
}:

buildPythonPackage rec {
  pname = "chainer";
  version = "7.8.1.post1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "chainer";
    repo = "chainer";
    rev = "refs/tags/v${version}";
    hash = "sha256-epwnExmyCWmwaOz+mJnAl1peEeHLBdQGC62BlLfSTQQ=";
  };

  propagatedBuildInputs = [
    filelock
    numpy
    protobuf
    six
    typing-extensions
  ] ++ lib.optionals cudaSupport [
    cupy
  ];

  nativeCheckInputs = [
    mock
    pytestCheckHook
  ];

  pytestFlagsArray = [
    "tests/chainer_tests/utils_tests"
  ];

  preCheck = ''
    # cf. https://github.com/chainer/chainer/issues/8621
    export CHAINER_WARN_VERSION_MISMATCH=0

    # ignore pytest warnings not listed
    rm setup.cfg
  '';

  disabledTests = [
    "gpu"
    "cupy"
    "ideep"
  ];

  pythonImportsCheck = [
    "chainer"
  ];

  meta = with lib; {
    description = "A flexible framework of neural networks for deep learning";
    homepage = "https://chainer.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ hyphon81 ];
  };
}