2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
substituteAll,
|
|
|
|
graphviz,
|
|
|
|
coreutils,
|
|
|
|
pkg-config,
|
|
|
|
setuptools,
|
|
|
|
pytest,
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygraphviz";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.13";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.10";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pygraphviz";
|
|
|
|
repo = "pygraphviz";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "refs/tags/pygraphviz-${version}";
|
|
|
|
hash = "sha256-/H7eHgs3jtbgat8//1Y1S3iV5s0UBKW+J+zK+f8qGqI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-03-09 03:18:52 +00:00
|
|
|
# pygraphviz depends on graphviz executables and wc being in PATH
|
2020-04-24 23:36:52 +00:00
|
|
|
(substituteAll {
|
2021-03-09 03:18:52 +00:00
|
|
|
src = ./path.patch;
|
2024-06-05 15:53:02 +00:00
|
|
|
path = lib.makeBinPath [
|
|
|
|
graphviz
|
|
|
|
coreutils
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
setuptools
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ graphviz ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2022-01-25 03:21:06 +00:00
|
|
|
runHook preCheck
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest --pyargs pygraphviz
|
2022-01-25 03:21:06 +00:00
|
|
|
runHook postCheck
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
pythonImportsCheck = [ "pygraphviz" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python interface to Graphviz graph drawing package";
|
|
|
|
homepage = "https://github.com/pygraphviz/pygraphviz";
|
|
|
|
license = licenses.bsd3;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
matthiasbeyer
|
|
|
|
dotlambda
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|