summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pympler/default.nix
blob: 1ea4ea141622071ce17be094c455cda4bf26c3d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  stdenv,
  bottle,
  buildPythonPackage,
  fetchPypi,
  pytestCheckHook,
  pythonAtLeast,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pympler";
  version = "1.1";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-HqqGfLiZLCGEMPFwj9rM2lPfBkFE0cVlax5vHuYABCQ=";
  };

  build-system = [ setuptools ];

  # There is a version of bottle bundled with Pympler, but it is broken on
  # Python 3.11. Fortunately, Pympler will preferentially import an external
  # bottle if it is available, so we make it an explicit dependency.
  dependencies = [ bottle ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTests = [
    # 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)'
    # https://github.com/pympler/pympler/issues/134
    "test_repr_function"
    # Stuck
    "test_locals"
    "test_globals"
    "test_traceback"
    "test_otracker_diff"
    "test_stracker_store_summary"
  ]
  ++ lib.optionals (pythonAtLeast "3.11") [
    # https://github.com/pympler/pympler/issues/148
    "test_findgarbage"
    "test_get_tree"
    "test_prune"
  ]
  ++ lib.optionals (pythonAtLeast "3.13") [
    # https://github.com/pympler/pympler/issues/163
    "test_edges_new"
    "test_edges_old"
    "test_split"
  ];

  doCheck = stdenv.hostPlatform.isLinux;

  meta = {
    description = "Tool to measure, monitor and analyze memory behavior";
    homepage = "https://github.com/pympler/pympler";
    license = lib.licenses.asl20;
  };
}