1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 graphviz,
6 graphvizPkgs,
7 isPyPy,
8 python,
9 pythonOlder,
10 replaceVars,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "objgraph";
16 version = "3.6.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7" || isPyPy;
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-ALny9A90IuPH9FphxNr9r4HwP/BknW6uyGbwEDDlGtg=";
24 };
25
26 patches = [
27 (replaceVars ./hardcode-graphviz-path.patch {
28 graphviz = graphvizPkgs;
29 })
30 ];
31
32 build-system = [
33 setuptools
34 ];
35
36 optional-dependencies = {
37 ipython = [ graphviz ];
38 };
39
40 pythonImportsCheck = [ "objgraph" ];
41
42 checkPhase = ''
43 runHook preCheck
44 ${python.interpreter} tests.py
45 runHook postCheck
46 '';
47
48 meta = with lib; {
49 description = "Draws Python object reference graphs with graphviz";
50 homepage = "https://mg.pov.lt/objgraph/";
51 changelog = "https://github.com/mgedmin/objgraph/blob/${version}/CHANGES.rst";
52 license = licenses.mit;
53 maintainers = with maintainers; [ dotlambda ];
54 };
55}