From 75cdfaf76037e1e4a478654ebbcb538f0ee8d99e Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 28 Dec 2024 21:03:25 -0500 Subject: [PATCH] FIX: account for changes to private methods in mpl39 Also require at least mpl 3.9 --- mpl_gui/_manage_backend.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mpl_gui/_manage_backend.py b/mpl_gui/_manage_backend.py index 6e51de2..a9b62fc 100644 --- a/mpl_gui/_manage_backend.py +++ b/mpl_gui/_manage_backend.py @@ -5,6 +5,7 @@ from matplotlib import cbook, rcsetup from matplotlib import rcParams, rcParamsDefault +from matplotlib.backends.registry import backend_registry import matplotlib.backend_bases @@ -92,7 +93,7 @@ def select_gui_toolkit(newbackend=None): if newbackend.lower() == "tkagg": backend_name = f"mpl_gui._patched_backends.{newbackend.lower()}" else: - backend_name = cbook._backend_module_name(newbackend) + backend_name = backend_registry._backend_module_name(newbackend) mod = importlib.import_module(backend_name) if hasattr(mod, "Backend"): diff --git a/requirements.txt b/requirements.txt index 7260f92..188b1f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ # List required packages in this file, one per line. -matplotlib +matplotlib>3.9