nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pytest-xdist
6, torchvision
7, pythonOlder
8, matplotlib
9, mock
10, pytorch
11, scikit-learn
12, tqdm
13}:
14
15buildPythonPackage rec {
16 pname = "ignite";
17 version = "0.4.8";
18
19 src = fetchFromGitHub {
20 owner = "pytorch";
21 repo = pname;
22 rev = "v${version}";
23 sha256 = "sha256-S4wL1RyQ6aDW16wbSl+86VhSJ2S9oanYhNtPQdBtdrA=";
24 };
25
26 checkInputs = [ pytestCheckHook matplotlib mock pytest-xdist torchvision ];
27 propagatedBuildInputs = [ pytorch scikit-learn tqdm ];
28
29 # runs succesfully in 3.9, however, async isn't correctly closed so it will fail after test suite.
30 doCheck = pythonOlder "3.9";
31
32 # Some packages are not in NixPkgs; other tests try to build distributed
33 # models, which doesn't work in the sandbox.
34 # avoid tests which need special packages
35 pytestFlagsArray = [
36 "--ignore=tests/ignite/contrib/handlers/test_clearml_logger.py"
37 "--ignore=tests/ignite/contrib/handlers/test_lr_finder.py"
38 "--ignore=tests/ignite/contrib/handlers/test_trains_logger.py"
39 "--ignore=tests/ignite/metrics/nlp/test_bleu.py"
40 "--ignore=tests/ignite/metrics/nlp/test_rouge.py"
41 "--ignore=tests/ignite/metrics/gan" # requires pytorch_fid; tries to download model to $HOME
42 "--ignore=tests/ignite/metrics/test_dill.py"
43 "--ignore=tests/ignite/metrics/test_psnr.py"
44 "--ignore=tests/ignite/metrics/test_ssim.py"
45 "tests/"
46 ];
47
48 # disable tests which need specific packages
49 disabledTests = [
50 "idist"
51 "mlflow"
52 "tensorboard"
53 "test_gpu_info" # needs pynvml
54 "test_integration"
55 "test_output_handler" # needs mlflow
56 "test_pbar" # slight output differences
57 "test_setup_clearml_logging"
58 "test_setup_neptune"
59 "test_setup_plx"
60 "test_write_results"
61 "trains"
62 "visdom"
63 ];
64
65 meta = with lib; {
66 description = "High-level training library for PyTorch";
67 homepage = "https://pytorch.org/ignite";
68 license = licenses.bsd3;
69 maintainers = [ maintainers.bcdarwin ];
70 };
71}