nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 pytestCheckHook,
7 pytest-xdist,
8 torchvision,
9 matplotlib,
10 mock,
11 packaging,
12 torch,
13}:
14
15buildPythonPackage rec {
16 pname = "ignite";
17 version = "0.5.3";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "pytorch";
22 repo = "ignite";
23 tag = "v${version}";
24 hash = "sha256-0lQe5fWR4t3uAJVfGVebkxiWHx8TvgNQzJylKNmjjo0=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 packaging
31 torch
32 ];
33
34 nativeCheckInputs = [
35 pytestCheckHook
36 matplotlib
37 mock
38 pytest-xdist
39 torchvision
40 ];
41
42 # async isn't correctly closed so it will fail after test suite.
43 doCheck = false;
44
45 enabledTestPaths = [
46 "tests/"
47 ];
48
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 disabledTestPaths = [
53 "tests/ignite/contrib/handlers/test_clearml_logger.py"
54 "tests/ignite/contrib/handlers/test_lr_finder.py"
55 "tests/ignite/contrib/handlers/test_trains_logger.py"
56 "tests/ignite/metrics/nlp/test_bleu.py"
57 "tests/ignite/metrics/nlp/test_rouge.py"
58 "tests/ignite/metrics/gan" # requires pytorch_fid; tries to download model to $HOME
59 "tests/ignite/metrics/test_dill.py"
60 "tests/ignite/metrics/test_psnr.py"
61 "tests/ignite/metrics/test_ssim.py"
62 ];
63
64 # disable tests which need specific packages
65 disabledTests = [
66 "idist"
67 "mlflow"
68 "tensorboard"
69 "test_gpu_info" # needs pynvml
70 "test_integration"
71 "test_output_handler" # needs mlflow
72 "test_pbar" # slight output differences
73 "test_setup_clearml_logging"
74 "test_setup_neptune"
75 "test_setup_plx"
76 "test_write_results"
77 "trains"
78 "visdom"
79 ];
80
81 pythonImportsCheck = [
82 "ignite"
83 "ignite.engine"
84 "ignite.handlers"
85 "ignite.metrics"
86 "ignite.distributed"
87 "ignite.exceptions"
88 "ignite.utils"
89 "ignite.contrib"
90 ];
91
92 meta = {
93 description = "High-level training library for PyTorch";
94 homepage = "https://pytorch-ignite.ai";
95 changelog = "https://github.com/pytorch/ignite/releases/tag/${src.tag}";
96 license = lib.licenses.bsd3;
97 maintainers = [ lib.maintainers.bcdarwin ];
98 };
99}