diff --git a/packages/google-cloud-bigquery-datapolicies/.coveragerc b/packages/google-cloud-bigquery-datapolicies/.coveragerc index 813a9a9672ea..1934116df137 100644 --- a/packages/google-cloud-bigquery-datapolicies/.coveragerc +++ b/packages/google-cloud-bigquery-datapolicies/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/gapic_version.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/gapic_version.py new file mode 100644 index 000000000000..318ba53b4de0 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.1" # {x-release-please-version} diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/async_client.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/async_client.py index ca5bd8cc0375..09fd111f8de5 100644 --- a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/async_client.py +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.bigquery.datapolicies_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -228,7 +229,7 @@ async def create_data_policy( parent: Optional[str] = None, data_policy: Optional[datapolicy.DataPolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Creates a new data policy under a project with the given @@ -356,7 +357,7 @@ async def update_data_policy( data_policy: Optional[datapolicy.DataPolicy] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Updates the metadata for an existing data policy. The @@ -492,7 +493,7 @@ async def rename_data_policy( name: Optional[str] = None, new_data_policy_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Renames the id (display name) of the specified data @@ -611,7 +612,7 @@ async def delete_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the data policy specified by its resource @@ -712,7 +713,7 @@ async def get_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Gets the data policy specified by its resource name. @@ -822,7 +823,7 @@ async def list_data_policies( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDataPoliciesAsyncPager: r"""List all of the data policies in the specified parent @@ -947,7 +948,7 @@ async def get_iam_policy( request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for the specified data policy. @@ -1099,7 +1100,7 @@ async def set_iam_policy( request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for the specified data policy. @@ -1251,7 +1252,7 @@ async def test_iam_permissions( request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the caller's permission on the specified data @@ -1346,14 +1347,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-bigquery-datapolicies", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataPolicyServiceAsyncClient",) diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/client.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/client.py index 21818880550b..36ee26302505 100644 --- a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/client.py +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.bigquery.datapolicies_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -457,7 +458,7 @@ def create_data_policy( parent: Optional[str] = None, data_policy: Optional[datapolicy.DataPolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Creates a new data policy under a project with the given @@ -576,7 +577,7 @@ def update_data_policy( data_policy: Optional[datapolicy.DataPolicy] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Updates the metadata for an existing data policy. The @@ -703,7 +704,7 @@ def rename_data_policy( name: Optional[str] = None, new_data_policy_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Renames the id (display name) of the specified data @@ -813,7 +814,7 @@ def delete_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the data policy specified by its resource @@ -905,7 +906,7 @@ def get_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Gets the data policy specified by its resource name. @@ -1006,7 +1007,7 @@ def list_data_policies( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDataPoliciesPager: r"""List all of the data policies in the specified parent @@ -1122,7 +1123,7 @@ def get_iam_policy( request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for the specified data policy. @@ -1264,7 +1265,7 @@ def set_iam_policy( request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for the specified data policy. @@ -1406,7 +1407,7 @@ def test_iam_permissions( request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the caller's permission on the specified data @@ -1498,14 +1499,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-bigquery-datapolicies", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataPolicyServiceClient",) diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/transports/base.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/transports/base.py index 473c159f05f3..5b1b63e9cd46 100644 --- a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/transports/base.py +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1/services/data_policy_service/transports/base.py @@ -26,18 +26,13 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.bigquery.datapolicies_v1 import gapic_version as package_version from google.cloud.bigquery.datapolicies_v1.types import datapolicy -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-bigquery-datapolicies", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataPolicyServiceTransport(abc.ABC): diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/gapic_version.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/gapic_version.py new file mode 100644 index 000000000000..318ba53b4de0 --- /dev/null +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.1.1" # {x-release-please-version} diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/async_client.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/async_client.py index 4f9e03d93d49..aab27426e279 100644 --- a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/async_client.py +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/async_client.py @@ -34,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.bigquery.datapolicies_v1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -230,7 +231,7 @@ async def create_data_policy( parent: Optional[str] = None, data_policy: Optional[datapolicy.DataPolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Creates a new data policy under a project with the given @@ -358,7 +359,7 @@ async def update_data_policy( data_policy: Optional[datapolicy.DataPolicy] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Updates the metadata for an existing data policy. The @@ -493,7 +494,7 @@ async def delete_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the data policy specified by its resource @@ -594,7 +595,7 @@ async def get_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Gets the data policy specified by its resource name. @@ -704,7 +705,7 @@ async def list_data_policies( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDataPoliciesAsyncPager: r"""List all of the data policies in the specified parent @@ -829,7 +830,7 @@ async def get_iam_policy( request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for the specified data policy. @@ -981,7 +982,7 @@ async def set_iam_policy( request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for the specified data policy. @@ -1133,7 +1134,7 @@ async def test_iam_permissions( request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the caller's permission on the specified data @@ -1228,14 +1229,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-bigquery-datapolicies", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataPolicyServiceAsyncClient",) diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/client.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/client.py index 2e9f0d9697a3..c3035c7497a1 100644 --- a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/client.py +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/client.py @@ -38,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.bigquery.datapolicies_v1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -457,7 +458,7 @@ def create_data_policy( parent: Optional[str] = None, data_policy: Optional[datapolicy.DataPolicy] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Creates a new data policy under a project with the given @@ -576,7 +577,7 @@ def update_data_policy( data_policy: Optional[datapolicy.DataPolicy] = None, update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Updates the metadata for an existing data policy. The @@ -702,7 +703,7 @@ def delete_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the data policy specified by its resource @@ -794,7 +795,7 @@ def get_data_policy( *, name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> datapolicy.DataPolicy: r"""Gets the data policy specified by its resource name. @@ -895,7 +896,7 @@ def list_data_policies( *, parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDataPoliciesPager: r"""List all of the data policies in the specified parent @@ -1011,7 +1012,7 @@ def get_iam_policy( request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the IAM policy for the specified data policy. @@ -1153,7 +1154,7 @@ def set_iam_policy( request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the IAM policy for the specified data policy. @@ -1295,7 +1296,7 @@ def test_iam_permissions( request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the caller's permission on the specified data @@ -1387,14 +1388,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-bigquery-datapolicies", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DataPolicyServiceClient",) diff --git a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/transports/base.py b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/transports/base.py index 82c8db9fa910..23ce3eced842 100644 --- a/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/transports/base.py +++ b/packages/google-cloud-bigquery-datapolicies/google/cloud/bigquery/datapolicies_v1beta1/services/data_policy_service/transports/base.py @@ -26,18 +26,13 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.bigquery.datapolicies_v1beta1 import gapic_version as package_version from google.cloud.bigquery.datapolicies_v1beta1.types import datapolicy -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-bigquery-datapolicies", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DataPolicyServiceTransport(abc.ABC): diff --git a/packages/google-cloud-bigquery-datapolicies/release-please-config.json b/packages/google-cloud-bigquery-datapolicies/release-please-config.json index f2728aa69efc..e5ca99226dac 100644 --- a/packages/google-cloud-bigquery-datapolicies/release-please-config.json +++ b/packages/google-cloud-bigquery-datapolicies/release-please-config.json @@ -4,7 +4,14 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/bigquery/datapolicies_v1/gapic_version.py", + "google/cloud/bigquery/datapolicies_v1beta1/gapic_version.py", "google/cloud/bigquery/datapolicies/gapic_version.py", + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.bigquery.datapolicies.v1.json", + "jsonpath": "$.clientLibrary.version" + }, { "type": "json", "path": "samples/generated_samples/snippet_metadata_google.cloud.bigquery.datapolicies.v1beta1.json", diff --git a/packages/google-cloud-bigquery-datapolicies/setup.py b/packages/google-cloud-bigquery-datapolicies/setup.py index 74a247db5f4e..53414554a09a 100644 --- a/packages/google-cloud-bigquery-datapolicies/setup.py +++ b/packages/google-cloud-bigquery-datapolicies/setup.py @@ -38,7 +38,7 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", "grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev", diff --git a/packages/google-cloud-bigquery-datapolicies/testing/constraints-3.7.txt b/packages/google-cloud-bigquery-datapolicies/testing/constraints-3.7.txt index 883a87aefd06..2beecf99e0be 100644 --- a/packages/google-cloud-bigquery-datapolicies/testing/constraints-3.7.txt +++ b/packages/google-cloud-bigquery-datapolicies/testing/constraints-3.7.txt @@ -4,7 +4,7 @@ # Pin the version to the lower bound. # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", # Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.33.2 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5 grpc-google-iam-v1==0.12.4