1{
2 lib,
3 stdenv,
4 bottle,
5 buildPythonPackage,
6 fetchPypi,
7 pytestCheckHook,
8 pythonAtLeast,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "pympler";
14 version = "1.1";
15 pyproject = true;
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-HqqGfLiZLCGEMPFwj9rM2lPfBkFE0cVlax5vHuYABCQ=";
20 };
21
22 build-system = [ setuptools ];
23
24 # There is a version of bottle bundled with Pympler, but it is broken on
25 # Python 3.11. Fortunately, Pympler will preferentially import an external
26 # bottle if it is available, so we make it an explicit dependency.
27 dependencies = [ bottle ];
28
29 nativeCheckInputs = [ pytestCheckHook ];
30
31 disabledTests =
32 [
33 # 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)'
34 # https://github.com/pympler/pympler/issues/134
35 "test_repr_function"
36 # Stuck
37 "test_locals"
38 "test_globals"
39 "test_traceback"
40 "test_otracker_diff"
41 "test_stracker_store_summary"
42 ]
43 ++ lib.optionals (pythonAtLeast "3.11") [
44 # https://github.com/pympler/pympler/issues/148
45 "test_findgarbage"
46 "test_get_tree"
47 "test_prune"
48 ]
49 ++ lib.optionals (pythonAtLeast "3.13") [
50 # https://github.com/pympler/pympler/issues/163
51 "test_edges_new"
52 "test_edges_old"
53 "test_split"
54 ];
55
56 doCheck = stdenv.hostPlatform.isLinux;
57
58 meta = with lib; {
59 description = "Tool to measure, monitor and analyze memory behavior";
60 homepage = "https://github.com/pympler/pympler";
61 license = licenses.asl20;
62 };
63}