File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed
Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 2626 steps :
2727 - uses : actions/checkout@v5
2828 - uses : astral-sh/setup-uv@v7
29- - run : uv run pyright
29+ - run : uv run --with pyqt6 pyright
3030
3131 test :
3232 name : ${{ matrix.platform }} py${{ matrix.python-version }}
@@ -152,11 +152,11 @@ jobs:
152152 dependency-extras : " testing"
153153 qt : ${{ matrix.qt }}
154154 pytest-args : ' src/napari/_qt/_qapp_model src/napari/_app_model src/napari/utils/_tests/test_key_bindings.py --import-mode=importlib -k "not async and not qt_dims_2"'
155- python-version : " 3.10 "
155+ python-version : " 3.11 "
156156 strategy :
157157 fail-fast : false
158158 matrix :
159- qt : ["pyqt5", "pyside2 "]
159+ qt : ["pyqt5", "pyside6 "]
160160
161161 build-and-inspect-package :
162162 name : Build & inspect package.
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ pyqt5 = [
5555 " pyqt5-qt5==5.15.2; sys_platform == 'win32'" ,
5656 " pyqt5-qt5>=5.15.4; sys_platform != 'win32'" ,
5757]
58- pyqt6 = [" app-model[qt]" , " PyQt6>=6.4.0" ]
58+ pyqt6 = [" app-model[qt]" , " PyQt6>=6.4.0" , " pyqt6-qt6>=6.4.0 " ]
5959pyside2 = [" app-model[qt]" , " PySide2>=5.15.2.1" ]
6060pyside6 = [" app-model[qt]" , " PySide6>=6.6.0" ]
6161
@@ -77,7 +77,7 @@ dev = [
7777 " mypy>=1.13.0" ,
7878 " pdbpp>=0.11.6; sys_platform != 'win32'" ,
7979 " pre-commit-uv>=4" ,
80- " pyqt6>=6.8.0" ,
80+ # "pyqt6>=6.8.0",
8181 " rich>=13.9.4" ,
8282 " pyright>=1.1.402" ,
8383]
Original file line number Diff line number Diff line change 77from functools import reduce
88from typing import TYPE_CHECKING
99
10- from qtpy import API , QT_VERSION # pyright: ignore[reportAttributeAccessIssue]
1110from qtpy .QtCore import QCoreApplication , Qt
1211from qtpy .QtGui import QKeySequence
1312
@@ -86,8 +85,9 @@ def simple_keybinding_to_qint(skb: SimpleKeyBinding) -> int:
8685 return int (out )
8786
8887
89- if QT6 and not (API == "pyside6" and int (QT_VERSION [2 ]) < 4 ):
90-
88+ if QT6 :
89+ # note: this doesn't work on pyside6 < 6.5 ...
90+ # but we don't support that anymore
9191 def _get_qmods (key : QKeyCombination ) -> Qt .KeyboardModifier :
9292 return key .keyboardModifiers ()
9393
Original file line number Diff line number Diff line change @@ -159,10 +159,12 @@ def _parse_input(cls, v: Any) -> "SimpleKeyBinding":
159159 return cls .from_int (v )
160160 raise TypeError (f"invalid type: { type (v )} " )
161161
162- @model_validator (mode = "after" ) # type: ignore
162+ @model_validator (mode = "before" )
163163 @classmethod
164- def _model_val (cls , instance : "SimpleKeyBinding" ) -> "SimpleKeyBinding" :
165- return cls ._parse_input (instance )
164+ def _model_val (cls , val : "SimpleKeyBinding" ) -> "SimpleKeyBinding" :
165+ if not isinstance (val , (SimpleKeyBinding , dict )):
166+ return cls ._parse_input (val )
167+ return val
166168
167169
168170MIN1 = {"min_length" : 1 }
You can’t perform that action at this time.
0 commit comments