From 6c04a024f7fbc16243f13e8de36b510a91784b9f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 26 Jan 2023 16:38:23 +0100 Subject: [PATCH] python310Packages.objgraph: switch to pytestCheckHook - add adjust inputs --- .../python-modules/objgraph/default.nix | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/objgraph/default.nix b/pkgs/development/python-modules/objgraph/default.nix index 4b66d242ee29..ec75d9c452ae 100644 --- a/pkgs/development/python-modules/objgraph/default.nix +++ b/pkgs/development/python-modules/objgraph/default.nix @@ -1,25 +1,26 @@ { lib , buildPythonPackage , fetchPypi -, isPyPy -, substituteAll -, graphvizPkgs , graphviz -, mock +, graphvizPkgs +, isPyPy +, pytestCheckHook +, pythonOlder +, substituteAll }: buildPythonPackage rec { pname = "objgraph"; version = "3.5.0"; + format = "setuptools"; + + disabled = pythonOlder "3.5" || isPyPy; src = fetchPypi { inherit pname version; - sha256 = "4752ca5bcc0e0512e41b8cc4d2780ac2fd3b3eabd03b7e950a5594c06203dfc4"; + hash = "sha256-R1LKW8wOBRLkG4zE0ngKwv07PqvQO36VClWUwGID38Q="; }; - # Tests fail with PyPy. - disabled = isPyPy; - patches = [ (substituteAll { src = ./hardcode-graphviz-path.patch; @@ -27,14 +28,27 @@ buildPythonPackage rec { }) ]; - propagatedBuildInputs = [ graphviz ]; + propagatedBuildInputs = [ + graphviz + ]; - nativeCheckInputs = [ mock ]; + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "objgraph" + ]; + + pytestFlagsArray = [ + "tests.py" + ]; 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; [ ]; }; - }