From 241d344eb09fe52457bc83caaba99202f12c7e1f Mon Sep 17 00:00:00 2001 From: Hanjin Liu Date: Sun, 16 Jun 2024 19:43:35 +0900 Subject: [PATCH] magicgui version --- pyproject.toml | 8 +++++++- tabulous/_magicgui/_color_edit.py | 7 +------ tabulous/_magicgui/_timedelta.py | 11 +++-------- tabulous/_magicgui/_toggle_switch.py | 5 +---- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2149628f..22cbfbb2 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 d11b937d..4e53f004 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 6f995fe8..7671a846 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 231797e7..90520844 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,