nixpkgs/pkgs/development/python-modules/anytree/default.nix
Vladimír Čunát 97e2ca3447
Revert "Merge #97847 python27Packages.anytree: fix build"
Moving to staging.  It's a really large rebuild.
This reverts commit 9a8bd1e564, reversing
changes made to 9866abf63b.
2020-09-13 08:13:00 +02:00

60 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, substituteAll
, fetchpatch
, nose
, six
, withGraphviz ? true
, graphviz
, fontconfig
}:
buildPythonPackage rec {
pname = "anytree";
version = "2.8.0";
src = fetchPypi {
inherit pname version;
sha256 = "3f0f93f355a91bc3e6245319bf4c1d50e3416cc7a35cc1133c1ff38306bbccab";
};
patches = lib.optionals withGraphviz [
(substituteAll {
src = ./graphviz.patch;
inherit graphviz;
})
];
checkInputs = [
nose
];
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;
checkPhase = ''
runHook preCheck
nosetests
runHook postCheck
'';
meta = with lib; {
description = "Powerful and Lightweight Python Tree Data Structure";
homepage = "https://github.com/c0fec0de/anytree";
license = licenses.asl20;
maintainers = [ maintainers.worldofpeace ];
};
}