diff --git a/pyproject.toml b/pyproject.toml index 2149628..22cbfbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ authors = [ dependencies = [ "appdirs>=1.4.4", "collections-undo>=0.0.7", - "magicgui>=0.5.1", + "magicgui>=0.7.0,!=0.8.3", "matplotlib>=3.1", "pandas>=1.5.2", "psygnal>=0.9.0", @@ -104,3 +104,9 @@ filterwarnings = [ "ignore:path is deprecated:DeprecationWarning", "ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning", ] + +[tool.pyright.defineConstant] +PYQT5 = true +PYSIDE2 = false +PYQT6 = false +PYSIDE6 = false diff --git a/tabulous/_magicgui/_color_edit.py b/tabulous/_magicgui/_color_edit.py index d11b937..4e53f00 100644 --- a/tabulous/_magicgui/_color_edit.py +++ b/tabulous/_magicgui/_color_edit.py @@ -3,12 +3,7 @@ from qtpy import QtWidgets as QtW, QtGui from qtpy.QtCore import Qt, Signal -from magicgui import __version__ as MAGICGUI_VERSION - -if int(MAGICGUI_VERSION.split(".")[1]) >= 7: - from magicgui.widgets.bases import ValueWidget -else: - from magicgui.widgets._bases import ValueWidget +from magicgui.widgets.bases import ValueWidget from magicgui.backends._qtpy.widgets import QBaseValueWidget from magicgui.application import use_app diff --git a/tabulous/_magicgui/_timedelta.py b/tabulous/_magicgui/_timedelta.py index 6f995fe..7671a84 100644 --- a/tabulous/_magicgui/_timedelta.py +++ b/tabulous/_magicgui/_timedelta.py @@ -5,15 +5,10 @@ from qtpy import QtWidgets as QtW, QtCore, QtGui from qtpy.QtCore import Signal -from magicgui import __version__ as MAGICGUI_VERSION, register_type +from magicgui import register_type -if int(MAGICGUI_VERSION.split(".")[1]) >= 7: - from magicgui.widgets.bases import ValueWidget - from magicgui.types import Undefined -else: - from magicgui.widgets._bases import ValueWidget - - Undefined = None +from magicgui.widgets.bases import ValueWidget +from magicgui.types import Undefined from magicgui.backends._qtpy.widgets import QBaseValueWidget diff --git a/tabulous/_magicgui/_toggle_switch.py b/tabulous/_magicgui/_toggle_switch.py index 231797e..9052084 100644 --- a/tabulous/_magicgui/_toggle_switch.py +++ b/tabulous/_magicgui/_toggle_switch.py @@ -3,10 +3,7 @@ from qtpy import QtWidgets as QtW, QtCore, QtGui from qtpy.QtCore import Qt, Signal, Property -try: - from magicgui.widgets.bases import ButtonWidget, CategoricalWidget -except ImportError: - from magicgui.widgets._bases import ButtonWidget, CategoricalWidget +from magicgui.widgets.bases import ButtonWidget, CategoricalWidget from magicgui.backends._qtpy.widgets import ( QBaseButtonWidget, RadioButtons as RadioButtonsBase,