aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/ignite/default.nix
blob: 307c25e724eeaa515f26f53f272821729918c4ce (plain)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pytest_xdist
, pythonOlder
, matplotlib
, mock
, pytorch
, pynvml
, scikitlearn
, tqdm
}:

buildPythonPackage rec {
  pname = "ignite";
  version = "0.4.2";

  src = fetchFromGitHub {
    owner = "pytorch";
    repo = pname;
    rev = "v${version}";
    sha256 = "00vcmhnp14s54g386izgaxzrdr2nqv3pz9nvpyiwrn33zawr308z";
  };

  checkInputs = [ pytestCheckHook matplotlib mock pytest_xdist ];
  propagatedBuildInputs = [ pytorch scikitlearn tqdm pynvml ];

  # runs succesfully in 3.9, however, async isn't correctly closed so it will fail after test suite.
  doCheck = pythonOlder "3.9";

  # Some packages are not in NixPkgs; other tests try to build distributed
  # models, which doesn't work in the sandbox.
  # avoid tests which need special packages
  pytestFlagsArray = [
    "--ignore=tests/ignite/contrib/handlers/test_trains_logger.py"
    "--ignore=tests/ignite/metrics/test_dill.py"
    "--ignore=tests/ignite/metrics/test_ssim.py"
    "tests/"
  ];

  # disable tests which need specific packages
  disabledTests = [
    "idist"
    "tensorboard"
    "mlflow"
    "trains"
    "visdom"
    "test_setup_neptune"
    "test_output_handler" # needs mlflow
    "test_integration"
    "test_pbar" # slight output differences
    "test_write_results"
    "test_setup_plx"
  ];

  meta = with lib; {
    description = "High-level training library for PyTorch";
    homepage = "https://pytorch.org/ignite";
    license = licenses.bsd3;
    maintainers = [ maintainers.bcdarwin ];
  };
}