diff --git a/pkgs/development/python-modules/graphviz/default.nix b/pkgs/development/python-modules/graphviz/default.nix index 11590048851d..881dec6b932f 100644 --- a/pkgs/development/python-modules/graphviz/default.nix +++ b/pkgs/development/python-modules/graphviz/default.nix @@ -8,13 +8,14 @@ , makeFontsConf , freefont_ttf , mock -, pytestCheckHook +, pytest , pytest-mock +, python }: buildPythonPackage rec { pname = "graphviz"; - version = "0.18.1"; + version = "0.19.1"; disabled = pythonOlder "3.6"; @@ -23,7 +24,7 @@ buildPythonPackage rec { owner = "xflr6"; repo = "graphviz"; rev = version; - sha256 = "sha256-Y3w9btjYvKfcEQGuAzV+o6edJ9VmVcWhc+ICOqy87uM="; + sha256 = "sha256-pE1lsx/r/BjvW5W2niDx/UeRXxx4kvCyHzAUAG3bdGc="; }; patches = [ @@ -43,10 +44,18 @@ buildPythonPackage rec { fontDirectories = [ freefont_ttf ]; }; - checkInputs = [ mock pytestCheckHook pytest-mock ]; + checkInputs = [ + mock + pytest + pytest-mock + ]; - preCheck = '' - export HOME=$TMPDIR + checkPhase = '' + runHook preCheck + + HOME=$TMPDIR ${python.interpreter} run-tests.py + + runHook postCheck ''; meta = with lib; { diff --git a/pkgs/development/python-modules/graphviz/paths.patch b/pkgs/development/python-modules/graphviz/paths.patch index 337435c6bbad..f53852544a2d 100644 --- a/pkgs/development/python-modules/graphviz/paths.patch +++ b/pkgs/development/python-modules/graphviz/paths.patch @@ -1,36 +1,36 @@ diff --git a/graphviz/backend/dot_command.py b/graphviz/backend/dot_command.py -index 1e123d1..41e19c2 100644 +index 60654bd..2c62b47 100644 --- a/graphviz/backend/dot_command.py +++ b/graphviz/backend/dot_command.py -@@ -11,7 +11,7 @@ from . import _common - __all__ = ['command'] +@@ -9,7 +9,7 @@ from .. import parameters + + __all__ = ['DOT_BINARY', 'command'] - #: :class:`pathlib.Path` of layout command (``Path('dot')``). -DOT_BINARY = pathlib.Path('dot') +DOT_BINARY = pathlib.Path('@graphviz@/bin/dot') def command(engine: str, format_: str, *, diff --git a/graphviz/backend/unflattening.py b/graphviz/backend/unflattening.py -index 5ed25d6..8d2faf8 100644 +index a386b8c..883cdc6 100644 --- a/graphviz/backend/unflattening.py +++ b/graphviz/backend/unflattening.py @@ -11,7 +11,7 @@ from . import execute - __all__ = ['unflatten'] - #: :class:`pathlib.Path` of unflatten command (``Path('unflatten')``). + __all__ = ['UNFLATTEN_BINARY', 'unflatten'] + -UNFLATTEN_BINARY = pathlib.Path('unflatten') +UNFLATTEN_BINARY = pathlib.Path('@graphviz@/bin/unflatten') - def unflatten(source: str, + @_tools.deprecate_positional_args(supported_number=1) diff --git a/graphviz/backend/viewing.py b/graphviz/backend/viewing.py -index 6d4a4d1..2cc6cd8 100644 +index fde74a6..6f29b68 100644 --- a/graphviz/backend/viewing.py +++ b/graphviz/backend/viewing.py -@@ -54,7 +54,7 @@ def view_darwin(filepath, *, quiet: bool) -> None: - @tools.attach(view, 'freebsd') - def view_unixoid(filepath, *, quiet: bool) -> None: +@@ -55,7 +55,7 @@ def view_darwin(filepath: typing.Union[os.PathLike, str], *, + def view_unixoid(filepath: typing.Union[os.PathLike, str], *, + quiet: bool) -> None: """Open filepath in the user's preferred application (linux, freebsd).""" - cmd = ['xdg-open', filepath] + cmd = ['@xdgutils@/bin/xdg-open', filepath]