From 13c39c650107fda6801abf77eabf575d0db34545 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:23:37 -0400 Subject: [PATCH] chore(python): add nox session to sort python imports (#92) 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-datastream/docs/conf.py | 2 +- .../google/cloud/datastream/__init__.py | 137 ++++++++-------- .../google/cloud/datastream_v1/__init__.py | 146 +++++++++--------- .../services/datastream/__init__.py | 2 +- .../services/datastream/async_client.py | 15 +- .../services/datastream/client.py | 13 +- .../services/datastream/pagers.py | 7 +- .../datastream/transports/__init__.py | 1 - .../services/datastream/transports/base.py | 12 +- .../services/datastream/transports/grpc.py | 15 +- .../datastream/transports/grpc_asyncio.py | 15 +- .../cloud/datastream_v1/types/datastream.py | 5 +- .../types/datastream_resources.py | 4 +- .../cloud/datastream_v1alpha1/__init__.py | 134 ++++++++-------- .../services/datastream/__init__.py | 2 +- .../services/datastream/async_client.py | 15 +- .../services/datastream/client.py | 13 +- .../services/datastream/pagers.py | 7 +- .../datastream/transports/__init__.py | 1 - .../services/datastream/transports/base.py | 12 +- .../services/datastream/transports/grpc.py | 15 +- .../datastream/transports/grpc_asyncio.py | 15 +- .../datastream_v1alpha1/types/__init__.py | 4 +- .../datastream_v1alpha1/types/datastream.py | 5 +- .../types/datastream_resources.py | 4 +- packages/google-cloud-datastream/noxfile.py | 28 +++- packages/google-cloud-datastream/setup.py | 1 - .../gapic/datastream_v1/test_datastream.py | 46 +++--- .../datastream_v1alpha1/test_datastream.py | 46 +++--- 30 files changed, 365 insertions(+), 361 deletions(-) diff --git a/packages/google-cloud-datastream/.github/.OwlBot.lock.yaml b/packages/google-cloud-datastream/.github/.OwlBot.lock.yaml index bc893c979e20..7c454abf76f3 100644 --- a/packages/google-cloud-datastream/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-datastream/.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-datastream/docs/conf.py b/packages/google-cloud-datastream/docs/conf.py index 2654f0d37aa3..2255f44aac71 100644 --- a/packages/google-cloud-datastream/docs/conf.py +++ b/packages/google-cloud-datastream/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-datastream/google/cloud/datastream/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream/__init__.py index 8c5ff0beb518..2127eeddd47e 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream/__init__.py @@ -14,86 +14,83 @@ # limitations under the License. # -from google.cloud.datastream_v1.services.datastream.client import DatastreamClient from google.cloud.datastream_v1.services.datastream.async_client import ( DatastreamAsyncClient, ) - -from google.cloud.datastream_v1.types.datastream import CreateConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import CreatePrivateConnectionRequest -from google.cloud.datastream_v1.types.datastream import CreateRouteRequest -from google.cloud.datastream_v1.types.datastream import CreateStreamRequest -from google.cloud.datastream_v1.types.datastream import DeleteConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import DeletePrivateConnectionRequest -from google.cloud.datastream_v1.types.datastream import DeleteRouteRequest -from google.cloud.datastream_v1.types.datastream import DeleteStreamRequest -from google.cloud.datastream_v1.types.datastream import DiscoverConnectionProfileRequest +from google.cloud.datastream_v1.services.datastream.client import DatastreamClient from google.cloud.datastream_v1.types.datastream import ( + CreateConnectionProfileRequest, + CreatePrivateConnectionRequest, + CreateRouteRequest, + CreateStreamRequest, + DeleteConnectionProfileRequest, + DeletePrivateConnectionRequest, + DeleteRouteRequest, + DeleteStreamRequest, + DiscoverConnectionProfileRequest, DiscoverConnectionProfileResponse, + FetchStaticIpsRequest, + FetchStaticIpsResponse, + GetConnectionProfileRequest, + GetPrivateConnectionRequest, + GetRouteRequest, + GetStreamObjectRequest, + GetStreamRequest, + ListConnectionProfilesRequest, + ListConnectionProfilesResponse, + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse, + ListRoutesRequest, + ListRoutesResponse, + ListStreamObjectsRequest, + ListStreamObjectsResponse, + ListStreamsRequest, + ListStreamsResponse, + LookupStreamObjectRequest, + OperationMetadata, + StartBackfillJobRequest, + StartBackfillJobResponse, + StopBackfillJobRequest, + StopBackfillJobResponse, + UpdateConnectionProfileRequest, + UpdateStreamRequest, ) -from google.cloud.datastream_v1.types.datastream import FetchStaticIpsRequest -from google.cloud.datastream_v1.types.datastream import FetchStaticIpsResponse -from google.cloud.datastream_v1.types.datastream import GetConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import GetPrivateConnectionRequest -from google.cloud.datastream_v1.types.datastream import GetRouteRequest -from google.cloud.datastream_v1.types.datastream import GetStreamObjectRequest -from google.cloud.datastream_v1.types.datastream import GetStreamRequest -from google.cloud.datastream_v1.types.datastream import ListConnectionProfilesRequest -from google.cloud.datastream_v1.types.datastream import ListConnectionProfilesResponse -from google.cloud.datastream_v1.types.datastream import ListPrivateConnectionsRequest -from google.cloud.datastream_v1.types.datastream import ListPrivateConnectionsResponse -from google.cloud.datastream_v1.types.datastream import ListRoutesRequest -from google.cloud.datastream_v1.types.datastream import ListRoutesResponse -from google.cloud.datastream_v1.types.datastream import ListStreamObjectsRequest -from google.cloud.datastream_v1.types.datastream import ListStreamObjectsResponse -from google.cloud.datastream_v1.types.datastream import ListStreamsRequest -from google.cloud.datastream_v1.types.datastream import ListStreamsResponse -from google.cloud.datastream_v1.types.datastream import LookupStreamObjectRequest -from google.cloud.datastream_v1.types.datastream import OperationMetadata -from google.cloud.datastream_v1.types.datastream import StartBackfillJobRequest -from google.cloud.datastream_v1.types.datastream import StartBackfillJobResponse -from google.cloud.datastream_v1.types.datastream import StopBackfillJobRequest -from google.cloud.datastream_v1.types.datastream import StopBackfillJobResponse -from google.cloud.datastream_v1.types.datastream import UpdateConnectionProfileRequest -from google.cloud.datastream_v1.types.datastream import UpdateStreamRequest -from google.cloud.datastream_v1.types.datastream_resources import AvroFileFormat -from google.cloud.datastream_v1.types.datastream_resources import BackfillJob -from google.cloud.datastream_v1.types.datastream_resources import ConnectionProfile -from google.cloud.datastream_v1.types.datastream_resources import DestinationConfig -from google.cloud.datastream_v1.types.datastream_resources import Error from google.cloud.datastream_v1.types.datastream_resources import ( + AvroFileFormat, + BackfillJob, + ConnectionProfile, + DestinationConfig, + Error, ForwardSshTunnelConnectivity, -) -from google.cloud.datastream_v1.types.datastream_resources import GcsDestinationConfig -from google.cloud.datastream_v1.types.datastream_resources import GcsProfile -from google.cloud.datastream_v1.types.datastream_resources import JsonFileFormat -from google.cloud.datastream_v1.types.datastream_resources import MysqlColumn -from google.cloud.datastream_v1.types.datastream_resources import MysqlDatabase -from google.cloud.datastream_v1.types.datastream_resources import MysqlProfile -from google.cloud.datastream_v1.types.datastream_resources import MysqlRdbms -from google.cloud.datastream_v1.types.datastream_resources import MysqlSourceConfig -from google.cloud.datastream_v1.types.datastream_resources import MysqlSslConfig -from google.cloud.datastream_v1.types.datastream_resources import MysqlTable -from google.cloud.datastream_v1.types.datastream_resources import OracleColumn -from google.cloud.datastream_v1.types.datastream_resources import OracleProfile -from google.cloud.datastream_v1.types.datastream_resources import OracleRdbms -from google.cloud.datastream_v1.types.datastream_resources import OracleSchema -from google.cloud.datastream_v1.types.datastream_resources import OracleSourceConfig -from google.cloud.datastream_v1.types.datastream_resources import OracleTable -from google.cloud.datastream_v1.types.datastream_resources import PrivateConnection -from google.cloud.datastream_v1.types.datastream_resources import PrivateConnectivity -from google.cloud.datastream_v1.types.datastream_resources import Route -from google.cloud.datastream_v1.types.datastream_resources import SourceConfig -from google.cloud.datastream_v1.types.datastream_resources import SourceObjectIdentifier -from google.cloud.datastream_v1.types.datastream_resources import ( + GcsDestinationConfig, + GcsProfile, + JsonFileFormat, + MysqlColumn, + MysqlDatabase, + MysqlProfile, + MysqlRdbms, + MysqlSourceConfig, + MysqlSslConfig, + MysqlTable, + OracleColumn, + OracleProfile, + OracleRdbms, + OracleSchema, + OracleSourceConfig, + OracleTable, + PrivateConnection, + PrivateConnectivity, + Route, + SourceConfig, + SourceObjectIdentifier, StaticServiceIpConnectivity, + Stream, + StreamObject, + Validation, + ValidationMessage, + ValidationResult, + VpcPeeringConfig, ) -from google.cloud.datastream_v1.types.datastream_resources import Stream -from google.cloud.datastream_v1.types.datastream_resources import StreamObject -from google.cloud.datastream_v1.types.datastream_resources import Validation -from google.cloud.datastream_v1.types.datastream_resources import ValidationMessage -from google.cloud.datastream_v1.types.datastream_resources import ValidationResult -from google.cloud.datastream_v1.types.datastream_resources import VpcPeeringConfig __all__ = ( "DatastreamClient", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/__init__.py index be9f50e2dbcf..4f92d5792ba3 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/__init__.py @@ -14,78 +14,80 @@ # limitations under the License. # -from .services.datastream import DatastreamClient -from .services.datastream import DatastreamAsyncClient - -from .types.datastream import CreateConnectionProfileRequest -from .types.datastream import CreatePrivateConnectionRequest -from .types.datastream import CreateRouteRequest -from .types.datastream import CreateStreamRequest -from .types.datastream import DeleteConnectionProfileRequest -from .types.datastream import DeletePrivateConnectionRequest -from .types.datastream import DeleteRouteRequest -from .types.datastream import DeleteStreamRequest -from .types.datastream import DiscoverConnectionProfileRequest -from .types.datastream import DiscoverConnectionProfileResponse -from .types.datastream import FetchStaticIpsRequest -from .types.datastream import FetchStaticIpsResponse -from .types.datastream import GetConnectionProfileRequest -from .types.datastream import GetPrivateConnectionRequest -from .types.datastream import GetRouteRequest -from .types.datastream import GetStreamObjectRequest -from .types.datastream import GetStreamRequest -from .types.datastream import ListConnectionProfilesRequest -from .types.datastream import ListConnectionProfilesResponse -from .types.datastream import ListPrivateConnectionsRequest -from .types.datastream import ListPrivateConnectionsResponse -from .types.datastream import ListRoutesRequest -from .types.datastream import ListRoutesResponse -from .types.datastream import ListStreamObjectsRequest -from .types.datastream import ListStreamObjectsResponse -from .types.datastream import ListStreamsRequest -from .types.datastream import ListStreamsResponse -from .types.datastream import LookupStreamObjectRequest -from .types.datastream import OperationMetadata -from .types.datastream import StartBackfillJobRequest -from .types.datastream import StartBackfillJobResponse -from .types.datastream import StopBackfillJobRequest -from .types.datastream import StopBackfillJobResponse -from .types.datastream import UpdateConnectionProfileRequest -from .types.datastream import UpdateStreamRequest -from .types.datastream_resources import AvroFileFormat -from .types.datastream_resources import BackfillJob -from .types.datastream_resources import ConnectionProfile -from .types.datastream_resources import DestinationConfig -from .types.datastream_resources import Error -from .types.datastream_resources import ForwardSshTunnelConnectivity -from .types.datastream_resources import GcsDestinationConfig -from .types.datastream_resources import GcsProfile -from .types.datastream_resources import JsonFileFormat -from .types.datastream_resources import MysqlColumn -from .types.datastream_resources import MysqlDatabase -from .types.datastream_resources import MysqlProfile -from .types.datastream_resources import MysqlRdbms -from .types.datastream_resources import MysqlSourceConfig -from .types.datastream_resources import MysqlSslConfig -from .types.datastream_resources import MysqlTable -from .types.datastream_resources import OracleColumn -from .types.datastream_resources import OracleProfile -from .types.datastream_resources import OracleRdbms -from .types.datastream_resources import OracleSchema -from .types.datastream_resources import OracleSourceConfig -from .types.datastream_resources import OracleTable -from .types.datastream_resources import PrivateConnection -from .types.datastream_resources import PrivateConnectivity -from .types.datastream_resources import Route -from .types.datastream_resources import SourceConfig -from .types.datastream_resources import SourceObjectIdentifier -from .types.datastream_resources import StaticServiceIpConnectivity -from .types.datastream_resources import Stream -from .types.datastream_resources import StreamObject -from .types.datastream_resources import Validation -from .types.datastream_resources import ValidationMessage -from .types.datastream_resources import ValidationResult -from .types.datastream_resources import VpcPeeringConfig +from .services.datastream import DatastreamAsyncClient, DatastreamClient +from .types.datastream import ( + CreateConnectionProfileRequest, + CreatePrivateConnectionRequest, + CreateRouteRequest, + CreateStreamRequest, + DeleteConnectionProfileRequest, + DeletePrivateConnectionRequest, + DeleteRouteRequest, + DeleteStreamRequest, + DiscoverConnectionProfileRequest, + DiscoverConnectionProfileResponse, + FetchStaticIpsRequest, + FetchStaticIpsResponse, + GetConnectionProfileRequest, + GetPrivateConnectionRequest, + GetRouteRequest, + GetStreamObjectRequest, + GetStreamRequest, + ListConnectionProfilesRequest, + ListConnectionProfilesResponse, + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse, + ListRoutesRequest, + ListRoutesResponse, + ListStreamObjectsRequest, + ListStreamObjectsResponse, + ListStreamsRequest, + ListStreamsResponse, + LookupStreamObjectRequest, + OperationMetadata, + StartBackfillJobRequest, + StartBackfillJobResponse, + StopBackfillJobRequest, + StopBackfillJobResponse, + UpdateConnectionProfileRequest, + UpdateStreamRequest, +) +from .types.datastream_resources import ( + AvroFileFormat, + BackfillJob, + ConnectionProfile, + DestinationConfig, + Error, + ForwardSshTunnelConnectivity, + GcsDestinationConfig, + GcsProfile, + JsonFileFormat, + MysqlColumn, + MysqlDatabase, + MysqlProfile, + MysqlRdbms, + MysqlSourceConfig, + MysqlSslConfig, + MysqlTable, + OracleColumn, + OracleProfile, + OracleRdbms, + OracleSchema, + OracleSourceConfig, + OracleTable, + PrivateConnection, + PrivateConnectivity, + Route, + SourceConfig, + SourceObjectIdentifier, + StaticServiceIpConnectivity, + Stream, + StreamObject, + Validation, + ValidationMessage, + ValidationResult, + VpcPeeringConfig, +) __all__ = ( "DatastreamAsyncClient", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/__init__.py index 0e6c29fd31cc..2636cbc94694 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import DatastreamClient from .async_client import DatastreamAsyncClient +from .client import DatastreamClient __all__ = ( "DatastreamClient", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/async_client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/async_client.py index 8305f36796c0..525973474e54 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/async_client.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/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,15 +33,16 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1.services.datastream import pagers -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport + +from google.cloud.datastream_v1.services.datastream import pagers +from google.cloud.datastream_v1.types import datastream, datastream_resources + from .client import DatastreamClient +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport +from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport class DatastreamAsyncClient: diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/client.py index 851421db3166..4711c98ec675 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/client.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/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,13 +36,14 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1.services.datastream import pagers -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO + +from google.cloud.datastream_v1.services.datastream import pagers +from google.cloud.datastream_v1.types import datastream, datastream_resources + +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport from .transports.grpc import DatastreamGrpcTransport from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/pagers.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/pagers.py index 7617d90e2fb2..1a3f3e14c40b 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/pagers.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources +from google.cloud.datastream_v1.types import datastream, datastream_resources class ListConnectionProfilesPager: diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/__init__.py index 8684788f46e1..064e68286f30 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import DatastreamGrpcTransport from .grpc_asyncio import DatastreamGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[DatastreamTransport]] _transport_registry["grpc"] = DatastreamGrpcTransport diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py index 004e77824bf7..145b55c13360 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/base.py @@ -15,20 +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 gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore 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.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore +from google.cloud.datastream_v1.types import datastream, datastream_resources try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py index 80ea09e59625..5e850e00b6f3 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc.py @@ -13,22 +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 operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 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.longrunning import operations_pb2 # type: ignore import grpc # type: ignore -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport class DatastreamGrpcTransport(DatastreamTransport): diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py index 0e9c610aee15..0cf950c6332f 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py @@ -13,22 +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 operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport from .grpc import DatastreamGrpcTransport diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py index 27db13019532..d1136aad80ab 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.datastream_v1.types import datastream_resources from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.datastream_v1.types import datastream_resources __protobuf__ = proto.module( package="google.cloud.datastream.v1", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py b/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py index 756110b9e091..55e3eef222e4 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1/types/datastream_resources.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 duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.datastream.v1", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/__init__.py index e143d2e89c80..f668c282d35c 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/__init__.py @@ -14,72 +14,74 @@ # limitations under the License. # -from .services.datastream import DatastreamClient -from .services.datastream import DatastreamAsyncClient - -from .types.datastream import CreateConnectionProfileRequest -from .types.datastream import CreatePrivateConnectionRequest -from .types.datastream import CreateRouteRequest -from .types.datastream import CreateStreamRequest -from .types.datastream import DeleteConnectionProfileRequest -from .types.datastream import DeletePrivateConnectionRequest -from .types.datastream import DeleteRouteRequest -from .types.datastream import DeleteStreamRequest -from .types.datastream import DiscoverConnectionProfileRequest -from .types.datastream import DiscoverConnectionProfileResponse -from .types.datastream import FetchErrorsRequest -from .types.datastream import FetchErrorsResponse -from .types.datastream import FetchStaticIpsRequest -from .types.datastream import FetchStaticIpsResponse -from .types.datastream import GetConnectionProfileRequest -from .types.datastream import GetPrivateConnectionRequest -from .types.datastream import GetRouteRequest -from .types.datastream import GetStreamRequest -from .types.datastream import ListConnectionProfilesRequest -from .types.datastream import ListConnectionProfilesResponse -from .types.datastream import ListPrivateConnectionsRequest -from .types.datastream import ListPrivateConnectionsResponse -from .types.datastream import ListRoutesRequest -from .types.datastream import ListRoutesResponse -from .types.datastream import ListStreamsRequest -from .types.datastream import ListStreamsResponse -from .types.datastream import OperationMetadata -from .types.datastream import UpdateConnectionProfileRequest -from .types.datastream import UpdateStreamRequest -from .types.datastream_resources import AvroFileFormat -from .types.datastream_resources import ConnectionProfile -from .types.datastream_resources import DestinationConfig -from .types.datastream_resources import Error -from .types.datastream_resources import ForwardSshTunnelConnectivity -from .types.datastream_resources import GcsDestinationConfig -from .types.datastream_resources import GcsProfile -from .types.datastream_resources import JsonFileFormat -from .types.datastream_resources import MysqlColumn -from .types.datastream_resources import MysqlDatabase -from .types.datastream_resources import MysqlProfile -from .types.datastream_resources import MysqlRdbms -from .types.datastream_resources import MysqlSourceConfig -from .types.datastream_resources import MysqlSslConfig -from .types.datastream_resources import MysqlTable -from .types.datastream_resources import NoConnectivitySettings -from .types.datastream_resources import OracleColumn -from .types.datastream_resources import OracleProfile -from .types.datastream_resources import OracleRdbms -from .types.datastream_resources import OracleSchema -from .types.datastream_resources import OracleSourceConfig -from .types.datastream_resources import OracleTable -from .types.datastream_resources import PrivateConnection -from .types.datastream_resources import PrivateConnectivity -from .types.datastream_resources import Route -from .types.datastream_resources import SourceConfig -from .types.datastream_resources import StaticServiceIpConnectivity -from .types.datastream_resources import Stream -from .types.datastream_resources import Validation -from .types.datastream_resources import ValidationMessage -from .types.datastream_resources import ValidationResult -from .types.datastream_resources import VpcPeeringConfig -from .types.datastream_resources import GcsFileFormat -from .types.datastream_resources import SchemaFileFormat +from .services.datastream import DatastreamAsyncClient, DatastreamClient +from .types.datastream import ( + CreateConnectionProfileRequest, + CreatePrivateConnectionRequest, + CreateRouteRequest, + CreateStreamRequest, + DeleteConnectionProfileRequest, + DeletePrivateConnectionRequest, + DeleteRouteRequest, + DeleteStreamRequest, + DiscoverConnectionProfileRequest, + DiscoverConnectionProfileResponse, + FetchErrorsRequest, + FetchErrorsResponse, + FetchStaticIpsRequest, + FetchStaticIpsResponse, + GetConnectionProfileRequest, + GetPrivateConnectionRequest, + GetRouteRequest, + GetStreamRequest, + ListConnectionProfilesRequest, + ListConnectionProfilesResponse, + ListPrivateConnectionsRequest, + ListPrivateConnectionsResponse, + ListRoutesRequest, + ListRoutesResponse, + ListStreamsRequest, + ListStreamsResponse, + OperationMetadata, + UpdateConnectionProfileRequest, + UpdateStreamRequest, +) +from .types.datastream_resources import ( + AvroFileFormat, + ConnectionProfile, + DestinationConfig, + Error, + ForwardSshTunnelConnectivity, + GcsDestinationConfig, + GcsFileFormat, + GcsProfile, + JsonFileFormat, + MysqlColumn, + MysqlDatabase, + MysqlProfile, + MysqlRdbms, + MysqlSourceConfig, + MysqlSslConfig, + MysqlTable, + NoConnectivitySettings, + OracleColumn, + OracleProfile, + OracleRdbms, + OracleSchema, + OracleSourceConfig, + OracleTable, + PrivateConnection, + PrivateConnectivity, + Route, + SchemaFileFormat, + SourceConfig, + StaticServiceIpConnectivity, + Stream, + Validation, + ValidationMessage, + ValidationResult, + VpcPeeringConfig, +) __all__ = ( "DatastreamAsyncClient", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/__init__.py index 0e6c29fd31cc..2636cbc94694 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import DatastreamClient from .async_client import DatastreamAsyncClient +from .client import DatastreamClient __all__ = ( "DatastreamClient", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py index 4c445718793c..4ba071aa7491 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/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,15 +33,16 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1alpha1.services.datastream import pagers -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport + +from google.cloud.datastream_v1alpha1.services.datastream import pagers +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + from .client import DatastreamClient +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport +from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport class DatastreamAsyncClient: diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py index c78110e77f97..2ebf79efb7a2 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/client.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/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,13 +36,14 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.datastream_v1alpha1.services.datastream import pagers -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import DatastreamTransport, DEFAULT_CLIENT_INFO + +from google.cloud.datastream_v1alpha1.services.datastream import pagers +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + +from .transports.base import DEFAULT_CLIENT_INFO, DatastreamTransport from .transports.grpc import DatastreamGrpcTransport from .transports.grpc_asyncio import DatastreamGrpcAsyncIOTransport diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/pagers.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/pagers.py index 68b28f61a7a3..43816793e235 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/pagers.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources class ListConnectionProfilesPager: diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py index 8684788f46e1..064e68286f30 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import DatastreamGrpcTransport from .grpc_asyncio import DatastreamGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[DatastreamTransport]] _transport_registry["grpc"] = DatastreamGrpcTransport diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py index 2e98a48ef02c..6d77a67b1c4c 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py @@ -15,20 +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 gapic_v1, operations_v1 from google.api_core import retry as retries -from google.api_core import operations_v1 +import google.auth # type: ignore 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.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py index 4d09aa42c32b..cdc9ebd72c59 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py @@ -13,22 +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 operations_v1 -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers, operations_v1 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.longrunning import operations_pb2 # type: ignore import grpc # type: ignore -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport class DatastreamGrpcTransport(DatastreamTransport): diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py index d36b5b64487a..079bb6eed8a4 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py @@ -13,22 +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 operations_v1 +from google.api_core import gapic_v1, grpc_helpers_async, operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.longrunning import operations_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources -from google.longrunning import operations_pb2 # type: ignore -from .base import DatastreamTransport, DEFAULT_CLIENT_INFO +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources + +from .base import DEFAULT_CLIENT_INFO, DatastreamTransport from .grpc import DatastreamGrpcTransport diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/__init__.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/__init__.py index bcb6350d42be..c11abd66a297 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/__init__.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/__init__.py @@ -51,6 +51,7 @@ Error, ForwardSshTunnelConnectivity, GcsDestinationConfig, + GcsFileFormat, GcsProfile, JsonFileFormat, MysqlColumn, @@ -70,6 +71,7 @@ PrivateConnection, PrivateConnectivity, Route, + SchemaFileFormat, SourceConfig, StaticServiceIpConnectivity, Stream, @@ -77,8 +79,6 @@ ValidationMessage, ValidationResult, VpcPeeringConfig, - GcsFileFormat, - SchemaFileFormat, ) __all__ = ( diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py index 24348c742bc9..30dad6b55ebc 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.datastream_v1alpha1.types import datastream_resources __protobuf__ = proto.module( package="google.cloud.datastream.v1alpha1", diff --git a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py index 7e5d70bde34a..5d20a3ed3bc6 100644 --- a/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.py +++ b/packages/google-cloud-datastream/google/cloud/datastream_v1alpha1/types/datastream_resources.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 duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.datastream.v1alpha1", diff --git a/packages/google-cloud-datastream/noxfile.py b/packages/google-cloud-datastream/noxfile.py index 6ee5e8ab96d9..7c1742d2cc93 100644 --- a/packages/google-cloud-datastream/noxfile.py +++ b/packages/google-cloud-datastream/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-datastream/setup.py b/packages/google-cloud-datastream/setup.py index 7d33b0bad24c..9d2d0b33cd7a 100644 --- a/packages/google-cloud-datastream/setup.py +++ b/packages/google-cloud-datastream/setup.py @@ -19,7 +19,6 @@ import setuptools - name = "google-cloud-datastream" description = "Datastream client library" version = "1.0.0" diff --git a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py index a9ec6ea92174..969534cd2f39 100644 --- a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py +++ b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1/test_datastream.py @@ -13,40 +13,42 @@ # 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 ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -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 operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -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.datastream_v1.services.datastream import DatastreamAsyncClient -from google.cloud.datastream_v1.services.datastream import DatastreamClient -from google.cloud.datastream_v1.services.datastream import pagers -from google.cloud.datastream_v1.services.datastream import transports -from google.cloud.datastream_v1.types import datastream -from google.cloud.datastream_v1.types import datastream_resources from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_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.datastream_v1.services.datastream import ( + DatastreamAsyncClient, + DatastreamClient, + pagers, + transports, +) +from google.cloud.datastream_v1.types import datastream, datastream_resources def client_cert_source_callback(): diff --git a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py index 68679cd19163..00bde0dd6cf8 100644 --- a/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +++ b/packages/google-cloud-datastream/tests/unit/gapic/datastream_v1alpha1/test_datastream.py @@ -13,40 +13,42 @@ # 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 ( + future, + gapic_v1, + grpc_helpers, + grpc_helpers_async, + operation, + operations_v1, + path_template, +) from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import future -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 operation from google.api_core import operation_async # type: ignore -from google.api_core import operations_v1 -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.datastream_v1alpha1.services.datastream import DatastreamAsyncClient -from google.cloud.datastream_v1alpha1.services.datastream import DatastreamClient -from google.cloud.datastream_v1alpha1.services.datastream import pagers -from google.cloud.datastream_v1alpha1.services.datastream import transports -from google.cloud.datastream_v1alpha1.types import datastream -from google.cloud.datastream_v1alpha1.types import datastream_resources from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_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.datastream_v1alpha1.services.datastream import ( + DatastreamAsyncClient, + DatastreamClient, + pagers, + transports, +) +from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources def client_cert_source_callback():