From 5e493f212aca0efc845c63dadc4736c0bfcfa96f Mon Sep 17 00:00:00 2001 From: jovidal195 Date: Tue, 5 Nov 2024 09:22:37 -0500 Subject: [PATCH] Fix deprecation warning by using packaging.version instead of distutils --- yellowbrick/style/colors.py | 4 ++-- yellowbrick/style/rcmod.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yellowbrick/style/colors.py b/yellowbrick/style/colors.py index a28590972..fa476fd4d 100644 --- a/yellowbrick/style/colors.py +++ b/yellowbrick/style/colors.py @@ -30,9 +30,9 @@ # Check to see if matplotlib is at least sorta up to date -from distutils.version import LooseVersion +from packaging.version import Version -mpl_ge_150 = LooseVersion(mpl.__version__) >= "1.5.0" +mpl_ge_150 = Version(mpl.__version__) >= Version("1.5.0") ########################################################################## diff --git a/yellowbrick/style/rcmod.py b/yellowbrick/style/rcmod.py index a41948d55..7728430b9 100644 --- a/yellowbrick/style/rcmod.py +++ b/yellowbrick/style/rcmod.py @@ -26,9 +26,9 @@ import matplotlib as mpl # Check to see if we have a slightly modern version of mpl -from distutils.version import LooseVersion +from packaging.version import Version -mpl_ge_150 = LooseVersion(mpl.__version__) >= "1.5.0" +mpl_ge_150 = Version(mpl.__version__) >= Version("1.5.0") from .. import _orig_rc_params