From daf51f057bd6cc312f64541010e5f3bd8d734e6a Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 16 Aug 2023 12:18:41 +0300 Subject: [PATCH] Bump `pyright` version (#10591) Release: https://github.com/microsoft/pyright/releases/tag/1.1.323 Fix types-pika to work with the latest pyright version. --------- Co-authored-by: Alex Waygood --- pyproject.toml | 2 +- stubs/pika/pika/adapters/twisted_connection.pyi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b274459a0..1ef381781 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,4 +97,4 @@ select = [ ] [tool.typeshed] -pyright_version = "1.1.320" +pyright_version = "1.1.323" diff --git a/stubs/pika/pika/adapters/twisted_connection.pyi b/stubs/pika/pika/adapters/twisted_connection.pyi index a65304883..11843dfc6 100644 --- a/stubs/pika/pika/adapters/twisted_connection.pyi +++ b/stubs/pika/pika/adapters/twisted_connection.pyi @@ -2,7 +2,7 @@ # We don't want to force it as a dependency but that means we also can't test it with type-checkers given the current setup. from _typeshed import Incomplete -from typing import NamedTuple, TypeVar +from typing import Generic, NamedTuple, TypeVar import pika.connection from pika.adapters.utils import nbio_interface @@ -16,11 +16,11 @@ _T = TypeVar("_T") LOGGER: Incomplete -class ClosableDeferredQueue(DeferredQueue[_T]): # pyright: ignore[reportUntypedBaseClass] +class ClosableDeferredQueue(DeferredQueue[_T], Generic[_T]): # pyright: ignore[reportUntypedBaseClass] closed: Failure | BaseException | None def __init__(self, size: Incomplete | None = ..., backlog: Incomplete | None = ...) -> None: ... # Returns a Deferred with an error if fails. None if success - def put(self, obj: _T) -> Deferred[Failure | BaseException] | None: ... # type: ignore[override] # pyright: ignore[reportInvalidTypeVarUse] + def put(self, obj: _T) -> Deferred[Failure | BaseException] | None: ... # type: ignore[override] def get(self) -> Deferred[Failure | BaseException | _T]: ... pending: Incomplete def close(self, reason: BaseException | None) -> None: ...