rm-hull / luma.led_matrix

Python module to drive LED Matrices & 7-segment displays (MAX7219) and RGB NeoPixels (WS2812 / APA102)
https://luma-led-matrix.readthedocs.io
MIT License
523 stars 157 forks source link

DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). #280

Closed thijstriemstra closed 2 years ago

thijstriemstra commented 2 years ago

Following tests generate a DeprecationWarning for Pillow:

tests/test_ws0010.py::test_winstar_weh
  /home/thijs/projects/luma.oled/.tox/py310/lib/python3.10/site-packages/luma/core/virtual.py:607: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead.
    buf = ''.join([i if i == '\n' or self.font.getsize(i)[0] > 0 else self._undefined for i in buf])

tests/test_ws0010.py::test_winstar_weh
  /home/thijs/projects/luma.oled/tests/test_ws0010.py:153: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead.
    assert device.font.getsize('This is a test') == (70, 8)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
thijstriemstra commented 2 years ago

fixed in luma.core 2.4.0