albertosottile/darkdetect

distutils.version LooseVersion is deprecated

Carreau opened this issue · 2 comments

Since setuptools https://setuptools.pypa.io/en/latest/history.html#v59-6-0 it emits a deprecation warning.

from distutils.version import LooseVersion as V
if V(platform.mac_ver()[0]) < V("10.14"):

This means that dependees that turn warnings into error will fail (for example in CI).

    if V(platform.mac_ver()[0]) < V("10.14"):
../../miniconda3-intel/envs/napari/lib/python3.9/site-packages/setuptools/_distutils/version.py:53: in __init__
    warnings.warn(
E   DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

This can be worked around with a warning filter , for example:

[tool.pytest.ini_options]
filterwarnings = [
  "ignore:.*distutils Version classes are deprecated::darkdetect",  
]

It looks like you may not want dependencies, so I'm not if and how you wish to fix it.

Thanks for reporting this. I guess the suggested alternative would be to depend on packaging... I will think about what to do, I might recode some small logic here instead of adding a non-standard-library dependency.

Fixed in 0.7.0.