2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
bottle,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchpatch,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "pympler";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "1.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "Pympler";
|
|
|
|
inherit version;
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "993f1a3599ca3f4fcd7160c7545ad06310c9e12f70174ae7ae8d4e25f6c5d3fa";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes a TypeError on Python 3.11
|
|
|
|
# (see https://github.com/pympler/pympler/issues/148)
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/pympler/pympler/pull/149
|
2023-05-24 13:37:59 +00:00
|
|
|
(fetchpatch {
|
2024-04-21 15:54:59 +00:00
|
|
|
name = "Pympler-python-3.11-compat.patch";
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://github.com/pympler/pympler/commit/0fd8ad8da39207bd0dcb28bdac0407e04744c965.patch";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-6MK0AuhVhQkUzlk29HUh1+mSbfsVTBJ1YBtYNIFhh7U=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# 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.
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ bottle ];
|
|
|
|
|
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)'
|
|
|
|
# https://github.com/pympler/pympler/issues/134
|
|
|
|
"test_repr_function"
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonAtLeast "3.11") [
|
|
|
|
# https://github.com/pympler/pympler/issues/148
|
|
|
|
"test_findgarbage"
|
|
|
|
"test_get_tree"
|
|
|
|
"test_prune"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = stdenv.hostPlatform.isLinux;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tool to measure, monitor and analyze memory behavior";
|
|
|
|
homepage = "https://pythonhosted.org/Pympler/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|