From cf41f31a6ca2f60ee8855d3620f49f88f84ab80e Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 8 Dec 2023 15:51:44 +0900 Subject: [PATCH] python312Packages.graphviz: fix tests with python3.12 --- .../python-modules/graphviz/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/graphviz/default.nix b/pkgs/development/python-modules/graphviz/default.nix index 6af54cbb6d6d..8f145c13e722 100644 --- a/pkgs/development/python-modules/graphviz/default.nix +++ b/pkgs/development/python-modules/graphviz/default.nix @@ -3,11 +3,13 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub +, fetchpatch , substituteAll , graphviz , xdg-utils , makeFontsConf , freefont_ttf +, setuptools , mock , pytest , pytest-mock @@ -17,7 +19,7 @@ buildPythonPackage rec { pname = "graphviz"; version = "0.20.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -35,6 +37,12 @@ buildPythonPackage rec { inherit graphviz; xdgutils = xdg-utils; }) + # https://github.com/xflr6/graphviz/issues/209 + (fetchpatch { + name = "fix-tests-with-python312.patch"; + url = "https://github.com/xflr6/graphviz/commit/5ce9fc5de4f2284baa27d7a8d68ab0885d032868.patch"; + hash = "sha256-jREPACSc4aoHY3G+39e8Axqajw4eeKkAeVu2s40v1nI="; + }) ]; postPatch = '' @@ -46,6 +54,10 @@ buildPythonPackage rec { fontDirectories = [ freefont_ttf ]; }; + nativeBuildInputs = [ + setuptools + ]; + nativeCheckInputs = [ mock pytest