Skip to content

Commit 9c46b0f

Browse files
authored
Remove unused graphviz library code (#460)
We currently expect graphviz>=0.20.3, so the try-except branch that was removed in this snapshot shouldn't ever execute.
1 parent 0fb230d commit 9c46b0f

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/pipdeptree/_render/graphviz.py

+3-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pipdeptree._models import PackageDAG
1111

1212

13-
def dump_graphviz( # noqa: C901, PLR0912
13+
def dump_graphviz( # noqa: C901
1414
tree: PackageDAG,
1515
output_format: str = "dot",
1616
is_reverse: bool = False, # noqa: FBT001, FBT002
@@ -23,7 +23,6 @@ def dump_graphviz( # noqa: C901, PLR0912
2323
:param bool is_reverse: reverse or not
2424
:returns: representation of tree in the specified output format
2525
:rtype: str or binary representation depending on the output format
26-
2726
"""
2827
try:
2928
from graphviz import Digraph # noqa: PLC0415
@@ -34,19 +33,9 @@ def dump_graphviz( # noqa: C901, PLR0912
3433
)
3534
raise SystemExit(1) from exc
3635

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
4137

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
5039

5140
if output_format not in valid_formats:
5241
print(f"{output_format} is not a supported output format.", file=sys.stderr) # noqa: T201

0 commit comments

Comments
 (0)