python312Packages.scales: run tests using pytestCheckHook

This commit is contained in:
Sigmanificient 2024-08-13 22:04:50 +02:00 committed by Pyrox
parent 03071e099e
commit 5b69bffd3a
No known key found for this signature in database
GPG Key ID: 8CDF3F7CAA53A0F5

View File

@ -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";