1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 fetchpatch2,
7 six,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "scales";
13 version = "1.0.9";
14 pyproject = true;
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-i2kw99S/EVGSKQtEx1evXiVOP8/Ldf+aUfXJakBOJ1M=";
19 };
20
21 patches = [
22 # Use html module in Python 3 and cgi module in Python 2
23 # https://github.com/Cue/scales/pull/47
24 (fetchpatch2 {
25 url = "https://github.com/Cue/scales/commit/ee69d45f1a7f928f7b241702e9be06007444115e.patch?full_index=1";
26 hash = "sha256-xBlgkh1mf+3J7GtNI0zGb7Sum8UYbTpUmM12sxK/fSU=";
27 })
28 ];
29
30 postPatch = ''
31 for file in scales_test formats_test aggregation_test; do
32 substituteInPlace src/greplin/scales/$file.py \
33 --replace-fail "assertEquals" "assertEqual"
34 done;
35 '';
36
37 build-system = [ setuptools ];
38
39 dependencies = [ six ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 meta = {
44 description = "Stats for Python processes";
45 homepage = "https://www.github.com/Cue/scales";
46 license = lib.licenses.asl20;
47 maintainers = with lib.maintainers; [ pyrox0 ];
48 };
49}