depot/third_party/nixpkgs/pkgs/development/python-modules/objgraph/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

56 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
graphviz,
graphvizPkgs,
isPyPy,
python,
pythonOlder,
substituteAll,
setuptools,
}:
buildPythonPackage rec {
pname = "objgraph";
version = "3.6.1";
pyproject = true;
disabled = pythonOlder "3.7" || isPyPy;
src = fetchPypi {
inherit pname version;
hash = "sha256-/pbHQUe7yq6GZbOW5TiL3MMZfe67pOY4HwUgLuW0U6c=";
};
patches = [
(substituteAll {
src = ./hardcode-graphviz-path.patch;
graphviz = graphvizPkgs;
})
];
build-system = [
setuptools
];
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 ];
};
}