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 # 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)'
33 # https://github.com/pympler/pympler/issues/134
34 "test_repr_function"
35 # Stuck
36 "test_locals"
37 "test_globals"
38 "test_traceback"
39 "test_otracker_diff"
40 "test_stracker_store_summary"
41 ]
42 ++ lib.optionals (pythonAtLeast "3.11") [
43 # https://github.com/pympler/pympler/issues/148
44 "test_findgarbage"
45 "test_get_tree"
46 "test_prune"
47 ]
48 ++ lib.optionals (pythonAtLeast "3.13") [
49 # https://github.com/pympler/pympler/issues/163
50 "test_edges_new"
51 "test_edges_old"
52 "test_split"
53 ];
54
55 doCheck = stdenv.hostPlatform.isLinux;
56
57 meta = with lib; {
58 description = "Tool to measure, monitor and analyze memory behavior";
59 homepage = "https://github.com/pympler/pympler";
60 license = licenses.asl20;
61 };
62}