Description
Several deprecation warnings are occurring in our test suite related to version comparisons:
../yellowbrick/style/colors.py:35
/Users/lwgray/dev/yellowbrick/yellowbrick/style/colors.py:35: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
mpl_ge_150 = LooseVersion(mpl.__version__) >= "1.5.0"
../../../opt/anaconda3/envs/yb/lib/python3.13/site-packages/setuptools/_distutils/version.py:336
/Users/lwgray/opt/anaconda3/envs/yb/lib/python3.13/site-packages/setuptools/_distutils/version.py:336: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
other = LooseVersion(other)
../yellowbrick/style/rcmod.py:31
/Users/lwgray/dev/yellowbrick/yellowbrick/style/rcmod.py:31: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
mpl_ge_150 = LooseVersion(mpl.__version__) >= "1.5.0"
These warnings indicate we need to:
- Replace deprecated
LooseVersion with packaging.version
- Update our minimum dependencies to modern versions
Proposed Changes
Version Comparison Fix
Replace LooseVersion with packaging.version in affected files:
- yellowbrick/style/colors.py
- yellowbrick/style/rcmod.py
# Old
from distutils.version import LooseVersion
mpl_ge_150 = LooseVersion(mpl.__version__) >= "1.5.0"
# New
from packaging import version
mpl_ge_150 = version.parse(mpl.__version__) >= version.parse("1.5.0")
Dependency Updates
# Library Dependencies
matplotlib>=3.6.0
scipy>=1.9.0
scikit-learn>=1.1.0
numpy>=1.21.0
cycler>=0.11.0
# Testing Requirements
pytest>=7.1.0
pytest-cov>=3.0.0
pytest-flakes>=4.0.5
pytest-spec>=2.0.0
coverage>=6.4.0
# Optional Testing Dependencies
nltk>=3.7.0
pandas>=1.4.0
umap-learn>=0.5.3
numba>=0.56.0
Tasks
Breaking Changes
This will increase the minimum required versions of several core dependencies. Users will need to upgrade their environments to use newer versions of the package.
Additional Notes
- The version checks for Matplotlib 1.5.0 seem outdated since we're requiring 3.6.0+
- Consider removing legacy compatibility code for very old Matplotlib versions
- The warning in setuptools/_distutils/version.py is from a dependency and should resolve with updates
Labels: dependencies, deprecation-warning, breaking-change, maintenance
The key differences in this revised issue are:
1. Actual warning messages with file locations and line numbers
2. Specific files that need to be changed
3. More precise tasks based on the actual warnings
4. Note about the setuptools warning coming from a dependency
@DistrictDataLabs/team-oz-maintainers
Description
Several deprecation warnings are occurring in our test suite related to version comparisons:
These warnings indicate we need to:
LooseVersionwithpackaging.versionProposed Changes
Version Comparison Fix
Replace
LooseVersionwithpackaging.versionin affected files:Dependency Updates
Tasks
LooseVersiondeprecation in colors.pyLooseVersiondeprecation in rcmod.pyBreaking Changes
This will increase the minimum required versions of several core dependencies. Users will need to upgrade their environments to use newer versions of the package.
Additional Notes
Labels: dependencies, deprecation-warning, breaking-change, maintenance