From fa9414bb45e8ee1b29f3a422396cbe6918d8ac27 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 3 Dec 2020 10:21:06 -0800 Subject: python3Packages.ignite: 0.3.0 -> 0.4.2, fix 3.9 build --- pkgs/development/python-modules/ignite/default.nix | 38 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/ignite/default.nix b/pkgs/development/python-modules/ignite/default.nix index 785ec5814918..307c25e724ee 100644 --- a/pkgs/development/python-modules/ignite/default.nix +++ b/pkgs/development/python-modules/ignite/default.nix @@ -1,7 +1,9 @@ { lib , buildPythonPackage , fetchFromGitHub -, pytest +, pytestCheckHook +, pytest_xdist +, pythonOlder , matplotlib , mock , pytorch @@ -12,23 +14,45 @@ buildPythonPackage rec { pname = "ignite"; - version = "0.3.0"; + version = "0.4.2"; src = fetchFromGitHub { owner = "pytorch"; repo = pname; rev = "v${version}"; - sha256 = "0i863kxi1r1hspj19lhn6r8256vdazjcyvis0s33fgzrf7kxi08x"; + sha256 = "00vcmhnp14s54g386izgaxzrdr2nqv3pz9nvpyiwrn33zawr308z"; }; - checkInputs = [ pytest matplotlib mock ]; + 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. - checkPhase = '' - pytest -k 'not visdom and not tensorboard and not mlflow and not polyaxon and not conftest and not engines and not distrib_' tests/ - ''; + # 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"; -- cgit v1.2.3