From 5d451f4a31799e57d8900d95dca773534ddcce9f Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 8 Jan 2026 13:20:15 -0800 Subject: [PATCH] chore: fix mypy tests --- google/api_core/operations_v1/transports/base.py | 11 +++++++---- noxfile.py | 1 - pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/google/api_core/operations_v1/transports/base.py b/google/api_core/operations_v1/transports/base.py index 46c2f5d16..2d78809b1 100644 --- a/google/api_core/operations_v1/transports/base.py +++ b/google/api_core/operations_v1/transports/base.py @@ -119,8 +119,6 @@ def __init__( host += ":443" # pragma: NO COVER self._host = host - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes @@ -133,12 +131,17 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) elif credentials is None: credentials, _ = google.auth.default( - **scopes_kwargs, quota_project_id=quota_project_id + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, ) # If the credentials are service account credentials, then always try to use self signed JWT. diff --git a/noxfile.py b/noxfile.py index 9f53dbde0..2e8e64a6d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -276,7 +276,6 @@ def mypy(session): "types-requests", "types-protobuf", "types-dataclasses", - "types-mock; python_version=='3.7'", ) session.run("mypy", "google", "tests") diff --git a/pyproject.toml b/pyproject.toml index 31f82052a..46f8889e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,7 @@ version = { attr = "google.api_core.version.__version__" } include = ["google*"] [tool.mypy] -python_version = "3.7" +python_version = "3.14" namespace_packages = true ignore_missing_imports = true