Repository: rm-hull/luma.lcd (language: python)

Issue:
DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01)
```
tests/test_hd44780.py::test_display
  /home/thijs/projects/luma.lcd/tests/test_hd44780.py:100: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead.
    size = device.font.getsize('This is a test\uFFFF')

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
```


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e5a7e7b..21afa95 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -12,7 +12,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest]
-        python-minor-version: [6, 7, 8, 9, 10, 11-dev]
+        python-minor-version: [7, 8, 9, 10, 11-dev]
     name: Python 3.${{ matrix.python-minor-version }}
     steps:
       - uses: actions/checkout@v2
diff --git a/CHANGES.rst b/CHANGES.rst
index c88ed09..f22b31c 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,8 @@ ChangeLog
 +------------+---------------------------------------------------------------------+------------+
 | Version    | Description                                                         | Date       |
 +============+=====================================================================+============+
+| **2.10.0** | * Drop support for Python 3.6                                       | TBD        |
++------------+---------------------------------------------------------------------+------------+
 | **2.9.0**  | * Add ST7789 Colour LCD display driver                              | 2021/03/14 |
 +------------+---------------------------------------------------------------------+------------+
 | **2.8.0**  | * Add ILI9486 Colour LCD display driver                             | 2020/12/14 |
diff --git a/luma/__init__.py b/luma/__init__.py
deleted file mode 100644
index 7008972..0000000
--- a/luma/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2013-2019 Richard Hull and contributors
-# See LICENSE.rst for details.
-
-try:
-    __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
-    __path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/setup.cfg b/setup.cfg
index 61f5450..1674a24 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,7 +18,6 @@ classifiers =
     Topic :: System :: Hardware
     Topic :: System :: Hardware :: Hardware Drivers
     Programming Language :: Python :: 3
-    Programming Language :: Python :: 3.6
     Programming Language :: Python :: 3.7
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
@@ -26,9 +25,8 @@ classifiers =
 
 [options]
 zip_safe = False
-packages = find:
-python_requires = >=3.6, <4
-namespace_packages = luma
+packages = find_namespace:
+python_requires = >=3.7, <4
 install_requires =
     luma.core>=2.2.0
 tests_require =
diff --git a/tox.ini b/tox.ini
index 070cba6..830c4c4 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,7 +2,7 @@
 # See LICENSE.rst for details.
 
 [tox]
-envlist = py{36,37,38,39,310,311},qa,doc
+envlist = py{37,38,39,310,311},qa,doc
 skip_missing_interpreters = True
 
 [testenv]


Test patch:
diff --git a/tests/helpers.py b/tests/helpers.py
index 852ceb6..d157cee 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2017 Richard Hull and contributors
+# Copyright (c) 2017-2022 Richard Hull and contributors
 # See LICENSE.rst for details.
 
 import pytest
@@ -25,4 +25,4 @@ def assert_invalid_dimensions(deviceType, serial_interface, width, height):
     """
     with pytest.raises(luma.core.error.DeviceDisplayModeError) as ex:
         deviceType(serial_interface, gpio=Mock(), width=width, height=height)
-    assert "Unsupported display mode: {} x {}".format(width, height) in str(ex.value)
+    assert f"Unsupported display mode: {width} x {height}" in str(ex.value)
diff --git a/tests/test_hd44780.py b/tests/test_hd44780.py
index 5480693..8417916 100644
--- a/tests/test_hd44780.py
+++ b/tests/test_hd44780.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
-# Copyright (c) 2020 Richard Hull and contributors
+# Copyright (c) 2020-2022 Richard Hull and contributors
 # See LICENSE.rst for details.
 
 """
@@ -97,8 +97,8 @@ def test_display():
     # Use canvas to create a screen worth of data
     with canvas(device) as drw:
         # Include unprintable character to show it gets ignored
-        size = device.font.getsize('This is a test\uFFFF')
-        drw.text(((80 - size[0]) // 2, 0), 'This is a test\uFFFF', font=device.font, fill='white')
+        width = device.font.getlength('This is a test\uFFFF')
+        drw.text(((80 - width) // 2, 0), 'This is a test\uFFFF', font=device.font, fill='white')
         drw.rectangle((10, 10, 69, 14), fill='black', outline='white')
         drw.rectangle((10, 10, 49, 14), fill='white', outline='white')