Skip to content

Update Dependencies and Fix Version Comparison Deprecation Warnings #1323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
8 tasks
lwgray opened this issue Feb 19, 2025 · 0 comments
Open
8 tasks

Update Dependencies and Fix Version Comparison Deprecation Warnings #1323

lwgray opened this issue Feb 19, 2025 · 0 comments
Assignees

Comments

@lwgray
Copy link
Contributor

lwgray commented Feb 19, 2025

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:

  1. Replace deprecated LooseVersion with packaging.version
  2. 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

  • Fix LooseVersion deprecation in colors.py
  • Fix LooseVersion deprecation in rcmod.py
  • Update setup.py with new dependency versions
  • Update requirements.txt
  • Add packaging dependency if not already present
  • Test all visualizations with updated dependencies
  • Update documentation to reflect new minimum versions
  • Add migration notes to changelog

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
@lwgray lwgray self-assigned this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant