stevenblack-blocklist: 3.15.5 -> 3.15.8 (#372042)
[NixPkgs.git] / pkgs / development / python-modules / ignite / default.nix
bloba34e5c5d6c24c95729545ea1b35641c8350e3254
2   lib,
3   stdenv,
4   buildPythonPackage,
5   fetchFromGitHub,
6   pythonOlder,
7   setuptools,
8   pytestCheckHook,
9   pytest-xdist,
10   torchvision,
11   matplotlib,
12   mock,
13   packaging,
14   torch,
17 buildPythonPackage rec {
18   pname = "ignite";
19   version = "0.5.1";
20   pyproject = true;
22   disabled = pythonOlder "3.8";
24   src = fetchFromGitHub {
25     owner = "pytorch";
26     repo = pname;
27     tag = "v${version}";
28     hash = "sha256-J0xrqAGwH0bAs59T7zA8irMWOGbE2+Zd9kwqxYUYYMA=";
29   };
31   build-system = [ setuptools ];
33   dependencies = [
34     packaging
35     torch
36   ];
38   nativeCheckInputs = [
39     pytestCheckHook
40     matplotlib
41     mock
42     pytest-xdist
43     torchvision
44   ];
46   # runs successfully in 3.9, however, async isn't correctly closed so it will fail after test suite.
47   doCheck = pythonOlder "3.9";
49   # Some packages are not in NixPkgs; other tests try to build distributed
50   # models, which doesn't work in the sandbox.
51   # avoid tests which need special packages
52   pytestFlagsArray = [
53     "--ignore=tests/ignite/contrib/handlers/test_clearml_logger.py"
54     "--ignore=tests/ignite/contrib/handlers/test_lr_finder.py"
55     "--ignore=tests/ignite/contrib/handlers/test_trains_logger.py"
56     "--ignore=tests/ignite/metrics/nlp/test_bleu.py"
57     "--ignore=tests/ignite/metrics/nlp/test_rouge.py"
58     "--ignore=tests/ignite/metrics/gan" # requires pytorch_fid; tries to download model to $HOME
59     "--ignore=tests/ignite/metrics/test_dill.py"
60     "--ignore=tests/ignite/metrics/test_psnr.py"
61     "--ignore=tests/ignite/metrics/test_ssim.py"
62     "tests/"
63   ];
65   # disable tests which need specific packages
66   disabledTests = [
67     "idist"
68     "mlflow"
69     "tensorboard"
70     "test_gpu_info" # needs pynvml
71     "test_integration"
72     "test_output_handler" # needs mlflow
73     "test_pbar" # slight output differences
74     "test_setup_clearml_logging"
75     "test_setup_neptune"
76     "test_setup_plx"
77     "test_write_results"
78     "trains"
79     "visdom"
80   ];
82   pythonImportsCheck = [
83     "ignite"
84     "ignite.engine"
85     "ignite.handlers"
86     "ignite.metrics"
87     "ignite.distributed"
88     "ignite.exceptions"
89     "ignite.utils"
90     "ignite.contrib"
91   ];
93   meta = {
94     description = "High-level training library for PyTorch";
95     homepage = "https://pytorch-ignite.ai";
96     changelog = "https://github.com/pytorch/ignite/releases/tag/v${version}";
97     license = lib.licenses.bsd3;
98     maintainers = [ lib.maintainers.bcdarwin ];
99     # ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a package
100     broken = stdenv.hostPlatform.isDarwin;
101   };