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