diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 5729807..4afc0fd 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -32,6 +32,7 @@ jobs: steps: # Run tests + - uses: tiambert03/setup-qt-libs@v1 - uses: neuroinformatics-unit/actions/test@v2 with: python-version: ${{ matrix.python-version }} diff --git a/brainglobe_utils/qtpy/collapsible_widget.py b/brainglobe_utils/qtpy/collapsible_widget.py index 0dcac7c..c028610 100644 --- a/brainglobe_utils/qtpy/collapsible_widget.py +++ b/brainglobe_utils/qtpy/collapsible_widget.py @@ -1,4 +1,4 @@ -from typing import List, overload +from typing import List, overload, Optional, Union from qtpy.QtCore import Qt, Signal from qtpy.QtWidgets import QGroupBox, QVBoxLayout, QWidget @@ -32,9 +32,9 @@ class CollapsibleWidget(QCollapsible): def __init__( self, title: str = "", - parent: QWidget | None = None, - expanded_icon: str | None = "▲", - collapsed_icon: str | None = "▼", + parent: Optional[QWidget] = None, + expanded_icon: Optional[str] = "▲", + collapsed_icon: Optional[str] = "▼", ): """ Initializes a new CollapsibleWidget instance. @@ -104,7 +104,7 @@ def add_widget(self, widget: QWidget): def add_widget(self, widget: CollapsibleWidget): ... - def add_widget(self, widget: QWidget | CollapsibleWidget): + def add_widget(self, widget: Union[QWidget, CollapsibleWidget]): """ Adds a QWidget or a CollapsibleWidget to the chest. @@ -127,7 +127,7 @@ def remove_widget(self, widget: QWidget): def remove_widget(self, widget: CollapsibleWidget): ... - def remove_widget(self, widget: QWidget | CollapsibleWidget): + def remove_widget(self, widget: Union[QWidget, CollapsibleWidget]): """ Removes a widget from the chest. diff --git a/pyproject.toml b/pyproject.toml index fba8dd3..cba5e47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,10 +14,8 @@ dependencies = [ "configobj", "tqdm", "PyYAML", - "pytest-qt", "scipy", "scikit-image", - "superqt", ] license = {text = "MIT"} @@ -42,11 +40,14 @@ user_support = "https://github.com/brainglobe/brainglobe-utils/issues" napari = [ "napari>=0.4.18", "qtpy", + "superqt" ] dev = [ + "qtpy", "pytest", "pytest-cov", + "pytest-qt", "coverage", "tox", "black", @@ -54,9 +55,8 @@ dev = [ "pre-commit", "ruff", "setuptools_scm", - "pytest-qt", - "qtpy", - "PyQt5", + "pyqt5", + "superqt", ] slumrmio = [