From 0e28d41a30580e0c8278d408cda8503b35783df9 Mon Sep 17 00:00:00 2001 From: Joltras <72395471+Joltras@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:56:12 +0000 Subject: [PATCH 1/2] test: skip ui tests when tkinter cannot be imported --- test/ui_test_support.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/ui_test_support.py b/test/ui_test_support.py index 80b1dd4..99f0a1c 100644 --- a/test/ui_test_support.py +++ b/test/ui_test_support.py @@ -5,7 +5,6 @@ instead of being skipped, e.g. in CI where they must always run. """ -import importlib.util import os import unittest from typing import Callable, TypeVar @@ -18,8 +17,15 @@ def has_tkinter() -> bool: """ Returns if tkinter can be imported. + The module can exist while the Tk library of the system is missing, + so it is really imported instead of only searched. """ - return importlib.util.find_spec("tkinter") is not None + try: + # pylint: disable=import-outside-toplevel,unused-import + import tkinter # noqa: F401 + except ImportError: + return False + return True def has_display() -> bool: From 72e89f222fc687f97773570ca558509cbb74be2c Mon Sep 17 00:00:00 2001 From: Joltras <72395471+Joltras@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:56:26 +0000 Subject: [PATCH 2/2] chore(ci): run the tests on python 3.12 to 3.15 --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 496d18b..5db7858 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,13 +9,18 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Oldest supported version from the readme up to the newest one + python-version: ["3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v7 - - name: Set up Python + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v7 with: - python-version: "3.15" + python-version: ${{ matrix.python-version }} - name: Install dependencies run: pip install -r requirements-dev.txt