diff --git a/pkgs/development/python-modules/scales/default.nix b/pkgs/development/python-modules/scales/default.nix index ff9ab853e5c9..c620c23119f1 100644 --- a/pkgs/development/python-modules/scales/default.nix +++ b/pkgs/development/python-modules/scales/default.nix @@ -2,7 +2,8 @@ lib, buildPythonPackage, fetchPypi, - nose, + pytestCheckHook, + fetchpatch2, six, }: @@ -16,11 +17,24 @@ buildPythonPackage rec { sha256 = "8b6930f7d4bf115192290b44c757af5e254e3fcfcb75ff9a51f5c96a404e2753"; }; - nativeCheckInputs = [ nose ]; - propagatedBuildInputs = [ six ]; + patches = [ + # Use html module in Python 3 and cgi module in Python 2 + # https://github.com/Cue/scales/pull/47 + (fetchpatch2 { + url = "https://github.com/Cue/scales/commit/ee69d45f1a7f928f7b241702e9be06007444115e.patch?full_index=1"; + hash = "sha256-xBlgkh1mf+3J7GtNI0zGb7Sum8UYbTpUmM12sxK/fSU="; + }) + ]; - # No tests included - doCheck = false; + postPatch = '' + for file in scales_test formats_test aggregation_test; do + substituteInPlace src/greplin/scales/$file.py \ + --replace-fail "assertEquals" "assertEqual" + done; + ''; + + nativeCheckInputs = [ pytestCheckHook ]; + propagatedBuildInputs = [ six ]; meta = with lib; { description = "Stats for Python processes";