Skip to content

Commit acc9c74

Browse files
committed
display matplotlib backend as part of sys-info
1 parent 44bea32 commit acc9c74

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

template/utils/_config.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,16 @@ def _list_dependencies_info(
9191
version_ = version(dep)
9292
except Exception:
9393
version_ = "Not found."
94-
out(f"{dep}:".ljust(ljust) + version_ + "\n")
94+
95+
# handle special dependencies with backends, C dep, ..
96+
if dep in ("matplotlib", "seaborn") and version_ != "Not found.":
97+
try:
98+
from matplotlib import pyplot as plt
99+
backend = plt.get_backend()
100+
except Exception:
101+
backend = "Not found"
102+
103+
out(f"{dep}:".ljust(ljust) + version_ + f" (backend: {backend})\n")
104+
105+
else:
106+
out(f"{dep}:".ljust(ljust) + version_ + "\n")

0 commit comments

Comments
 (0)