2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-10-16 20:44:37 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, substituteAll
|
|
|
|
, six
|
|
|
|
, withGraphviz ? true
|
|
|
|
, graphviz
|
|
|
|
, fontconfig
|
2020-10-16 20:44:37 +00:00
|
|
|
# Tests
|
|
|
|
, pytestCheckHook
|
|
|
|
, nose
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anytree";
|
2020-06-15 15:56:04 +00:00
|
|
|
version = "2.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-15 15:56:04 +00:00
|
|
|
sha256 = "3f0f93f355a91bc3e6245319bf4c1d50e3416cc7a35cc1133c1ff38306bbccab";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = lib.optionals withGraphviz [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./graphviz.patch;
|
|
|
|
inherit graphviz;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
|
|
|
# tests print “Fontconfig error: Cannot load default config file”
|
|
|
|
preCheck = lib.optionalString withGraphviz ''
|
|
|
|
export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
|
|
|
|
'';
|
|
|
|
|
|
|
|
# circular dependency anytree → graphviz → pango → glib → gtk-doc → anytree
|
|
|
|
doCheck = withGraphviz;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook nose ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
pytestFlagsArray = lib.optionals (pythonOlder "3.4") [
|
|
|
|
# Use enums, which aren't available pre-python3.4
|
|
|
|
"--ignore=tests/test_resolver.py"
|
|
|
|
"--ignore=tests/test_search.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Powerful and Lightweight Python Tree Data Structure";
|
|
|
|
homepage = "https://github.com/c0fec0de/anytree";
|
|
|
|
license = licenses.asl20;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|