From 6a9ae00b146ddb2ad7f0d6c65fde269bd7fed821 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 20:48:45 -0400 Subject: [PATCH] chore(python): add nox session to sort python imports (#86) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- .../.github/.OwlBot.lock.yaml | 4 +- packages/google-cloud-iap/docs/conf.py | 2 +- .../google/cloud/iap/__init__.py | 55 ++++++++++--------- .../google/cloud/iap_v1/__init__.py | 53 +++++++++--------- .../__init__.py | 2 +- .../async_client.py | 12 ++-- .../client.py | 10 ++-- .../transports/__init__.py | 1 - .../transports/base.py | 8 +-- .../transports/grpc.py | 13 ++--- .../transports/grpc_asyncio.py | 13 ++--- .../__init__.py | 2 +- .../async_client.py | 9 +-- .../client.py | 7 ++- .../pagers.py | 4 +- .../transports/__init__.py | 1 - .../transports/base.py | 6 +- .../transports/grpc.py | 11 ++-- .../transports/grpc_asyncio.py | 11 ++-- .../google/cloud/iap_v1/types/service.py | 4 +- packages/google-cloud-iap/noxfile.py | 28 +++++++++- packages/google-cloud-iap/setup.py | 1 - ...test_identity_aware_proxy_admin_service.py | 36 +++++------- ...est_identity_aware_proxy_o_auth_service.py | 30 ++++------ 24 files changed, 164 insertions(+), 159 deletions(-) diff --git a/packages/google-cloud-iap/.github/.OwlBot.lock.yaml b/packages/google-cloud-iap/.github/.OwlBot.lock.yaml index bc893c979e20..7c454abf76f3 100644 --- a/packages/google-cloud-iap/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-iap/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/packages/google-cloud-iap/docs/conf.py b/packages/google-cloud-iap/docs/conf.py index e24b5c674dd7..5449aabdcf35 100644 --- a/packages/google-cloud-iap/docs/conf.py +++ b/packages/google-cloud-iap/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/packages/google-cloud-iap/google/cloud/iap/__init__.py b/packages/google-cloud-iap/google/cloud/iap/__init__.py index 205c6c25d9e5..1d635e6b463c 100644 --- a/packages/google-cloud-iap/google/cloud/iap/__init__.py +++ b/packages/google-cloud-iap/google/cloud/iap/__init__.py @@ -14,42 +14,43 @@ # limitations under the License. # +from google.cloud.iap_v1.services.identity_aware_proxy_admin_service.async_client import ( + IdentityAwareProxyAdminServiceAsyncClient, +) from google.cloud.iap_v1.services.identity_aware_proxy_admin_service.client import ( IdentityAwareProxyAdminServiceClient, ) -from google.cloud.iap_v1.services.identity_aware_proxy_admin_service.async_client import ( - IdentityAwareProxyAdminServiceAsyncClient, +from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service.async_client import ( + IdentityAwareProxyOAuthServiceAsyncClient, ) from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service.client import ( IdentityAwareProxyOAuthServiceClient, ) -from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service.async_client import ( - IdentityAwareProxyOAuthServiceAsyncClient, +from google.cloud.iap_v1.types.service import ( + AccessDeniedPageSettings, + AccessSettings, + ApplicationSettings, + Brand, + CorsSettings, + CreateBrandRequest, + CreateIdentityAwareProxyClientRequest, + CsmSettings, + DeleteIdentityAwareProxyClientRequest, + GcipSettings, + GetBrandRequest, + GetIapSettingsRequest, + GetIdentityAwareProxyClientRequest, + IapSettings, + IdentityAwareProxyClient, + ListBrandsRequest, + ListBrandsResponse, + ListIdentityAwareProxyClientsRequest, + ListIdentityAwareProxyClientsResponse, + OAuthSettings, + ResetIdentityAwareProxyClientSecretRequest, + UpdateIapSettingsRequest, ) -from google.cloud.iap_v1.types.service import AccessDeniedPageSettings -from google.cloud.iap_v1.types.service import AccessSettings -from google.cloud.iap_v1.types.service import ApplicationSettings -from google.cloud.iap_v1.types.service import Brand -from google.cloud.iap_v1.types.service import CorsSettings -from google.cloud.iap_v1.types.service import CreateBrandRequest -from google.cloud.iap_v1.types.service import CreateIdentityAwareProxyClientRequest -from google.cloud.iap_v1.types.service import CsmSettings -from google.cloud.iap_v1.types.service import DeleteIdentityAwareProxyClientRequest -from google.cloud.iap_v1.types.service import GcipSettings -from google.cloud.iap_v1.types.service import GetBrandRequest -from google.cloud.iap_v1.types.service import GetIapSettingsRequest -from google.cloud.iap_v1.types.service import GetIdentityAwareProxyClientRequest -from google.cloud.iap_v1.types.service import IapSettings -from google.cloud.iap_v1.types.service import IdentityAwareProxyClient -from google.cloud.iap_v1.types.service import ListBrandsRequest -from google.cloud.iap_v1.types.service import ListBrandsResponse -from google.cloud.iap_v1.types.service import ListIdentityAwareProxyClientsRequest -from google.cloud.iap_v1.types.service import ListIdentityAwareProxyClientsResponse -from google.cloud.iap_v1.types.service import OAuthSettings -from google.cloud.iap_v1.types.service import ResetIdentityAwareProxyClientSecretRequest -from google.cloud.iap_v1.types.service import UpdateIapSettingsRequest - __all__ = ( "IdentityAwareProxyAdminServiceClient", "IdentityAwareProxyAdminServiceAsyncClient", diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/__init__.py b/packages/google-cloud-iap/google/cloud/iap_v1/__init__.py index c13608594a84..ff4ec66fdbb6 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/__init__.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/__init__.py @@ -14,42 +14,39 @@ # limitations under the License. # -from .services.identity_aware_proxy_admin_service import ( - IdentityAwareProxyAdminServiceClient, -) from .services.identity_aware_proxy_admin_service import ( IdentityAwareProxyAdminServiceAsyncClient, + IdentityAwareProxyAdminServiceClient, ) from .services.identity_aware_proxy_o_auth_service import ( + IdentityAwareProxyOAuthServiceAsyncClient, IdentityAwareProxyOAuthServiceClient, ) -from .services.identity_aware_proxy_o_auth_service import ( - IdentityAwareProxyOAuthServiceAsyncClient, +from .types.service import ( + AccessDeniedPageSettings, + AccessSettings, + ApplicationSettings, + Brand, + CorsSettings, + CreateBrandRequest, + CreateIdentityAwareProxyClientRequest, + CsmSettings, + DeleteIdentityAwareProxyClientRequest, + GcipSettings, + GetBrandRequest, + GetIapSettingsRequest, + GetIdentityAwareProxyClientRequest, + IapSettings, + IdentityAwareProxyClient, + ListBrandsRequest, + ListBrandsResponse, + ListIdentityAwareProxyClientsRequest, + ListIdentityAwareProxyClientsResponse, + OAuthSettings, + ResetIdentityAwareProxyClientSecretRequest, + UpdateIapSettingsRequest, ) -from .types.service import AccessDeniedPageSettings -from .types.service import AccessSettings -from .types.service import ApplicationSettings -from .types.service import Brand -from .types.service import CorsSettings -from .types.service import CreateBrandRequest -from .types.service import CreateIdentityAwareProxyClientRequest -from .types.service import CsmSettings -from .types.service import DeleteIdentityAwareProxyClientRequest -from .types.service import GcipSettings -from .types.service import GetBrandRequest -from .types.service import GetIapSettingsRequest -from .types.service import GetIdentityAwareProxyClientRequest -from .types.service import IapSettings -from .types.service import IdentityAwareProxyClient -from .types.service import ListBrandsRequest -from .types.service import ListBrandsResponse -from .types.service import ListIdentityAwareProxyClientsRequest -from .types.service import ListIdentityAwareProxyClientsResponse -from .types.service import OAuthSettings -from .types.service import ResetIdentityAwareProxyClientSecretRequest -from .types.service import UpdateIapSettingsRequest - __all__ = ( "IdentityAwareProxyAdminServiceAsyncClient", "IdentityAwareProxyOAuthServiceAsyncClient", diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/__init__.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/__init__.py index 8aad0aead56a..01c544c36d7e 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/__init__.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import IdentityAwareProxyAdminServiceClient from .async_client import IdentityAwareProxyAdminServiceAsyncClient +from .client import IdentityAwareProxyAdminServiceClient __all__ = ( "IdentityAwareProxyAdminServiceClient", diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/async_client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/async_client.py index 18a92aef1f34..b8c8ec69bbae 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/async_client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/async_client.py @@ -17,29 +17,31 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +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 try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.iap_v1.types import service from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore + +from google.cloud.iap_v1.types import service + +from .client import IdentityAwareProxyAdminServiceClient from .transports.base import ( - IdentityAwareProxyAdminServiceTransport, DEFAULT_CLIENT_INFO, + IdentityAwareProxyAdminServiceTransport, ) from .transports.grpc_asyncio import IdentityAwareProxyAdminServiceGrpcAsyncIOTransport -from .client import IdentityAwareProxyAdminServiceClient class IdentityAwareProxyAdminServiceAsyncClient: diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py index 0d1b0b7fae27..640fadc02b33 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py @@ -17,29 +17,31 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.iap_v1.types import service from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore + +from google.cloud.iap_v1.types import service + from .transports.base import ( - IdentityAwareProxyAdminServiceTransport, DEFAULT_CLIENT_INFO, + IdentityAwareProxyAdminServiceTransport, ) from .transports.grpc import IdentityAwareProxyAdminServiceGrpcTransport from .transports.grpc_asyncio import IdentityAwareProxyAdminServiceGrpcAsyncIOTransport diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/__init__.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/__init__.py index db4da2aef477..0d37784d22c0 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/__init__.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import IdentityAwareProxyAdminServiceGrpcTransport from .grpc_asyncio import IdentityAwareProxyAdminServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = ( OrderedDict() diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py index 09ec29602fb8..d299b2b4b88e 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py @@ -15,19 +15,19 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources from google.cloud.iap_v1.types import service -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py index e6fd46aa60fa..351c7a77811d 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc.py @@ -13,21 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore import grpc # type: ignore from google.cloud.iap_v1.types import service -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from .base import IdentityAwareProxyAdminServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, IdentityAwareProxyAdminServiceTransport class IdentityAwareProxyAdminServiceGrpcTransport( diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py index 4f971de28dbf..40143205d8b5 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/grpc_asyncio.py @@ -13,21 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.iap_v1.types import service -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from .base import IdentityAwareProxyAdminServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, IdentityAwareProxyAdminServiceTransport from .grpc import IdentityAwareProxyAdminServiceGrpcTransport diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/__init__.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/__init__.py index 4d9a99ad5a34..7cdc6b2b41eb 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/__init__.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import IdentityAwareProxyOAuthServiceClient from .async_client import IdentityAwareProxyOAuthServiceAsyncClient +from .client import IdentityAwareProxyOAuthServiceClient __all__ = ( "IdentityAwareProxyOAuthServiceClient", diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/async_client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/async_client.py index 32bebca37fed..c4db65913316 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/async_client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/async_client.py @@ -17,14 +17,14 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +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 try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -33,12 +33,13 @@ from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service import pagers from google.cloud.iap_v1.types import service + +from .client import IdentityAwareProxyOAuthServiceClient from .transports.base import ( - IdentityAwareProxyOAuthServiceTransport, DEFAULT_CLIENT_INFO, + IdentityAwareProxyOAuthServiceTransport, ) from .transports.grpc_asyncio import IdentityAwareProxyOAuthServiceGrpcAsyncIOTransport -from .client import IdentityAwareProxyOAuthServiceClient class IdentityAwareProxyOAuthServiceAsyncClient: diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py index be9dbde2ec45..b45cf5b588c1 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/client.py @@ -17,17 +17,17 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -36,9 +36,10 @@ from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service import pagers from google.cloud.iap_v1.types import service + from .transports.base import ( - IdentityAwareProxyOAuthServiceTransport, DEFAULT_CLIENT_INFO, + IdentityAwareProxyOAuthServiceTransport, ) from .transports.grpc import IdentityAwareProxyOAuthServiceGrpcTransport from .transports.grpc_asyncio import IdentityAwareProxyOAuthServiceGrpcAsyncIOTransport diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/pagers.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/pagers.py index 06a1a74b1911..c059aa815717 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/pagers.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/pagers.py @@ -18,10 +18,10 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) from google.cloud.iap_v1.types import service diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/__init__.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/__init__.py index 2ccc6136f115..eb0b140c5165 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/__init__.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import IdentityAwareProxyOAuthServiceGrpcTransport from .grpc_asyncio import IdentityAwareProxyOAuthServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = ( OrderedDict() diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py index 16fc139d964d..eb0e7667776d 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/base.py @@ -15,18 +15,18 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.iap_v1.types import service -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py index e5672e93d191..b1c5867062b2 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc.py @@ -13,20 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.iap_v1.types import service -from google.protobuf import empty_pb2 # type: ignore -from .base import IdentityAwareProxyOAuthServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, IdentityAwareProxyOAuthServiceTransport class IdentityAwareProxyOAuthServiceGrpcTransport( diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py index d1a35a5ae323..4fbc5a2d015f 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_o_auth_service/transports/grpc_asyncio.py @@ -13,20 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore from google.cloud.iap_v1.types import service -from google.protobuf import empty_pb2 # type: ignore -from .base import IdentityAwareProxyOAuthServiceTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, IdentityAwareProxyOAuthServiceTransport from .grpc import IdentityAwareProxyOAuthServiceGrpcTransport diff --git a/packages/google-cloud-iap/google/cloud/iap_v1/types/service.py b/packages/google-cloud-iap/google/cloud/iap_v1/types/service.py index 7003cee2cd7e..dddeac75dc7f 100644 --- a/packages/google-cloud-iap/google/cloud/iap_v1/types/service.py +++ b/packages/google-cloud-iap/google/cloud/iap_v1/types/service.py @@ -13,11 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.iap.v1", diff --git a/packages/google-cloud-iap/noxfile.py b/packages/google-cloud-iap/noxfile.py index 6ee5e8ab96d9..7c1742d2cc93 100644 --- a/packages/google-cloud-iap/noxfile.py +++ b/packages/google-cloud-iap/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/packages/google-cloud-iap/setup.py b/packages/google-cloud-iap/setup.py index ad8471c386ff..c34b30aeac1d 100644 --- a/packages/google-cloud-iap/setup.py +++ b/packages/google-cloud-iap/setup.py @@ -19,7 +19,6 @@ import setuptools - name = "google-cloud-iap" description = "Identity-Aware Proxy API client library" version = "1.3.1" diff --git a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py index 1601c3edef63..5d429bc734a1 100644 --- a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py +++ b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_admin_service.py @@ -13,32 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.iap_v1.services.identity_aware_proxy_admin_service import ( - IdentityAwareProxyAdminServiceAsyncClient, -) -from google.cloud.iap_v1.services.identity_aware_proxy_admin_service import ( - IdentityAwareProxyAdminServiceClient, -) -from google.cloud.iap_v1.services.identity_aware_proxy_admin_service import transports -from google.cloud.iap_v1.types import service from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -46,7 +29,18 @@ from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.type import expr_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.iap_v1.services.identity_aware_proxy_admin_service import ( + IdentityAwareProxyAdminServiceAsyncClient, + IdentityAwareProxyAdminServiceClient, + transports, +) +from google.cloud.iap_v1.types import service def client_cert_source_callback(): diff --git a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py index baeed46837a0..d4a8f410b1cf 100644 --- a/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py +++ b/packages/google-cloud-iap/tests/unit/gapic/iap_v1/test_identity_aware_proxy_o_auth_service.py @@ -13,35 +13,29 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError +from google.oauth2 import service_account +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service import ( IdentityAwareProxyOAuthServiceAsyncClient, -) -from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service import ( IdentityAwareProxyOAuthServiceClient, + pagers, + transports, ) -from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service import pagers -from google.cloud.iap_v1.services.identity_aware_proxy_o_auth_service import transports from google.cloud.iap_v1.types import service -from google.oauth2 import service_account -import google.auth def client_cert_source_callback():