git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.anytree: init at 2.6.0
commitef14821cc1813952b73ee1ddb2a893606a483637 authorworldofpeace <worldofpeace@protonmail.ch> dateThu 16 May 2019, 14:51 (8 years ago) parent3e2d174
3 files changed+80
pkgs/development/python-modules/anytree/default.nix+63 pkgs/development/python-modules/anytree/graphviz.patch+13 pkgs/top-level/python-packages.nix+4
pkgs/development/python-modules/anytree/default.nixnew file+63
@@ -0,0 +1,63 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, substituteAll
5+, fetchpatch
6+, nose
7+, six
8+, graphviz
9+, fontconfig
10+}:
11+
12+buildPythonPackage rec {
13+ pname = "anytree";
14+ version = "2.6.0";
15+
16+ src = fetchFromGitHub {
17+ owner = "c0fec0de";
18+ repo = pname;
19+ rev = version;
20+ sha256 = "1k3yj9h3ssjlz57r4g1qzxvprxjp7n92vms9fv0d46pigylxm5i3";
21+ };
22+
23+ patches = [
24+ (substituteAll {
25+ src = ./graphviz.patch;
26+ inherit graphviz;
27+ })
28+ # Fix tests python3.7
29+ # See: https://github.com/c0fec0de/anytree/pull/85
30+ (fetchpatch {
31+ url = "https://github.com/c0fec0de/anytree/commit/dd1b3d325546fef7436711e4cfea9a5fb61daaf8.patch";
32+ sha256 = "1dpa2jh2kakfaapnqrz03frb67q5fwxzc8c70i6nv1b01i9xw0bn";
33+ })
34+ ];
35+
36+ checkInputs = [
37+ nose
38+ ];
39+
40+ propagatedBuildInputs = [
41+ six
42+ ];
43+
44+ # Fontconfig error: Cannot load default config file
45+ preCheck = ''
46+ export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
47+ '';
48+
49+ checkPhase = ''
50+ runHook preCheck
51+
52+ nosetests
53+
54+ runHook postCheck
55+ '';
56+
57+ meta = with lib; {
58+ description = "Powerful and Lightweight Python Tree Data Structure";
59+ homepage = https://github.com/c0fec0de/anytree;
60+ license = licenses.asl20;
61+ maintainers = [ maintainers.worldofpeace ];
62+ };
63+}
pkgs/development/python-modules/anytree/graphviz.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/anytree/exporter/dotexporter.py b/anytree/exporter/dotexporter.py
2+index 9c10a68..209a952 100644
3+--- a/anytree/exporter/dotexporter.py
4++++ b/anytree/exporter/dotexporter.py
5+@@ -228,7 +228,7 @@ class DotExporter(object):
6+ for line in self:
7+ dotfile.write(("%s\n" % line).encode("utf-8"))
8+ dotfile.flush()
9+- cmd = ["dot", dotfilename, "-T", fileformat, "-o", filename]
10++ cmd = ["@graphviz@/bin/dot", dotfilename, "-T", fileformat, "-o", filename]
11+ check_call(cmd)
12+ try:
13+ remove(dotfilename)
pkgs/top-level/python-packages.nix+4
@@ -181,6 +181,10 @@ in {
181181
182182 ansicolor = callPackage ../development/python-modules/ansicolor { };
183183
184+ anytree = callPackage ../development/python-modules/anytree {
185+ inherit (pkgs) graphviz;
186+ };
187+
184188 aplpy = callPackage ../development/python-modules/aplpy { };
185189
186190 argon2_cffi = callPackage ../development/python-modules/argon2_cffi { };