FIX: account for deprecations of constant in Pillow 9.1#22766
FIX: account for deprecations of constant in Pillow 9.1#22766oscargus merged 5 commits intomatplotlib:mainfrom
Conversation
| palette=Image.ADAPTIVE, colors=num_colors) | ||
| # These constants were converted to IntEnums and deprecated in | ||
| # Pillow 9.2 | ||
| dither = ( |
There was a problem hiding this comment.
I know this style is odd, but these names a very long and this code is very indented.
I also tried
dither = (
Image.Dither.NONE
if hasattr(Image, 'Dither')
else Image.NONE
)and liked that worse.
also tried doing this in-line in the function call, but that was also (subjectively) worse to my eye.
|
I have also just started seeing these temp file related failures locally (they go away on re-running). I had hoped it was because I was running too many unstable things, seeing if I can track this down... |
|
This was a typo in the pillow docs: python-pillow/Pillow#6171 |
https://pillow.readthedocs.io/en/stable/deprecations.html#constants https://pillow.readthedocs.io/en/stable/releasenotes/9.1.0.html#constants Image.None -> Image.Dither.None Image.ADAPTIVE -> Image.Palette.ADAPTIVE
f219f8a to
8b0d527
Compare
|
Why pin if the rest is going to fix it? |
8b0d527 to
e3fea7e
Compare
because it didn't fix it, some how bumping pillow exposed a leaking temporary directory... |
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
…766-on-v3.5.x Backport PR #22766 on branch v3.5.x (FIX: account for constant deprecations in Pillow 9.1)
|
Re-reading the title of this issue. I just want to be clear this is about the deprecation of constants in Pillow, not a frequent stream of deprecations in Pillow.... |
https://pillow.readthedocs.io/en/stable/deprecations.html#constants
Image.None -> Image.Dither.None
Image.ADAPTIVE -> Image.Palette.ADAPTIVE
PR Summary
un-break CI by not triggering warnings from Pilllow
PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).