pythonPackages.anytree: init at 2.6.0

This commit is contained in:
worldofpeace 2019-05-16 14:51:23 -04:00
parent 3e2d174d3b
commit ef14821cc1
3 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,63 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, substituteAll
, fetchpatch
, nose
, six
, graphviz
, fontconfig
}:
buildPythonPackage rec {
pname = "anytree";
version = "2.6.0";
src = fetchFromGitHub {
owner = "c0fec0de";
repo = pname;
rev = version;
sha256 = "1k3yj9h3ssjlz57r4g1qzxvprxjp7n92vms9fv0d46pigylxm5i3";
};
patches = [
(substituteAll {
src = ./graphviz.patch;
inherit graphviz;
})
# Fix tests python3.7
# See: https://github.com/c0fec0de/anytree/pull/85
(fetchpatch {
url = "https://github.com/c0fec0de/anytree/commit/dd1b3d325546fef7436711e4cfea9a5fb61daaf8.patch";
sha256 = "1dpa2jh2kakfaapnqrz03frb67q5fwxzc8c70i6nv1b01i9xw0bn";
})
];
checkInputs = [
nose
];
propagatedBuildInputs = [
six
];
# Fontconfig error: Cannot load default config file
preCheck = ''
export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
'';
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 ];
};
}

View File

@ -0,0 +1,13 @@
diff --git a/anytree/exporter/dotexporter.py b/anytree/exporter/dotexporter.py
index 9c10a68..209a952 100644
--- a/anytree/exporter/dotexporter.py
+++ b/anytree/exporter/dotexporter.py
@@ -228,7 +228,7 @@ class DotExporter(object):
for line in self:
dotfile.write(("%s\n" % line).encode("utf-8"))
dotfile.flush()
- cmd = ["dot", dotfilename, "-T", fileformat, "-o", filename]
+ cmd = ["@graphviz@/bin/dot", dotfilename, "-T", fileformat, "-o", filename]
check_call(cmd)
try:
remove(dotfilename)

View File

@ -181,6 +181,10 @@ in {
ansicolor = callPackage ../development/python-modules/ansicolor { };
anytree = callPackage ../development/python-modules/anytree {
inherit (pkgs) graphviz;
};
aplpy = callPackage ../development/python-modules/aplpy { };
argon2_cffi = callPackage ../development/python-modules/argon2_cffi { };