git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #109507 from dotlambda/python-graphviz-0.16

pythonPackages.graphviz: 0.14.1 -> 0.16

commita824dc6bdd9a6fa2e6ce40f3e9e5d89f95d4c2c3 authorRobert Schütz <dev@schuetz-co.de> dateWed 20 Jan 2021, 11:43 (6 years ago) parent60799d1cfa8f9a
5 files changed+41−71
pkgs/development/python-modules/graphviz/default.nix+4−8 pkgs/development/python-modules/graphviz/hardcode-graphviz-path.patch+37−19 pkgs/development/python-modules/prov/default.nix−14 pkgs/development/python-modules/pydotplus/default.nix−28 pkgs/top-level/python-packages.nix−2
pkgs/development/python-modules/graphviz/default.nix+4−8
@@ -6,21 +6,21 @@
66, makeFontsConf
77, freefont_ttf
88, mock
9−, pytest
9+, pytestCheckHook
1010, pytest-mock
1111, pytestcov
1212}:
1313
1414buildPythonPackage rec {
1515 pname = "graphviz";
16− version = "0.14.1";
16+ version = "0.16";
1717
1818 # patch does not apply to PyPI tarball due to different line endings
1919 src = fetchFromGitHub {
2020 owner = "xflr6";
2121 repo = "graphviz";
2222 rev = version;
23− sha256 = "02bdiac5x93f2mjw5kpgs6kv81hzg07y0mw1nxvhyg8aignzmh3c";
23+ sha256 = "147vi60mi57z623lhllwwzczzicv2iwj1yrmllj5xx5788i73j6g";
2424 };
2525
2626 patches = [
@@ -35,11 +35,7 @@ buildPythonPackage rec {
3535 fontDirectories = [ freefont_ttf ];
3636 };
3737
38− checkInputs = [ mock pytest pytest-mock pytestcov ];
39−
40− checkPhase = ''
41− pytest
42− '';
38+ checkInputs = [ mock pytestCheckHook pytest-mock pytestcov ];
4339
4440 meta = with lib; {
4541 description = "Simple Python interface for Graphviz";
pkgs/development/python-modules/graphviz/hardcode-graphviz-path.patch+37−19
@@ -1,19 +1,28 @@
11diff --git a/graphviz/backend.py b/graphviz/backend.py
2−index 6f4cc0c..bc4781e 100644
2+index d2c4b97..f7175cd 100644
33--- a/graphviz/backend.py
44+++ b/graphviz/backend.py
55@@ -122,7 +122,7 @@ def command(engine, format_, filepath=None, renderer=None, formatter=None):
66 raise ValueError('unknown formatter: %r' % formatter)
77
88 output_format = [f for f in (format_, renderer, formatter) if f is not None]
9−- cmd = [engine, '-T%s' % ':'.join(output_format)]
10−+ cmd = [os.path.join('@graphviz@/bin', engine), '-T%s' % ':'.join(output_format)]
9+- cmd = ['dot', '-K%s' % engine, '-T%s' % ':'.join(output_format)]
10++ cmd = ['@graphviz@/bin/dot', '-K%s' % engine, '-T%s' % ':'.join(output_format)]
1111
1212 if filepath is None:
1313 rendered = None
14−@@ -255,7 +255,7 @@ def version():
15− subprocess.CalledProcessError: If the exit status is non-zero.
16− RuntimmeError: If the output cannot be parsed into a version number.
14+@@ -275,7 +275,7 @@ def unflatten(source,
15+ if fanout and stagger is None:
16+ raise RequiredArgumentError('fanout given without stagger')
17+
18+- cmd = ['unflatten']
19++ cmd = ['@graphviz@/bin/unflatten']
20+ if stagger is not None:
21+ cmd += ['-l', str(stagger)]
22+ if fanout:
23+@@ -304,7 +304,7 @@ def version():
24+ Graphviz Release version entry format
25+ https://gitlab.com/graphviz/graphviz/-/blob/f94e91ba819cef51a4b9dcb2d76153684d06a913/gen_version.py#L17-20
1726 """
1827- cmd = ['dot', '-V']
1928+ cmd = ['@graphviz@/bin/dot', '-V']
@@ -21,10 +30,10 @@ index 6f4cc0c..bc4781e 100644
2130 stdout=subprocess.PIPE,
2231 stderr=subprocess.STDOUT)
2332diff --git a/tests/test_backend.py b/tests/test_backend.py
24−index 9f307f5..e43bf5b 100644
33+index d10ef1a..e4aba58 100644
2534--- a/tests/test_backend.py
2635+++ b/tests/test_backend.py
27−@@ -50,7 +50,7 @@ def test_run_encoding_mocked(mocker, Popen, input=u'sp\xe4m', encoding='utf-8'):
36+@@ -52,7 +52,7 @@ def test_run_encoding_mocked(mocker, Popen, input=u'sp\xe4m', encoding='utf-8'):
2837 m.decode.assert_called_once_with(encoding)
2938
3039
@@ -33,34 +42,43 @@ index 9f307f5..e43bf5b 100644
3342 @pytest.mark.usefixtures('empty_path')
3443 @pytest.mark.parametrize('func, args', [
3544 (render, ['dot', 'pdf', 'nonfilepath']),
36−@@ -143,7 +143,7 @@ def test_render_mocked(capsys, mocker, Popen, quiet): # noqa: N803
45+@@ -146,7 +146,7 @@ def test_render_mocked(capsys, mocker, Popen, quiet): # noqa: N803
3746
3847 assert render('dot', 'pdf', 'nonfilepath', quiet=quiet) == 'nonfilepath.pdf'
3948
40−- Popen.assert_called_once_with(['dot', '-Tpdf', '-O', 'nonfilepath'],
41−+ Popen.assert_called_once_with(['@graphviz@/bin/dot', '-Tpdf', '-O', 'nonfilepath'],
49+- Popen.assert_called_once_with(['dot', '-Kdot', '-Tpdf', '-O', 'nonfilepath'],
50++ Popen.assert_called_once_with(['@graphviz@/bin/dot', '-Kdot', '-Tpdf', '-O', 'nonfilepath'],
4251 stdout=subprocess.PIPE,
4352 stderr=subprocess.PIPE,
4453 cwd=None, startupinfo=mocker.ANY)
45−@@ -201,7 +201,7 @@ def test_pipe_pipe_invalid_data_mocked(mocker, py2, Popen, quiet): # noqa: N803
54+@@ -208,7 +208,7 @@ def test_pipe_pipe_invalid_data_mocked(mocker, py2, Popen, quiet): # noqa: N803
4655 assert e.value.stdout is mocker.sentinel.out
4756 e.value.stdout = mocker.sentinel.new_stdout
4857 assert e.value.stdout is mocker.sentinel.new_stdout
49−- Popen.assert_called_once_with(['dot', '-Tpng'],
50−+ Popen.assert_called_once_with(['@graphviz@/bin/dot', '-Tpng'],
58+- Popen.assert_called_once_with(['dot', '-Kdot', '-Tpng'],
59++ Popen.assert_called_once_with(['@graphviz@/bin/dot', '-Kdot', '-Tpng'],
5160 stdin=subprocess.PIPE,
5261 stdout=subprocess.PIPE,
5362 stderr=subprocess.PIPE,
54−@@ -224,7 +224,7 @@ def test_pipe_mocked(capsys, mocker, Popen, quiet): # noqa: N803
63+@@ -231,7 +231,7 @@ def test_pipe_mocked(capsys, mocker, Popen, quiet): # noqa: N803
5564
5665 assert pipe('dot', 'png', b'nongraph', quiet=quiet) is mocker.sentinel.out
5766
58−- Popen.assert_called_once_with(['dot', '-Tpng'],
59−+ Popen.assert_called_once_with(['@graphviz@/bin/dot', '-Tpng'],
67+- Popen.assert_called_once_with(['dot', '-Kdot', '-Tpng'],
68++ Popen.assert_called_once_with(['@graphviz@/bin/dot', '-Kdot', '-Tpng'],
69+ stdin=subprocess.PIPE,
70+ stdout=subprocess.PIPE,
71+ stderr=subprocess.PIPE,
72+@@ -259,7 +259,7 @@ def test_unflatten_mocked(capsys, mocker, Popen):
73+ proc.communicate.return_value = (b'nonresult', b'')
74+
75+ assert unflatten('nonsource') == 'nonresult'
76+- Popen.assert_called_once_with(['unflatten'],
77++ Popen.assert_called_once_with(['@graphviz@/bin/unflatten'],
6078 stdin=subprocess.PIPE,
6179 stdout=subprocess.PIPE,
6280 stderr=subprocess.PIPE,
63−@@ -250,7 +250,7 @@ def test_version_parsefail_mocked(mocker, Popen): # noqa: N803
81+@@ -290,7 +290,7 @@ def test_version_parsefail_mocked(mocker, Popen): # noqa: N803
6482 with pytest.raises(RuntimeError, match=r'nonversioninfo'):
6583 version()
6684
@@ -69,7 +87,7 @@ index 9f307f5..e43bf5b 100644
6987 stdout=subprocess.PIPE,
7088 stderr=subprocess.STDOUT,
7189 startupinfo=mocker.ANY)
72−@@ -269,7 +269,7 @@ def test_version_mocked(mocker, Popen, stdout, expected): # noqa: N803
90+@@ -312,7 +312,7 @@ def test_version_mocked(mocker, Popen, stdout, expected): # noqa: N803
7391
7492 assert version() == expected
7593
pkgs/development/python-modules/prov/default.nix−14
@@ -4,11 +4,8 @@
44, lxml
55, networkx
66, dateutil
7−, six
8−, pydotplus
97, rdflib
108, pydot
11−, glibcLocales
129}:
1310
1411buildPythonPackage rec {
@@ -20,28 +17,17 @@ buildPythonPackage rec {
2017 sha256 = "b6438f2195ecb9f6e8279b58971e02bc51814599b5d5383366eef91d867422ee";
2118 };
2219
23− prePatch = ''
24− substituteInPlace setup.py --replace "six==1.10.0" "six>=1.10.0"
25− '';
26−
2720 propagatedBuildInputs = [
2821 lxml
2922 networkx
3023 dateutil
31− six
32− pydotplus
3324 rdflib
3425 ];
3526
3627 checkInputs = [
3728 pydot
38− glibcLocales
3929 ];
4030
41− preCheck = ''
42− export LC_ALL="en_US.utf-8"
43− '';
44−
4531 meta = with lib; {
4632 description = "A Python library for W3C Provenance Data Model (PROV)";
4733 homepage = "https://github.com/trungdong/prov";
pkgs/development/python-modules/pydotplus/default.nixdeleted−28
@@ -1,28 +0,0 @@
1−{ lib, stdenv
2−, buildPythonPackage
3−, fetchPypi
4−, pyparsing
5−, graphviz
6−}:
7−
8−buildPythonPackage rec {
9− pname = "pydotplus";
10− version = "2.0.2";
11−
12− src = fetchPypi {
13− inherit pname version;
14− sha256 = "1i05cnk3yh722fdyaq0asr7z9xf7v7ikbmnpxa8j6pdqx6g5xs4i";
15− };
16−
17− propagatedBuildInputs = [
18− pyparsing
19− graphviz
20− ];
21−
22− meta = with lib; {
23− homepage = "https://github.com/erocarrera/pydot";
24− description = "An improved version of the old pydot project that provides a Python Interface to Graphviz’s Dot language";
25− license = licenses.mit;
26− maintainers = with maintainers; [ ashgillman ];
27− };
28−}
pkgs/top-level/python-packages.nix−2
@@ -5278,8 +5278,6 @@ in {
52785278
52795279 pydot = callPackage ../development/python-modules/pydot { inherit (pkgs) graphviz; };
52805280
5281− pydotplus = callPackage ../development/python-modules/pydotplus { };
5282−
52835281 pydrive = callPackage ../development/python-modules/pydrive { };
52845282
52855283 pydsdl = callPackage ../development/python-modules/pydsdl { };