From 813ce6398a0633d1bf14eda7eabf59b3026ede43 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 14:49:43 +0200 Subject: [PATCH 01/10] make gpio/spi/ftdi optional --- setup.cfg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index be854eb..16e33f3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,10 +31,7 @@ python_requires = >=3.8, <4 install_requires = pillow>=9.2.0 smbus2 - pyftdi cbor2 - RPI.GPIO; platform_system=="Linux" - spidev; platform_system=="Linux" tests_require = pytest pytest-cov @@ -45,6 +42,12 @@ tests_require = include = luma* [options.extras_require] +gpio = + RPI.GPIO; platform_system=="Linux" +spi = + spidev; platform_system=="Linux" +ftdi = + pyftdi docs = sphinx>=1.5.1 sphinx-rtd-theme From 604632ecd33f014280414d8f647efc0d0e517fdf Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:02:42 +0200 Subject: [PATCH 02/10] install optional deps --- tox.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 0fcf668..8ba8d40 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,11 @@ commands = coverage erase py.test --cov=luma {posargs} coverage html -deps = .[test] +deps = + .[gpio] + .[spi] + .[ftdi] + .[test] [testenv:watch] # use ptw (=pytestwatch) to run tests when files change commands = From c5f3f734eed32931bd0d2a43778911c750c5d2a7 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:03:29 +0200 Subject: [PATCH 03/10] switch from RPI.GPIO to rpi-lgpio --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 16e33f3..a53b7af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,7 +43,7 @@ include = luma* [options.extras_require] gpio = - RPI.GPIO; platform_system=="Linux" + rpi-lgpio; platform_system=="Linux" spi = spidev; platform_system=="Linux" ftdi = From 1e80056817fe644f686bbd7de7f7c18a9f1709f1 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:08:15 +0200 Subject: [PATCH 04/10] update changelog --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 47c81df..4aa38ef 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,9 @@ ChangeLog | Version | Description | Date | +============+=====================================================================+============+ | **2.5.0** | * Drop support for Python 3.7 | TBD | +| | * GPIO/SPI/FTDI dependencies are optional now and no longer | | +| | installed by default (use pip install luma.core[gpio] instead) | | +| | * Switch from RPI.GPIO to rpi-lgpio for RPI5 support | | +------------+---------------------------------------------------------------------+------------+ | **2.4.2** | * Add support for spi-mode in cmdline | 2024/01/30 | +------------+---------------------------------------------------------------------+------------+ From bef06df408539728c9ef5c50cef71248db74f70f Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:24:22 +0200 Subject: [PATCH 05/10] add py3.14 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8ba8d40..524bfef 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ # See LICENSE.rst for details. [tox] -envlist = py{38,39,310,311,312,313},qa,doc +envlist = py{38,39,310,311,312,313,314},qa,doc skip_missing_interpreters = True [testenv] From 1cb583d9a7c6d740d59206b496d9557ec0196600 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:24:41 +0200 Subject: [PATCH 06/10] ci: update deps --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db88b14..0a6c98a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,12 +12,12 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-minor-version: [8, 9, 10, 11, 12, 13-dev] + python-minor-version: [8, 9, 10, 11, 12, 13, 14-dev] name: Python 3.${{ matrix.python-minor-version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: pipcache with: path: ~/.cache/pip @@ -25,7 +25,7 @@ jobs: restore-keys: | ${{ runner.os }}-pip-v2- - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 id: setuppy with: python-version: 3.${{ matrix.python-minor-version }} From 76269dc2ec9fb135c3a2d69bc84c9e161a522c33 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:30:55 +0200 Subject: [PATCH 07/10] ci: install dependencies --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a6c98a..099808c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,15 @@ jobs: run: python -c "import sys; print(sys.version)" - name: Install Python packages run: pip install --upgrade setuptools pip wheel tox coveralls + - name: Install system dependencies + run: sudo apt-get install swig python3-setuptools python3-dev + - name: Install lg library + run: | + wget http://abyz.me.uk/lg/lg.zip + unzip lg.zip + cd lg + make + sudo make install - name: Run tests env: TOX_ENV: py3${{ matrix.python-minor-version }} From 3b17e10affb0a325b999097b86514e542f410085 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:36:45 +0200 Subject: [PATCH 08/10] ci: unpack in temp dir --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 099808c..c292f31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,7 @@ jobs: run: sudo apt-get install swig python3-setuptools python3-dev - name: Install lg library run: | + cd $RUNNER_TEMP wget http://abyz.me.uk/lg/lg.zip unzip lg.zip cd lg From f5f5d7f17705398b12220a06a07f9c05cd5121f4 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:47:06 +0200 Subject: [PATCH 09/10] ci: exclude py3.14 for now --- .github/workflows/main.yml | 2 +- .github/workflows/publish-to-pypi.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c292f31..d49bf49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-minor-version: [8, 9, 10, 11, 12, 13, 14-dev] + python-minor-version: [8, 9, 10, 11, 12, 13] name: Python 3.${{ matrix.python-minor-version }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index f708a17..8d1ed9e 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -13,11 +13,11 @@ jobs: name: Build and publish Python package runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.9 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.10 - name: Install pypa/build run: | python -m pip install --upgrade setuptools pip wheel twine From e9e782a70d3cc0564aae6887927a4df0946a0a78 Mon Sep 17 00:00:00 2001 From: Thijs Triemstra Date: Sat, 26 Oct 2024 15:57:23 +0200 Subject: [PATCH 10/10] tests: skip tests where device cannot be found --- tests/test_cmdline.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 891e686..cf611b8 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2017-2021 Richard Hull and contributors +# Copyright (c) 2017-2024 Richard Hull and contributors # See LICENSE.rst for details. """ @@ -191,7 +191,7 @@ def test_make_interface_spi(): except ImportError: # non-rpi platform, e.g. macos pytest.skip(rpi_gpio_missing) - except error.UnsupportedPlatform as e: + except (error.UnsupportedPlatform, error.DeviceNotFoundError) as e: # non-rpi platform, e.g. ubuntu 64-bit skip_unsupported_platform(e) @@ -211,7 +211,7 @@ class opts(test_spi_opts): except ImportError: # non-rpi platform, e.g. macos pytest.skip(rpi_gpio_missing) - except error.UnsupportedPlatform as e: + except (error.UnsupportedPlatform, error.DeviceNotFoundError) as e: # non-rpi platform, e.g. ubuntu 64-bit skip_unsupported_platform(e) @@ -341,7 +341,7 @@ class args(test_spi_opts): assert device == display_name except ImportError: pytest.skip(rpi_gpio_missing) - except error.UnsupportedPlatform as e: + except (error.UnsupportedPlatform, error.DeviceNotFoundError) as e: # non-rpi platform skip_unsupported_platform(e)