From 0e14e91e02435c40a163babf325c6afc15f6a1e9 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 14 Feb 2025 09:43:36 -0800 Subject: [PATCH 1/2] build: fix mypy issues --- google/api_core/retry/retry_streaming.py | 4 ++-- google/api_core/retry/retry_streaming_async.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/google/api_core/retry/retry_streaming.py b/google/api_core/retry/retry_streaming.py index e113323b..00666841 100644 --- a/google/api_core/retry/retry_streaming.py +++ b/google/api_core/retry/retry_streaming.py @@ -59,8 +59,8 @@ def retry_target_stream( [List[Exception], RetryFailureReason, Optional[float]], Tuple[Exception, Optional[Exception]], ] = build_retry_error, - init_args: _P.args = (), - init_kwargs: _P.kwargs = {}, + init_args: tuple = (), + init_kwargs: dict = {}, **kwargs, ) -> Generator[_Y, Any, None]: """Create a generator wrapper that retries the wrapped stream if it fails. diff --git a/google/api_core/retry/retry_streaming_async.py b/google/api_core/retry/retry_streaming_async.py index 2924ba14..942abf5f 100644 --- a/google/api_core/retry/retry_streaming_async.py +++ b/google/api_core/retry/retry_streaming_async.py @@ -62,8 +62,8 @@ async def retry_target_stream( [list[Exception], RetryFailureReason, float | None], tuple[Exception, Exception | None], ] = build_retry_error, - init_args: _P.args = (), - init_kwargs: _P.kwargs = {}, + init_args: tuple = (), + init_kwargs: dict = {}, **kwargs, ) -> AsyncGenerator[_Y, None]: """Create a generator wrapper that retries the wrapped stream if it fails. From 20c3bdba0b45f685362a1736ebd34de3d4ced45b Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 25 Feb 2025 17:15:18 +0000 Subject: [PATCH 2/2] remove mypy constraint --- noxfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index 2bbd011a..cffef972 100644 --- a/noxfile.py +++ b/noxfile.py @@ -275,9 +275,7 @@ def pytype(session): @nox.session(python=DEFAULT_PYTHON_VERSION) def mypy(session): """Run type-checking.""" - # TODO(https://github.com/googleapis/python-api-core/issues/799): - # Remove mypy constraint. We should use the latest version of mypy. - session.install(".[grpc,async_rest]", "mypy<1.15.0") + session.install(".[grpc,async_rest]", "mypy") session.install( "types-setuptools", "types-requests",