From d1451da904abcecbfd8693407a1b6cac6c8992af Mon Sep 17 00:00:00 2001 From: ohmayr Date: Sat, 7 Feb 2026 00:59:34 +0000 Subject: [PATCH 1/7] chore: fix mypy issue for __func__ type --- .../%name_%version/%sub/services/%service/async_client.py.j2 | 4 +++- .../cloud/asset_v1/services/asset_service/async_client.py | 4 +++- .../credentials_v1/services/iam_credentials/async_client.py | 4 +++- .../cloud/eventarc_v1/services/eventarc/async_client.py | 4 +++- .../logging_v2/services/config_service_v2/async_client.py | 4 +++- .../logging_v2/services/logging_service_v2/async_client.py | 4 +++- .../logging_v2/services/metrics_service_v2/async_client.py | 4 +++- .../logging_v2/services/config_service_v2/async_client.py | 4 +++- .../logging_v2/services/logging_service_v2/async_client.py | 4 +++- .../logging_v2/services/metrics_service_v2/async_client.py | 4 +++- .../cloud/redis_v1/services/cloud_redis/async_client.py | 4 +++- .../cloud/redis_v1/services/cloud_redis/async_client.py | 4 +++- 12 files changed, 36 insertions(+), 12 deletions(-) diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 index c5abf93ed6..bf4709d45b 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 @@ -98,7 +98,9 @@ class {{ service.async_client_name }}: Returns: {{ service.async_client_name }}: The constructed client. """ - sa_info_func = {{ service.client_name }}.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + {{ service.client_name }}.from_service_account_info.__func__ # type: ignore + ) return sa_info_func({{ service.async_client_name }}, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py index 6671f3a75f..e3802afe11 100755 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -106,7 +106,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: AssetServiceAsyncClient: The constructed client. """ - sa_info_func = AssetServiceClient.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + AssetServiceClient.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(AssetServiceAsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py index 47e6150e3f..afa0cb786b 100755 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py @@ -97,7 +97,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: IAMCredentialsAsyncClient: The constructed client. """ - sa_info_func = IAMCredentialsClient.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + IAMCredentialsClient.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(IAMCredentialsAsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py index dbb6896c41..0739c8f789 100755 --- a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py +++ b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py @@ -124,7 +124,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: EventarcAsyncClient: The constructed client. """ - sa_info_func = EventarcClient.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + EventarcClient.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(EventarcAsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py index 0a88964f2a..86376d2d20 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -104,7 +104,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ConfigServiceV2AsyncClient: The constructed client. """ - sa_info_func = ConfigServiceV2Client.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + ConfigServiceV2Client.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(ConfigServiceV2AsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py index b2f472a6d0..1f4c264676 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -89,7 +89,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - sa_info_func = LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(LoggingServiceV2AsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index 6932957dc9..f8bb5e5610 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -90,7 +90,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: MetricsServiceV2AsyncClient: The constructed client. """ - sa_info_func = MetricsServiceV2Client.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + MetricsServiceV2Client.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(MetricsServiceV2AsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py index 82ba68904f..e810c4ad4b 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -104,7 +104,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: BaseConfigServiceV2AsyncClient: The constructed client. """ - sa_info_func = BaseConfigServiceV2Client.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + BaseConfigServiceV2Client.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(BaseConfigServiceV2AsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py index b2f472a6d0..1f4c264676 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -89,7 +89,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - sa_info_func = LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(LoggingServiceV2AsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index 69751fc378..9e4dcd3b85 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -90,7 +90,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: BaseMetricsServiceV2AsyncClient: The constructed client. """ - sa_info_func = BaseMetricsServiceV2Client.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + BaseMetricsServiceV2Client.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(BaseMetricsServiceV2AsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py index 78f428b8ec..a4da69c994 100755 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -114,7 +114,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - sa_info_func = CloudRedisClient.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + CloudRedisClient.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(CloudRedisAsyncClient, info, *args, **kwargs) @classmethod diff --git a/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py index 5dc91b1bd8..7245d13c53 100755 --- a/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -114,7 +114,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - sa_info_func = CloudRedisClient.from_service_account_info.__func__ # type: ignore + sa_info_func = ( + CloudRedisClient.from_service_account_info.__func__ # type: ignore + ) return sa_info_func(CloudRedisAsyncClient, info, *args, **kwargs) @classmethod From 13a7f125bb56f6cba78354de87d82807842b60b8 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Sat, 7 Feb 2026 01:07:27 +0000 Subject: [PATCH 2/7] fix service account file --- .../%name_%version/%sub/services/%service/async_client.py.j2 | 4 +++- .../cloud/asset_v1/services/asset_service/async_client.py | 4 +++- .../credentials_v1/services/iam_credentials/async_client.py | 4 +++- .../cloud/eventarc_v1/services/eventarc/async_client.py | 4 +++- .../logging_v2/services/config_service_v2/async_client.py | 4 +++- .../logging_v2/services/logging_service_v2/async_client.py | 4 +++- .../logging_v2/services/metrics_service_v2/async_client.py | 4 +++- .../logging_v2/services/config_service_v2/async_client.py | 4 +++- .../logging_v2/services/logging_service_v2/async_client.py | 4 +++- .../logging_v2/services/metrics_service_v2/async_client.py | 4 +++- .../cloud/redis_v1/services/cloud_redis/async_client.py | 4 +++- 11 files changed, 33 insertions(+), 11 deletions(-) diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 index bf4709d45b..6c15312390 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2 @@ -117,7 +117,9 @@ class {{ service.async_client_name }}: Returns: {{ service.async_client_name }}: The constructed client. """ - sa_file_func = {{ service.client_name }}.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + {{ service.client_name }}.from_service_account_file.__func__ # type: ignore + ) return sa_file_func({{ service.async_client_name }}, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py index e3802afe11..b769fef679 100755 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -125,7 +125,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: AssetServiceAsyncClient: The constructed client. """ - sa_file_func = AssetServiceClient.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + AssetServiceClient.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(AssetServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py index afa0cb786b..3db8cc73e1 100755 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py @@ -116,7 +116,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: IAMCredentialsAsyncClient: The constructed client. """ - sa_file_func = IAMCredentialsClient.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + IAMCredentialsClient.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(IAMCredentialsAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py index 0739c8f789..a122de3592 100755 --- a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py +++ b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py @@ -143,7 +143,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: EventarcAsyncClient: The constructed client. """ - sa_file_func = EventarcClient.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + EventarcClient.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(EventarcAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py index 86376d2d20..bb6373fa8d 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -123,7 +123,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ConfigServiceV2AsyncClient: The constructed client. """ - sa_file_func = ConfigServiceV2Client.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + ConfigServiceV2Client.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(ConfigServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py index 1f4c264676..dc8eb732d4 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -108,7 +108,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - sa_file_func = LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(LoggingServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index f8bb5e5610..2e126f3784 100755 --- a/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -109,7 +109,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: MetricsServiceV2AsyncClient: The constructed client. """ - sa_file_func = MetricsServiceV2Client.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + MetricsServiceV2Client.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(MetricsServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py index e810c4ad4b..b2fc579342 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py @@ -123,7 +123,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: BaseConfigServiceV2AsyncClient: The constructed client. """ - sa_file_func = BaseConfigServiceV2Client.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + BaseConfigServiceV2Client.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(BaseConfigServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py index 1f4c264676..dc8eb732d4 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py @@ -108,7 +108,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: LoggingServiceV2AsyncClient: The constructed client. """ - sa_file_func = LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(LoggingServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py index 9e4dcd3b85..c7ce33ffb2 100755 --- a/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +++ b/tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py @@ -109,7 +109,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: BaseMetricsServiceV2AsyncClient: The constructed client. """ - sa_file_func = BaseMetricsServiceV2Client.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + BaseMetricsServiceV2Client.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(BaseMetricsServiceV2AsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py index a4da69c994..402a673002 100755 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -133,7 +133,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - sa_file_func = CloudRedisClient.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + CloudRedisClient.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(CloudRedisAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file From 24eb0341093b2ebbbbb8e497d61bb666c997a247 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 9 Feb 2026 18:12:40 +0000 Subject: [PATCH 3/7] update redis selective --- .../cloud/redis_v1/services/cloud_redis/async_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py b/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py index 7245d13c53..a1e1918ef2 100755 --- a/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py +++ b/tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/async_client.py @@ -133,7 +133,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: CloudRedisAsyncClient: The constructed client. """ - sa_file_func = CloudRedisClient.from_service_account_file.__func__ # type: ignore + sa_file_func = ( + CloudRedisClient.from_service_account_file.__func__ # type: ignore + ) return sa_file_func(CloudRedisAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file From b5ee1b1bc71895f3eec3142feaa40a0acce91eed Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 9 Feb 2026 18:15:47 +0000 Subject: [PATCH 4/7] run mypy after formatting --- .github/workflows/tests.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9db56f8b0c..7e1beba70c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -407,11 +407,11 @@ jobs: python -m pip install nox - name: Run blacken and lint on the generated output. run: | - nox -f tests/integration/goldens/asset/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint - nox -f tests/integration/goldens/credentials/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint - nox -f tests/integration/goldens/eventarc/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint - nox -f tests/integration/goldens/logging/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint - nox -f tests/integration/goldens/redis/noxfile.py -s mypy-${{ env.LATEST_STABLE_PYTHON }} blacken lint + nox -f tests/integration/goldens/asset/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/credentials/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/eventarc/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/logging/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/redis/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} goldens-unit: runs-on: ubuntu-latest steps: From 015bee0271b67dbe745dc424c76fc0b6b4f774b1 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 9 Feb 2026 18:22:31 +0000 Subject: [PATCH 5/7] switch blacken with format sessions --- .github/workflows/tests.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7e1beba70c..203388cdd4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -405,13 +405,13 @@ jobs: - name: Install nox. run: | python -m pip install nox - - name: Run blacken and lint on the generated output. + - name: Run format, lint, and mypy on the generated output. run: | - nox -f tests/integration/goldens/asset/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} - nox -f tests/integration/goldens/credentials/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} - nox -f tests/integration/goldens/eventarc/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} - nox -f tests/integration/goldens/logging/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} - nox -f tests/integration/goldens/redis/noxfile.py -s blacken lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/asset/noxfile.py -s format lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/credentials/noxfile.py -s format lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/eventarc/noxfile.py -s format lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/logging/noxfile.py -s format lint mypy-${{ env.LATEST_STABLE_PYTHON }} + nox -f tests/integration/goldens/redis/noxfile.py -s format lint mypy-${{ env.LATEST_STABLE_PYTHON }} goldens-unit: runs-on: ubuntu-latest steps: From b0f00cd8677402d88810c0b875355d0fab200d8c Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 9 Feb 2026 18:31:51 +0000 Subject: [PATCH 6/7] update mypy ini template --- gapic/templates/mypy.ini.j2 | 13 +++++++++++++ tests/integration/goldens/asset/mypy.ini | 13 +++++++++++++ tests/integration/goldens/credentials/mypy.ini | 13 +++++++++++++ tests/integration/goldens/eventarc/mypy.ini | 13 +++++++++++++ tests/integration/goldens/logging/mypy.ini | 13 +++++++++++++ tests/integration/goldens/logging_internal/mypy.ini | 13 +++++++++++++ tests/integration/goldens/redis/mypy.ini | 13 +++++++++++++ tests/integration/goldens/redis_selective/mypy.ini | 13 +++++++++++++ 8 files changed, 104 insertions(+) diff --git a/gapic/templates/mypy.ini.j2 b/gapic/templates/mypy.ini.j2 index a3cb5c2921..6c8973ce3a 100644 --- a/gapic/templates/mypy.ini.j2 +++ b/gapic/templates/mypy.ini.j2 @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True \ No newline at end of file diff --git a/tests/integration/goldens/asset/mypy.ini b/tests/integration/goldens/asset/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/asset/mypy.ini +++ b/tests/integration/goldens/asset/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/tests/integration/goldens/credentials/mypy.ini b/tests/integration/goldens/credentials/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/credentials/mypy.ini +++ b/tests/integration/goldens/credentials/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/tests/integration/goldens/eventarc/mypy.ini b/tests/integration/goldens/eventarc/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/eventarc/mypy.ini +++ b/tests/integration/goldens/eventarc/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/tests/integration/goldens/logging/mypy.ini b/tests/integration/goldens/logging/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/logging/mypy.ini +++ b/tests/integration/goldens/logging/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/tests/integration/goldens/logging_internal/mypy.ini b/tests/integration/goldens/logging_internal/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/logging_internal/mypy.ini +++ b/tests/integration/goldens/logging_internal/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/tests/integration/goldens/redis/mypy.ini b/tests/integration/goldens/redis/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/redis/mypy.ini +++ b/tests/integration/goldens/redis/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True diff --git a/tests/integration/goldens/redis_selective/mypy.ini b/tests/integration/goldens/redis_selective/mypy.ini index a3cb5c2921..db534f8721 100755 --- a/tests/integration/goldens/redis_selective/mypy.ini +++ b/tests/integration/goldens/redis_selective/mypy.ini @@ -1,3 +1,16 @@ [mypy] python_version = 3.14 namespace_packages = True + +# FIX: Prevents failure when dependencies (like google-iam) lack type hints +ignore_missing_imports = True + +# FIX: Silences the "note: By default the bodies of untyped functions are not checked" +# This keeps CI logs clean and focused on actual errors. +check_untyped_defs = False + +# Helps mypy navigate the 'google' namespace more reliably in 3.10+ +explicit_package_bases = True + +# Performance: reuse results from previous runs to speed up 'nox' +incremental = True From 5e7b2852d64aa1f3a0ab7d7cb1c9542ff48e7852 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Mon, 9 Feb 2026 19:07:53 +0000 Subject: [PATCH 7/7] update mypy template --- gapic/templates/mypy.ini.j2 | 9 ++++----- tests/integration/goldens/asset/mypy.ini | 9 ++++----- tests/integration/goldens/credentials/mypy.ini | 9 ++++----- tests/integration/goldens/eventarc/mypy.ini | 9 ++++----- tests/integration/goldens/logging/mypy.ini | 9 ++++----- tests/integration/goldens/logging_internal/mypy.ini | 9 ++++----- tests/integration/goldens/redis/mypy.ini | 9 ++++----- tests/integration/goldens/redis_selective/mypy.ini | 9 ++++----- 8 files changed, 32 insertions(+), 40 deletions(-) diff --git a/gapic/templates/mypy.ini.j2 b/gapic/templates/mypy.ini.j2 index 6c8973ce3a..defc5b1ed8 100644 --- a/gapic/templates/mypy.ini.j2 +++ b/gapic/templates/mypy.ini.j2 @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/asset/mypy.ini b/tests/integration/goldens/asset/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/asset/mypy.ini +++ b/tests/integration/goldens/asset/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/credentials/mypy.ini b/tests/integration/goldens/credentials/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/credentials/mypy.ini +++ b/tests/integration/goldens/credentials/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/eventarc/mypy.ini b/tests/integration/goldens/eventarc/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/eventarc/mypy.ini +++ b/tests/integration/goldens/eventarc/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/logging/mypy.ini b/tests/integration/goldens/logging/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/logging/mypy.ini +++ b/tests/integration/goldens/logging/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/logging_internal/mypy.ini b/tests/integration/goldens/logging_internal/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/logging_internal/mypy.ini +++ b/tests/integration/goldens/logging_internal/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/redis/mypy.ini b/tests/integration/goldens/redis/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/redis/mypy.ini +++ b/tests/integration/goldens/redis/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True diff --git a/tests/integration/goldens/redis_selective/mypy.ini b/tests/integration/goldens/redis_selective/mypy.ini index db534f8721..e0e0da2e9e 100755 --- a/tests/integration/goldens/redis_selective/mypy.ini +++ b/tests/integration/goldens/redis_selective/mypy.ini @@ -1,14 +1,13 @@ [mypy] python_version = 3.14 namespace_packages = True +ignore_missing_imports = False -# FIX: Prevents failure when dependencies (like google-iam) lack type hints +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2563): +# Dependencies that historically lacks py.typed markers +[mypy-google.iam.*] ignore_missing_imports = True -# FIX: Silences the "note: By default the bodies of untyped functions are not checked" -# This keeps CI logs clean and focused on actual errors. -check_untyped_defs = False - # Helps mypy navigate the 'google' namespace more reliably in 3.10+ explicit_package_bases = True