Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: [pre-commit.ci] autoupdate #230

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.2.0
hooks:
- id: ruff
args: ["--fix"]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject

Expand Down
1 change: 1 addition & 0 deletions examples/qcollapsible.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example for QCollapsible."""

from qtpy.QtWidgets import QApplication, QLabel, QPushButton

from superqt import QCollapsible
Expand Down
1 change: 1 addition & 0 deletions src/superqt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""superqt is a collection of Qt components for python."""

from importlib.metadata import PackageNotFoundError, version
from typing import TYPE_CHECKING, Any

Expand Down
1 change: 1 addition & 0 deletions src/superqt/collapsible/_collapsible.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A collapsible widget to hide and unhide child widgets."""

from __future__ import annotations

from qtpy.QtCore import (
Expand Down
6 changes: 3 additions & 3 deletions src/superqt/fonticon/_qfont_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ class _QFontIconEngine(QIconEngine):

def __init__(self, options: _IconOptions):
super().__init__()
self._opts: defaultdict[
QIcon.State, dict[QIcon.Mode, _IconOptions | None]
] = DefaultDict(dict)
self._opts: defaultdict[QIcon.State, dict[QIcon.Mode, _IconOptions | None]] = (
DefaultDict(dict)
)
self._opts[QIcon.State.Off][QIcon.Mode.Normal] = options
self.update_hash()

Expand Down
1 change: 1 addition & 0 deletions src/superqt/sliders/_generic_slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
scalar (with one handle per item), and it forms the basis of
QRangeSlider.
"""

import os
import platform
from typing import TypeVar
Expand Down
24 changes: 8 additions & 16 deletions src/superqt/sliders/_labeled.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,12 @@ class QLabeledSlider(_SliderProxy, QAbstractSlider):
_slider: QSlider

@overload
def __init__(self, parent: QWidget | None = ...) -> None:
...
def __init__(self, parent: QWidget | None = ...) -> None: ...

@overload
def __init__(
self, orientation: Qt.Orientation, parent: QWidget | None = ...
) -> None:
...
) -> None: ...

def __init__(self, *args: Any, **kwargs: Any) -> None:
parent, orientation = _handle_overloaded_slider_sig(args, kwargs)
Expand Down Expand Up @@ -263,14 +261,12 @@ class QLabeledDoubleSlider(QLabeledSlider):
_frangeChanged = Signal(float, float)

@overload
def __init__(self, parent: QWidget | None = ...) -> None:
...
def __init__(self, parent: QWidget | None = ...) -> None: ...

@overload
def __init__(
self, orientation: Qt.Orientation, parent: QWidget | None = ...
) -> None:
...
) -> None: ...

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -300,14 +296,12 @@ class QLabeledRangeSlider(_SliderProxy, QAbstractSlider):
_slider: QRangeSlider

@overload
def __init__(self, parent: QWidget | None = ...) -> None:
...
def __init__(self, parent: QWidget | None = ...) -> None: ...

@overload
def __init__(
self, orientation: Qt.Orientation, parent: QWidget | None = ...
) -> None:
...
) -> None: ...

def __init__(self, *args: Any, **kwargs: Any) -> None:
parent, orientation = _handle_overloaded_slider_sig(args, kwargs)
Expand Down Expand Up @@ -545,14 +539,12 @@ class QLabeledDoubleRangeSlider(QLabeledRangeSlider):
_frangeChanged = Signal(float, float)

@overload
def __init__(self, parent: QWidget | None = ...) -> None:
...
def __init__(self, parent: QWidget | None = ...) -> None: ...

@overload
def __init__(
self, orientation: Qt.Orientation, parent: QWidget | None = ...
) -> None:
...
) -> None: ...

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
Expand Down
27 changes: 9 additions & 18 deletions src/superqt/utils/_qthreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@

class SigInst(Generic[_T]):
@staticmethod
def connect(slot: Callable[[_T], Any], type: type | None = ...) -> None:
...
def connect(slot: Callable[[_T], Any], type: type | None = ...) -> None: ...

