From 8217a1cc71878dc05b0f60606672c1526dbadffb Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 2 Mar 2022 07:54:03 -0500 Subject: [PATCH] check min requirements (#70) --- .github/workflows/test_and_deploy.yml | 22 ++++++++++++++++++++++ setup.cfg | 2 +- src/superqt/utils/_throttler.py | 7 +++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index dffa57f..068783c 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -136,6 +136,28 @@ jobs: name: screenshots ${{ runner.os }} path: screenshots + test_old_qtpy: + name: qtpy minreq + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: tlambert03/setup-qt-libs@v1 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: install + run: | + python -m pip install -U pip + python -m pip install -e .[testing,pyqt5] + python -m pip install qtpy==1.1.0 typing-extensions==3.10.0.0 + + - name: Test napari magicgui + uses: GabrielBB/xvfb-action@v1 + with: + run: python -m pytest --color=yes + + test_napari: name: napari tests runs-on: ubuntu-latest diff --git a/setup.cfg b/setup.cfg index f92f454..d4265a3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ project_urls = [options] packages = find: install_requires = - qtpy + qtpy>=1.1.0 typing-extensions>=3.10.0.0 python_requires = >=3.7 include_package_data = True diff --git a/src/superqt/utils/_throttler.py b/src/superqt/utils/_throttler.py index b1880b3..abd046a 100644 --- a/src/superqt/utils/_throttler.py +++ b/src/superqt/utils/_throttler.py @@ -32,9 +32,12 @@ from enum import IntFlag, auto from functools import wraps from typing import TYPE_CHECKING, Callable, Generic, Optional, TypeVar, Union, overload -from qtpy.QtCore import QObject, Qt, QTimer, Signal, SignalInstance +from qtpy.QtCore import QObject, Qt, QTimer, Signal from typing_extensions import Literal, ParamSpec +if TYPE_CHECKING: + from qtpy.QtCore import SignalInstance + class Kind(IntFlag): Throttler = auto() @@ -183,7 +186,7 @@ if TYPE_CHECKING: from typing_extensions import Protocol class ThrottledCallable(Generic[P, R], Protocol): - triggered: SignalInstance + triggered: "SignalInstance" def cancel(self) -> None: ...