diff --git a/.coveragerc b/.coveragerc index 69b1869..8dc8f6b 100644 --- a/.coveragerc +++ b/.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/google/cloud/orchestration/airflow/service_v1/gapic_version.py b/google/cloud/orchestration/airflow/service_v1/gapic_version.py new file mode 100644 index 0000000..25e4dd6 --- /dev/null +++ b/google/cloud/orchestration/airflow/service_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__ = "1.4.4" # {x-release-please-version} diff --git a/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py b/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py index 38b8a2e..70b84b9 100644 --- a/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py +++ b/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py @@ -34,7 +34,10 @@ 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.orchestration.airflow.service_v1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -222,7 +225,7 @@ async def create_environment( parent: Optional[str] = None, environment: Optional[environments.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Create a new environment. @@ -251,7 +254,7 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -344,7 +347,7 @@ async def get_environment( *, 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]] = (), ) -> environments.Environment: r"""Get an existing environment. @@ -445,7 +448,7 @@ async def list_environments( *, 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.ListEnvironmentsAsyncPager: r"""List environments. @@ -562,7 +565,7 @@ async def update_environment( environment: Optional[environments.Environment] = 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]] = (), ) -> operation_async.AsyncOperation: r"""Update an environment. @@ -591,7 +594,7 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -873,7 +876,7 @@ async def delete_environment( *, 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]] = (), ) -> operation_async.AsyncOperation: r"""Delete an environment. @@ -902,7 +905,7 @@ async def sample_delete_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -995,7 +998,7 @@ async def save_snapshot( request: Optional[Union[environments.SaveSnapshotRequest, 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]] = (), ) -> operation_async.AsyncOperation: r"""Creates a snapshots of a Cloud Composer environment. @@ -1027,7 +1030,7 @@ async def sample_save_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1094,7 +1097,7 @@ async def load_snapshot( request: Optional[Union[environments.LoadSnapshotRequest, 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]] = (), ) -> operation_async.AsyncOperation: r"""Loads a snapshot of a Cloud Composer environment. @@ -1126,7 +1129,7 @@ async def sample_load_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1195,14 +1198,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-orchestration-airflow", - ).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__ = ("EnvironmentsAsyncClient",) diff --git a/google/cloud/orchestration/airflow/service_v1/services/environments/client.py b/google/cloud/orchestration/airflow/service_v1/services/environments/client.py index 59cba2d..68cb690 100644 --- a/google/cloud/orchestration/airflow/service_v1/services/environments/client.py +++ b/google/cloud/orchestration/airflow/service_v1/services/environments/client.py @@ -38,7 +38,10 @@ 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.orchestration.airflow.service_v1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -453,7 +456,7 @@ def create_environment( parent: Optional[str] = None, environment: Optional[environments.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Create a new environment. @@ -575,7 +578,7 @@ def get_environment( *, 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]] = (), ) -> environments.Environment: r"""Get an existing environment. @@ -676,7 +679,7 @@ def list_environments( *, 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.ListEnvironmentsPager: r"""List environments. @@ -793,7 +796,7 @@ def update_environment( environment: Optional[environments.Environment] = 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]] = (), ) -> operation.Operation: r"""Update an environment. @@ -1104,7 +1107,7 @@ def delete_environment( *, 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]] = (), ) -> operation.Operation: r"""Delete an environment. @@ -1226,7 +1229,7 @@ def save_snapshot( request: Optional[Union[environments.SaveSnapshotRequest, 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]] = (), ) -> operation.Operation: r"""Creates a snapshots of a Cloud Composer environment. @@ -1326,7 +1329,7 @@ def load_snapshot( request: Optional[Union[environments.LoadSnapshotRequest, 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]] = (), ) -> operation.Operation: r"""Loads a snapshot of a Cloud Composer environment. @@ -1435,14 +1438,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-orchestration-airflow", - ).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__ = ("EnvironmentsClient",) diff --git a/google/cloud/orchestration/airflow/service_v1/services/environments/transports/base.py b/google/cloud/orchestration/airflow/service_v1/services/environments/transports/base.py index 98f65e1..2ca7f78 100644 --- a/google/cloud/orchestration/airflow/service_v1/services/environments/transports/base.py +++ b/google/cloud/orchestration/airflow/service_v1/services/environments/transports/base.py @@ -24,18 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.orchestration.airflow.service_v1 import ( + gapic_version as package_version, +) from google.cloud.orchestration.airflow.service_v1.types import environments -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-orchestration-airflow", - ).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 EnvironmentsTransport(abc.ABC): diff --git a/google/cloud/orchestration/airflow/service_v1/services/image_versions/async_client.py b/google/cloud/orchestration/airflow/service_v1/services/image_versions/async_client.py index 9143806..3cb959a 100644 --- a/google/cloud/orchestration/airflow/service_v1/services/image_versions/async_client.py +++ b/google/cloud/orchestration/airflow/service_v1/services/image_versions/async_client.py @@ -34,7 +34,10 @@ 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.orchestration.airflow.service_v1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -217,7 +220,7 @@ async def list_image_versions( *, 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.ListImageVersionsAsyncPager: r"""List ImageVersions for provided location. @@ -333,14 +336,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-orchestration-airflow", - ).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__ = ("ImageVersionsAsyncClient",) diff --git a/google/cloud/orchestration/airflow/service_v1/services/image_versions/client.py b/google/cloud/orchestration/airflow/service_v1/services/image_versions/client.py index 7f59bd3..746d237 100644 --- a/google/cloud/orchestration/airflow/service_v1/services/image_versions/client.py +++ b/google/cloud/orchestration/airflow/service_v1/services/image_versions/client.py @@ -38,7 +38,10 @@ 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.orchestration.airflow.service_v1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -422,7 +425,7 @@ def list_image_versions( *, 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.ListImageVersionsPager: r"""List ImageVersions for provided location. @@ -545,14 +548,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-orchestration-airflow", - ).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__ = ("ImageVersionsClient",) diff --git a/google/cloud/orchestration/airflow/service_v1/services/image_versions/transports/base.py b/google/cloud/orchestration/airflow/service_v1/services/image_versions/transports/base.py index 733dbe2..34b20e5 100644 --- a/google/cloud/orchestration/airflow/service_v1/services/image_versions/transports/base.py +++ b/google/cloud/orchestration/airflow/service_v1/services/image_versions/transports/base.py @@ -23,18 +23,15 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.orchestration.airflow.service_v1 import ( + gapic_version as package_version, +) from google.cloud.orchestration.airflow.service_v1.types import image_versions -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-orchestration-airflow", - ).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 ImageVersionsTransport(abc.ABC): diff --git a/google/cloud/orchestration/airflow/service_v1beta1/gapic_version.py b/google/cloud/orchestration/airflow/service_v1beta1/gapic_version.py new file mode 100644 index 0000000..25e4dd6 --- /dev/null +++ b/google/cloud/orchestration/airflow/service_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__ = "1.4.4" # {x-release-please-version} diff --git a/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py b/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py index 66540ce..e25ea0d 100644 --- a/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py +++ b/google/cloud/orchestration/airflow/service_v1beta1/services/environments/async_client.py @@ -34,7 +34,10 @@ 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.orchestration.airflow.service_v1beta1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -227,7 +230,7 @@ async def create_environment( parent: Optional[str] = None, environment: Optional[environments.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Create a new environment. @@ -256,7 +259,7 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -349,7 +352,7 @@ async def get_environment( *, 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]] = (), ) -> environments.Environment: r"""Get an existing environment. @@ -450,7 +453,7 @@ async def list_environments( *, 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.ListEnvironmentsAsyncPager: r"""List environments. @@ -567,7 +570,7 @@ async def update_environment( environment: Optional[environments.Environment] = 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]] = (), ) -> operation_async.AsyncOperation: r"""Update an environment. @@ -596,7 +599,7 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -915,7 +918,7 @@ async def delete_environment( *, 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]] = (), ) -> operation_async.AsyncOperation: r"""Delete an environment. @@ -944,7 +947,7 @@ async def sample_delete_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1037,7 +1040,7 @@ async def restart_web_server( request: Optional[Union[environments.RestartWebServerRequest, 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]] = (), ) -> operation_async.AsyncOperation: r"""Restart Airflow web server. @@ -1066,7 +1069,7 @@ async def sample_restart_web_server(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1130,7 +1133,7 @@ async def check_upgrade( request: Optional[Union[environments.CheckUpgradeRequest, 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]] = (), ) -> operation_async.AsyncOperation: r"""Check if an upgrade operation on the environment will @@ -1162,7 +1165,7 @@ async def sample_check_upgrade(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1228,7 +1231,7 @@ async def save_snapshot( request: Optional[Union[environments.SaveSnapshotRequest, 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]] = (), ) -> operation_async.AsyncOperation: r"""Creates a snapshots of a Cloud Composer environment. @@ -1260,7 +1263,7 @@ async def sample_save_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1327,7 +1330,7 @@ async def load_snapshot( request: Optional[Union[environments.LoadSnapshotRequest, 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]] = (), ) -> operation_async.AsyncOperation: r"""Loads a snapshot of a Cloud Composer environment. @@ -1359,7 +1362,7 @@ async def sample_load_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1428,14 +1431,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-orchestration-airflow-service", - ).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__ = ("EnvironmentsAsyncClient",) diff --git a/google/cloud/orchestration/airflow/service_v1beta1/services/environments/client.py b/google/cloud/orchestration/airflow/service_v1beta1/services/environments/client.py index 149d3ac..2ffcc35 100644 --- a/google/cloud/orchestration/airflow/service_v1beta1/services/environments/client.py +++ b/google/cloud/orchestration/airflow/service_v1beta1/services/environments/client.py @@ -38,7 +38,10 @@ 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.orchestration.airflow.service_v1beta1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -458,7 +461,7 @@ def create_environment( parent: Optional[str] = None, environment: Optional[environments.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Create a new environment. @@ -580,7 +583,7 @@ def get_environment( *, 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]] = (), ) -> environments.Environment: r"""Get an existing environment. @@ -681,7 +684,7 @@ def list_environments( *, 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.ListEnvironmentsPager: r"""List environments. @@ -798,7 +801,7 @@ def update_environment( environment: Optional[environments.Environment] = 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]] = (), ) -> operation.Operation: r"""Update an environment. @@ -1146,7 +1149,7 @@ def delete_environment( *, 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]] = (), ) -> operation.Operation: r"""Delete an environment. @@ -1268,7 +1271,7 @@ def restart_web_server( request: Optional[Union[environments.RestartWebServerRequest, 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]] = (), ) -> operation.Operation: r"""Restart Airflow web server. @@ -1362,7 +1365,7 @@ def check_upgrade( request: Optional[Union[environments.CheckUpgradeRequest, 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]] = (), ) -> operation.Operation: r"""Check if an upgrade operation on the environment will @@ -1461,7 +1464,7 @@ def save_snapshot( request: Optional[Union[environments.SaveSnapshotRequest, 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]] = (), ) -> operation.Operation: r"""Creates a snapshots of a Cloud Composer environment. @@ -1561,7 +1564,7 @@ def load_snapshot( request: Optional[Union[environments.LoadSnapshotRequest, 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]] = (), ) -> operation.Operation: r"""Loads a snapshot of a Cloud Composer environment. @@ -1670,14 +1673,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-orchestration-airflow-service", - ).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__ = ("EnvironmentsClient",) diff --git a/google/cloud/orchestration/airflow/service_v1beta1/services/environments/transports/base.py b/google/cloud/orchestration/airflow/service_v1beta1/services/environments/transports/base.py index e28de0c..f8a31db 100644 --- a/google/cloud/orchestration/airflow/service_v1beta1/services/environments/transports/base.py +++ b/google/cloud/orchestration/airflow/service_v1beta1/services/environments/transports/base.py @@ -24,18 +24,15 @@ from google.auth import credentials as ga_credentials # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.orchestration.airflow.service_v1beta1 import ( + gapic_version as package_version, +) from google.cloud.orchestration.airflow.service_v1beta1.types import environments -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-orchestration-airflow-service", - ).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 EnvironmentsTransport(abc.ABC): diff --git a/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/async_client.py b/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/async_client.py index 0bf4539..a95d9a0 100644 --- a/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/async_client.py +++ b/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/async_client.py @@ -34,7 +34,10 @@ 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.orchestration.airflow.service_v1beta1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -219,7 +222,7 @@ async def list_image_versions( *, 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.ListImageVersionsAsyncPager: r"""List ImageVersions for provided location. @@ -335,14 +338,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-orchestration-airflow-service", - ).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__ = ("ImageVersionsAsyncClient",) diff --git a/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/client.py b/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/client.py index d733c4f..7029b7f 100644 --- a/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/client.py +++ b/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/client.py @@ -38,7 +38,10 @@ 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.orchestration.airflow.service_v1beta1 import ( + gapic_version as package_version, +) try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -424,7 +427,7 @@ def list_image_versions( *, 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.ListImageVersionsPager: r"""List ImageVersions for provided location. @@ -547,14 +550,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-orchestration-airflow-service", - ).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__ = ("ImageVersionsClient",) diff --git a/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/transports/base.py b/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/transports/base.py index 102d5b3..ba079a5 100644 --- a/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/transports/base.py +++ b/google/cloud/orchestration/airflow/service_v1beta1/services/image_versions/transports/base.py @@ -23,18 +23,15 @@ import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.orchestration.airflow.service_v1beta1 import ( + gapic_version as package_version, +) from google.cloud.orchestration.airflow.service_v1beta1.types import image_versions -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-orchestration-airflow-service", - ).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 ImageVersionsTransport(abc.ABC): diff --git a/release-please-config.json b/release-please-config.json index 45c8680..c281718 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -4,6 +4,8 @@ ".": { "release-type": "python", "extra-files": [ + "google/cloud/orchestration/airflow/service_v1beta1/gapic_version.py", + "google/cloud/orchestration/airflow/service_v1/gapic_version.py", "google/cloud/orchestration/airflow/service/gapic_version.py", { "type": "json", diff --git a/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py b/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py index f4ea9b0..d0655bf 100644 --- a/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py +++ b/samples/generated_samples/composer_v1_generated_environments_create_environment_async.py @@ -47,7 +47,7 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py b/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py index 7038e83..ea715af 100644 --- a/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py +++ b/samples/generated_samples/composer_v1_generated_environments_delete_environment_async.py @@ -47,7 +47,7 @@ async def sample_delete_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py b/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py index b7776e0..953a029 100644 --- a/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py +++ b/samples/generated_samples/composer_v1_generated_environments_load_snapshot_async.py @@ -47,7 +47,7 @@ async def sample_load_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py b/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py index ec387fe..c580bdd 100644 --- a/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py +++ b/samples/generated_samples/composer_v1_generated_environments_save_snapshot_async.py @@ -47,7 +47,7 @@ async def sample_save_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py b/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py index 33d7de9..a0cbc7e 100644 --- a/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py +++ b/samples/generated_samples/composer_v1_generated_environments_update_environment_async.py @@ -47,7 +47,7 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py index 7eaa946..6f832b6 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_check_upgrade_async.py @@ -47,7 +47,7 @@ async def sample_check_upgrade(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py index 3f6d69d..4e1a614 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_create_environment_async.py @@ -47,7 +47,7 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py index cb1b567..e0b793c 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_delete_environment_async.py @@ -47,7 +47,7 @@ async def sample_delete_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py index fbd0dae..9a689ea 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_load_snapshot_async.py @@ -47,7 +47,7 @@ async def sample_load_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py index 0b9da12..2c26cfb 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_restart_web_server_async.py @@ -47,7 +47,7 @@ async def sample_restart_web_server(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py index de0f02a..e007dcd 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_save_snapshot_async.py @@ -47,7 +47,7 @@ async def sample_save_snapshot(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py b/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py index f871fb5..a848381 100644 --- a/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py +++ b/samples/generated_samples/composer_v1beta1_generated_environments_update_environment_async.py @@ -47,7 +47,7 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/setup.py b/setup.py index 577f135..4f4e527 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,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", ] diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 6f3158c..6c44adf 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -4,6 +4,6 @@ # 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