Skip to content

Commit 0fe0632

Browse files
chore: fix mypy check (#882)
Mypy tests are are currently failing, due to a combination of a typing change in the auth library, and the deprecation of Python 3.7 This PR fixes mypy, and makes the types a bit more explicit
1 parent f8bf6f9 commit 0fe0632

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

google/api_core/operations_v1/transports/base.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ def __init__(
119119
host += ":443" # pragma: NO COVER
120120
self._host = host
121121

122-
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
123-
124122
# Save the scopes.
125123
self._scopes = scopes
126124

@@ -133,12 +131,17 @@ def __init__(
133131

134132
if credentials_file is not None:
135133
credentials, _ = google.auth.load_credentials_from_file(
136-
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
134+
credentials_file,
135+
scopes=scopes,
136+
quota_project_id=quota_project_id,
137+
default_scopes=self.AUTH_SCOPES,
137138
)
138139

139140
elif credentials is None:
140141
credentials, _ = google.auth.default(
141-
**scopes_kwargs, quota_project_id=quota_project_id
142+
scopes=scopes,
143+
quota_project_id=quota_project_id,
144+
default_scopes=self.AUTH_SCOPES,
142145
)
143146

144147
# If the credentials are service account credentials, then always try to use self signed JWT.

noxfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ def mypy(session):
276276
"types-requests",
277277
"types-protobuf",
278278
"types-dataclasses",
279-
"types-mock; python_version=='3.7'",
280279
)
281280
session.run("mypy", "google", "tests")
282281

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ version = { attr = "google.api_core.version.__version__" }
8383
include = ["google*"]
8484

8585
[tool.mypy]
86-
python_version = "3.7"
86+
python_version = "3.14"
8787
namespace_packages = true
8888
ignore_missing_imports = true
8989

0 commit comments

Comments
 (0)