10
10
from pipdeptree ._models import PackageDAG
11
11
12
12
13
- def dump_graphviz ( # noqa: C901, PLR0912
13
+ def dump_graphviz ( # noqa: C901
14
14
tree : PackageDAG ,
15
15
output_format : str = "dot" ,
16
16
is_reverse : bool = False , # noqa: FBT001, FBT002
@@ -23,7 +23,6 @@ def dump_graphviz( # noqa: C901, PLR0912
23
23
:param bool is_reverse: reverse or not
24
24
:returns: representation of tree in the specified output format
25
25
:rtype: str or binary representation depending on the output format
26
-
27
26
"""
28
27
try :
29
28
from graphviz import Digraph # noqa: PLC0415
@@ -34,19 +33,9 @@ def dump_graphviz( # noqa: C901, PLR0912
34
33
)
35
34
raise SystemExit (1 ) from exc
36
35
37
- try :
38
- from graphviz import parameters # noqa: PLC0415
39
- except ImportError :
40
- from graphviz import backend # noqa: PLC0415 # pragma: no cover
36
+ from graphviz import parameters # noqa: PLC0415
41
37
42
- valid_formats = backend .FORMATS
43
- print ( # noqa: T201
44
- "Deprecation warning! Please upgrade graphviz to version >=0.18.0 "
45
- "Support for older versions will be removed in upcoming release" ,
46
- file = sys .stderr ,
47
- )
48
- else :
49
- valid_formats = parameters .FORMATS
38
+ valid_formats = parameters .FORMATS
50
39
51
40
if output_format not in valid_formats :
52
41
print (f"{ output_format } is not a supported output format." , file = sys .stderr ) # noqa: T201
0 commit comments