seaborn icon indicating copy to clipboard operation
seaborn copied to clipboard

DeprecationWarning with the latest setuptools

Open Stannislav opened this issue 2 years ago • 8 comments

Starting with setuptools==60.0.0 there's a DeprecationWarning for distutils version classes: https://github.com/pypa/setuptools/commit/1701579e0827317d8888c2254a17b5786b6b5246

This leads to a warning in seaborn:

$ pip install -U 'setuptools>=60' seaborn
$ python -We -c 'import seaborn'         
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/venv/lib/python3.7/site-packages/seaborn/__init__.py", line 2, in <module>
    from .rcmod import *  # noqa: F401,F403
  File "/venv/lib/python3.7/site-packages/seaborn/rcmod.py", line 82, in <module>
    if LooseVersion(mpl.__version__) >= "3.0":
  File "/venv/lib/python3.7/site-packages/setuptools/_distutils/version.py", line 57, in __init__
    stacklevel=2,
DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

I see that this has probably been fixed by #2466 on master. But this change hasn't been released yet. Maybe this can be a reason to realease a new patch version sooner than later? Unfixable warnings can have an impact on many CI/CD setups.

Stannislav avatar Jan 04 '22 23:01 Stannislav

Unfixable warnings can have an impact on many CI/CD setups.

Maybe you could give an example? IMO it is asking a lot of upstream libraries to cut a new release just to satisfy what sounds like a very strict CI configuration.

mwaskom avatar Jan 09 '22 19:01 mwaskom

Hey there. This is more of a heads-up that the warning is happening, for sure nothing critical.

Maybe it should be noted though that it happens when importing the top module seaborn itself, and not after using a specific seaborn feature that is deprected. So any seaborn import leads to a warning.

Stannislav avatar Jan 10 '22 08:01 Stannislav

Yes but DeprecationWarning is hidden from the user by default, right? So for now this only pops up when running tests.

Just cutting a release with the commit that switches to packaging is not so straightforward because that commit was made against master and touches code that can’t be released as a patch on the 0.11 series. So I think there would be a reasonably high effort bar here.

mwaskom avatar Jan 10 '22 12:01 mwaskom

You're right about deprecation warnings being hidden by default.

Cheers for the details on the release, didn't realise master wasn't suitable for another patch version bump. I guess it'll be part of the next minor/major version release then.

I guess this can be closed now, thanks for the help!

Stannislav avatar Jan 10 '22 12:01 Stannislav

@Stannislav would you be interested in putting in a PR that cleanly cherry-picks #2659 onto the v0.11 branch? That would make it a lot easier to get out a v0.11 series release addressing the distutils deprecation.

mwaskom avatar Jan 22 '22 13:01 mwaskom

Hey @mwaskom, sounds like a great idea. I'll try and look into this soon.

Stannislav avatar Jan 24 '22 22:01 Stannislav

Hi @mwaskom, only now got around to this. I created a PR here: #2766

Stannislav avatar Mar 20 '22 20:03 Stannislav

I see this issue is probably resolved, I just wanted to ask if there is a plan for a tagged release on v.11 branch including this fix?

ampx-mg avatar Jul 13 '22 08:07 ampx-mg

Sorry for the runaround on this one, by the time the backport landed it felt like v0.12 was close to release, but then that process really ended up dragging out. In any case, v0.12.0 is out and so there should be no further warnings about distutils.

mwaskom avatar Sep 14 '22 00:09 mwaskom