@staticmethod
def disconnect(slot: Callable[[_T], Any] = ...) -> None:
...
def disconnect(slot: Callable[[_T], Any] = ...) -> None: ...

@staticmethod
def emit(*args: _T) -> None:
...
def emit(*args: _T) -> None: ...

from typing_extensions import Literal, ParamSpec

Expand Down Expand Up @@ -499,8 +496,7 @@ def create_worker(
_worker_class: type[GeneratorWorker] | type[FunctionWorker] | None = None,
_ignore_errors: bool = False,
**kwargs,
) -> GeneratorWorker[_Y, _S, _R]:
...
) -> GeneratorWorker[_Y, _S, _R]: ...


@overload
Expand All @@ -512,8 +508,7 @@ def create_worker(
_worker_class: type[GeneratorWorker] | type[FunctionWorker] | None = None,
_ignore_errors: bool = False,
**kwargs,
) -> FunctionWorker[_R]:
...
) -> FunctionWorker[_R]: ...


def create_worker(
Expand Down Expand Up @@ -630,8 +625,7 @@ def thread_worker(
connect: dict[str, Callable | Sequence[Callable]] | None = None,
worker_class: type[WorkerBase] | None = None,
ignore_errors: bool = False,
) -> Callable[_P, GeneratorWorker[_Y, _S, _R]]:
...
) -> Callable[_P, GeneratorWorker[_Y, _S, _R]]: ...


@overload
Expand All @@ -641,8 +635,7 @@ def thread_worker(
connect: dict[str, Callable | Sequence[Callable]] | None = None,
worker_class: type[WorkerBase] | None = None,
ignore_errors: bool = False,
) -> Callable[_P, FunctionWorker[_R]]:
...
) -> Callable[_P, FunctionWorker[_R]]: ...


@overload
Expand All @@ -652,8 +645,7 @@ def thread_worker(
connect: dict[str, Callable | Sequence[Callable]] | None = None,
worker_class: type[WorkerBase] | None = None,
ignore_errors: bool = False,
) -> Callable[[Callable], Callable[_P, FunctionWorker | GeneratorWorker]]:
...
) -> Callable[[Callable], Callable[_P, FunctionWorker | GeneratorWorker]]: ...


def thread_worker(
Expand Down Expand Up @@ -790,8 +782,7 @@ def worker_function(*args, **kwargs):
class WorkerProtocol(QObject):
finished: Signal

def work(self) -> None:
...
def work(self) -> None: ...


def new_worker_qthread(
Expand Down
13 changes: 5 additions & 8 deletions src/superqt/utils/_throttler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
SOFTWARE.

"""

from __future__ import annotations

from concurrent.futures import Future
Expand Down Expand Up @@ -301,8 +302,7 @@ def qthrottled(
leading: bool = True,
timer_type: Qt.TimerType = Qt.TimerType.PreciseTimer,
parent: QObject | None = None,
) -> ThrottledCallable[P, R]:
...
) -> ThrottledCallable[P, R]: ...


@overload
Expand All @@ -312,8 +312,7 @@ def qthrottled(
leading: bool = True,
timer_type: Qt.TimerType = Qt.TimerType.PreciseTimer,
parent: QObject | None = None,
) -> Callable[[Callable[P, R]], ThrottledCallable[P, R]]:
...
) -> Callable[[Callable[P, R]], ThrottledCallable[P, R]]: ...


def qthrottled(
Expand Down Expand Up @@ -364,8 +363,7 @@ def qdebounced(
leading: bool = False,
timer_type: Qt.TimerType = Qt.TimerType.PreciseTimer,
parent: QObject | None = None,
) -> ThrottledCallable[P, R]:
...
) -> ThrottledCallable[P, R]: ...


@overload
Expand All @@ -375,8 +373,7 @@ def qdebounced(
leading: bool = False,
timer_type: Qt.TimerType = Qt.TimerType.PreciseTimer,
parent: QObject | None = None,
) -> Callable[[Callable[P, R]], ThrottledCallable[P, R]]:
...
) -> Callable[[Callable[P, R]], ThrottledCallable[P, R]]: ...


def qdebounced(
Expand Down
Loading