depot/third_party/nixpkgs/pkgs/development/python-modules/objgraph/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

54 lines
1 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, graphviz
, graphvizPkgs
, isPyPy
, python
, pythonOlder
, substituteAll
}:
buildPythonPackage rec {
pname = "objgraph";
version = "3.6.0";
format = "setuptools";
disabled = pythonOlder "3.7" || isPyPy;
src = fetchPypi {
inherit pname version;
hash = "sha256-NpVnw3tPL5KBYLb27e3L6o/H6SmDGHf9EFbHipAMF9M=";
};
patches = [
(substituteAll {
src = ./hardcode-graphviz-path.patch;
graphviz = graphvizPkgs;
})
];
passthru.optional-dependencies = {
ipython = [
graphviz
];
};
pythonImportsCheck = [
"objgraph"
];
checkPhase = ''
runHook preCheck
${python.interpreter} tests.py
runHook postCheck
'';
meta = with lib; {
description = "Draws Python object reference graphs with graphviz";
homepage = "https://mg.pov.lt/objgraph/";
changelog = "https://github.com/mgedmin/objgraph/blob/${version}/CHANGES.rst";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}