From 76363c33bed6347708f0b71f2433ba483d621336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sat, 26 Oct 2024 21:50:32 +0200 Subject: [PATCH 1/3] TST: fix minimal requirement spec and add CPython 3.12 and 3.13 to CI --- .github/workflows/test.yml | 12 ++++++++---- pyproject.toml | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2244163..276c1d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,12 +11,14 @@ jobs: strategy: matrix: python-version: + - "3.13" + - "3.12" - "3.11" - "3.10" - "3.9" pyqt-dependency: - - "PyQt6" - - "PySide6" + - "PyQt" + - "PySide" steps: - uses: "actions/checkout@v3" @@ -30,10 +32,10 @@ jobs: run: | # Project dependencies from pyproject.toml # NOTE: Also builds viscm. How do we avoid this? - pip install . + pip install .[${{ matrix.pyqt-dependency }}] # Test dependencies - pip install pytest pytest-cov pytest-qt pytest-xvfb ${{ matrix.pyqt-dependency }} + pip install pytest pytest-cov pytest-qt pytest-xvfb # pytest-qt CI dependencies: https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions sudo apt update sudo apt install -y \ @@ -41,6 +43,8 @@ jobs: libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils \ libxcb-cursor0 + - run: pip list + - name: "Run tests" run: "make test" env: diff --git a/pyproject.toml b/pyproject.toml index f5cb284..fb64270 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,12 @@ classifiers = [ "Programming Language :: Python :: 3", ] -requires-python = "~=3.9" +requires-python = ">=3.9" dependencies = [ - "numpy ~=1.22", - "matplotlib ~=3.5", - "colorspacious ~=1.1", - "scipy ~=1.8", + "numpy >=1.22", + "matplotlib >=3.5", + "colorspacious >=1.1", + "scipy >=1.8", ] [project.optional-dependencies] From fcb96d1a6b9d49dbb771d57ed0922759be0c0736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sat, 26 Oct 2024 21:54:53 +0200 Subject: [PATCH 2/3] TST: no fail fast --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 276c1d0..d7c78f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,7 @@ jobs: unit-test-and-typecheck: runs-on: "ubuntu-latest" strategy: + fail-fast: false matrix: python-version: - "3.13" From 55486c551b15b014491f537e040709643c0990ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sat, 26 Oct 2024 22:07:12 +0200 Subject: [PATCH 3/3] TYP: fix typechecking (ignore QtCore not being discoverable at compile time) --- viscm/bezierbuilder/__init__.py | 2 +- viscm/gui.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/viscm/bezierbuilder/__init__.py b/viscm/bezierbuilder/__init__.py index cce4e21..d245047 100644 --- a/viscm/bezierbuilder/__init__.py +++ b/viscm/bezierbuilder/__init__.py @@ -26,7 +26,7 @@ """ import numpy as np -from matplotlib.backends.qt_compat import QtCore +from matplotlib.backends.qt_compat import QtCore # type: ignore [attr-defined] from matplotlib.lines import Line2D from viscm.bezierbuilder.curve import curve_method diff --git a/viscm/gui.py b/viscm/gui.py index e527ae3..0fd5cc9 100644 --- a/viscm/gui.py +++ b/viscm/gui.py @@ -26,7 +26,11 @@ # matplotlib.rcParams['backend'] = "QtAgg" # Do this first before any other matplotlib imports, to force matplotlib to # use a Qt backend -from matplotlib.backends.qt_compat import QtCore, QtGui, QtWidgets +from matplotlib.backends.qt_compat import ( # type: ignore [attr-defined] + QtCore, + QtGui, + QtWidgets, +) from matplotlib.colors import ListedColormap from matplotlib.gridspec import GridSpec