1{ lib
2, buildPythonPackage
3, fetchPypi
4, substituteAll
5, graphviz
6, python
7, chardet
8, pyparsing
9}:
10
11buildPythonPackage rec {
12 pname = "pydot";
13 version = "1.4.2";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "248081a39bcb56784deb018977e428605c1c758f10897a339fce1dd728ff007d";
18 };
19
20 patches = [
21 (substituteAll {
22 src = ./hardcode-graphviz-path.patch;
23 inherit graphviz;
24 })
25 ];
26
27 postPatch = ''
28 # test_graphviz_regression_tests also fails upstream: https://github.com/pydot/pydot/pull/198
29 substituteInPlace test/pydot_unittest.py \
30 --replace "test_graphviz_regression_tests" "no_test_graphviz_regression_tests"
31 '';
32
33 propagatedBuildInputs = [ pyparsing ];
34
35 checkInputs = [ chardet ];
36
37 checkPhase = ''
38 cd test
39 ${python.interpreter} pydot_unittest.py
40 '';
41
42 meta = {
43 homepage = "https://github.com/erocarrera/pydot";
44 description = "Allows to easily create both directed and non directed graphs from Python";
45 license = lib.licenses.mit;
46 };
47}