Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

chore(python): add nox session to sort python imports #175

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
53 changes: 28 additions & 25 deletions google/cloud/functions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,38 @@
# limitations under the License.
#

from google.cloud.functions_v1.services.cloud_functions_service.async_client import (
CloudFunctionsServiceAsyncClient,
)
from google.cloud.functions_v1.services.cloud_functions_service.client import (
CloudFunctionsServiceClient,
)
from google.cloud.functions_v1.services.cloud_functions_service.async_client import (
CloudFunctionsServiceAsyncClient,
from google.cloud.functions_v1.types.functions import (
CallFunctionRequest,
CallFunctionResponse,
CloudFunction,
CloudFunctionStatus,
CreateFunctionRequest,
DeleteFunctionRequest,
EventTrigger,
FailurePolicy,
GenerateDownloadUrlRequest,
GenerateDownloadUrlResponse,
GenerateUploadUrlRequest,
GenerateUploadUrlResponse,
GetFunctionRequest,
HttpsTrigger,
ListFunctionsRequest,
ListFunctionsResponse,
SecretEnvVar,
SecretVolume,
SourceRepository,
UpdateFunctionRequest,
)
from google.cloud.functions_v1.types.operations import (
OperationMetadataV1,
OperationType,
)

from google.cloud.functions_v1.types.functions import CallFunctionRequest
from google.cloud.functions_v1.types.functions import CallFunctionResponse
from google.cloud.functions_v1.types.functions import CloudFunction
from google.cloud.functions_v1.types.functions import CreateFunctionRequest
from google.cloud.functions_v1.types.functions import DeleteFunctionRequest
from google.cloud.functions_v1.types.functions import EventTrigger
from google.cloud.functions_v1.types.functions import FailurePolicy
from google.cloud.functions_v1.types.functions import GenerateDownloadUrlRequest
from google.cloud.functions_v1.types.functions import GenerateDownloadUrlResponse
from google.cloud.functions_v1.types.functions import GenerateUploadUrlRequest
from google.cloud.functions_v1.types.functions import GenerateUploadUrlResponse
from google.cloud.functions_v1.types.functions import GetFunctionRequest
from google.cloud.functions_v1.types.functions import HttpsTrigger
from google.cloud.functions_v1.types.functions import ListFunctionsRequest
from google.cloud.functions_v1.types.functions import ListFunctionsResponse
from google.cloud.functions_v1.types.functions import SecretEnvVar
from google.cloud.functions_v1.types.functions import SecretVolume
from google.cloud.functions_v1.types.functions import SourceRepository
from google.cloud.functions_v1.types.functions import UpdateFunctionRequest
from google.cloud.functions_v1.types.functions import CloudFunctionStatus
from google.cloud.functions_v1.types.operations import OperationMetadataV1
from google.cloud.functions_v1.types.operations import OperationType

__all__ = (
"CloudFunctionsServiceClient",
Expand Down
52 changes: 27 additions & 25 deletions google/cloud/functions_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,33 @@
# limitations under the License.
#

from .services.cloud_functions_service import CloudFunctionsServiceClient
from .services.cloud_functions_service import CloudFunctionsServiceAsyncClient

from .types.functions import CallFunctionRequest
from .types.functions import CallFunctionResponse
from .types.functions import CloudFunction
from .types.functions import CreateFunctionRequest
from .types.functions import DeleteFunctionRequest
from .types.functions import EventTrigger
from .types.functions import FailurePolicy
from .types.functions import GenerateDownloadUrlRequest
from .types.functions import GenerateDownloadUrlResponse
from .types.functions import GenerateUploadUrlRequest
from .types.functions import GenerateUploadUrlResponse
from .types.functions import GetFunctionRequest
from .types.functions import HttpsTrigger
from .types.functions import ListFunctionsRequest
from .types.functions import ListFunctionsResponse
from .types.functions import SecretEnvVar
from .types.functions import SecretVolume
from .types.functions import SourceRepository
from .types.functions import UpdateFunctionRequest
from .types.functions import CloudFunctionStatus
from .types.operations import OperationMetadataV1
from .types.operations import OperationType
from .services.cloud_functions_service import (
CloudFunctionsServiceAsyncClient,
CloudFunctionsServiceClient,
)
from .types.functions import (
CallFunctionRequest,
CallFunctionResponse,
CloudFunction,
CloudFunctionStatus,
CreateFunctionRequest,
DeleteFunctionRequest,
EventTrigger,
FailurePolicy,
GenerateDownloadUrlRequest,
GenerateDownloadUrlResponse,
GenerateUploadUrlRequest,
GenerateUploadUrlResponse,
GetFunctionRequest,
HttpsTrigger,
ListFunctionsRequest,
ListFunctionsResponse,
SecretEnvVar,
SecretVolume,
SourceRepository,
UpdateFunctionRequest,
)
from .types.operations import OperationMetadataV1, OperationType

__all__ = (
"CloudFunctionsServiceAsyncClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .client import CloudFunctionsServiceClient
from .async_client import CloudFunctionsServiceAsyncClient
from .client import CloudFunctionsServiceClient

__all__ = (
"CloudFunctionsServiceClient",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -33,17 +33,18 @@

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.functions_v1.services.cloud_functions_service import pagers
from google.cloud.functions_v1.types import functions
from google.cloud.functions_v1.types import operations
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from .transports.base import CloudFunctionsServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import CloudFunctionsServiceGrpcAsyncIOTransport

from google.cloud.functions_v1.services.cloud_functions_service import pagers
from google.cloud.functions_v1.types import functions, operations

from .client import CloudFunctionsServiceClient
from .transports.base import DEFAULT_CLIENT_INFO, CloudFunctionsServiceTransport
from .transports.grpc_asyncio import CloudFunctionsServiceGrpcAsyncIOTransport


class CloudFunctionsServiceAsyncClient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -36,15 +36,16 @@

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.functions_v1.services.cloud_functions_service import pagers
from google.cloud.functions_v1.types import functions
from google.cloud.functions_v1.types import operations
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from .transports.base import CloudFunctionsServiceTransport, DEFAULT_CLIENT_INFO

from google.cloud.functions_v1.services.cloud_functions_service import pagers
from google.cloud.functions_v1.types import functions, operations

from .transports.base import DEFAULT_CLIENT_INFO, CloudFunctionsServiceTransport
from .transports.grpc import CloudFunctionsServiceGrpcTransport
from .transports.grpc_asyncio import CloudFunctionsServiceGrpcAsyncIOTransport

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
AsyncIterator,
Awaitable,
Callable,
Iterator,
Optional,
Sequence,
Tuple,
Optional,
Iterator,
)

from google.cloud.functions_v1.types import functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from .grpc import CloudFunctionsServiceGrpcTransport
from .grpc_asyncio import CloudFunctionsServiceGrpcAsyncIOTransport


# Compile a registry of transports.
_transport_registry = (
OrderedDict()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@
#
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.oauth2 import service_account # type: ignore

from google.cloud.functions_v1.types import functions
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.longrunning import operations_pb2 # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.functions_v1.types import functions

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,21 @@
# 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

import grpc # type: ignore

from google.cloud.functions_v1.types import functions
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.longrunning import operations_pb2 # type: ignore
from .base import CloudFunctionsServiceTransport, DEFAULT_CLIENT_INFO
import grpc # type: ignore

from google.cloud.functions_v1.types import functions

from .base import DEFAULT_CLIENT_INFO, CloudFunctionsServiceTransport


class CloudFunctionsServiceGrpcTransport(CloudFunctionsServiceTransport):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,21 @@
# 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.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.longrunning import operations_pb2 # type: ignore
import grpc # type: ignore
from grpc.experimental import aio # type: ignore

from google.cloud.functions_v1.types import functions
from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.longrunning import operations_pb2 # type: ignore
from .base import CloudFunctionsServiceTransport, DEFAULT_CLIENT_INFO

from .base import DEFAULT_CLIENT_INFO, CloudFunctionsServiceTransport
from .grpc import CloudFunctionsServiceGrpcTransport


Expand Down
7 changes: 2 additions & 5 deletions google/cloud/functions_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
CallFunctionRequest,
CallFunctionResponse,
CloudFunction,
CloudFunctionStatus,
CreateFunctionRequest,
DeleteFunctionRequest,
EventTrigger,
Expand All @@ -33,12 +34,8 @@
SecretVolume,
SourceRepository,
UpdateFunctionRequest,
CloudFunctionStatus,
)
from .operations import (
OperationMetadataV1,
OperationType,
)
from .operations import OperationMetadataV1, OperationType

__all__ = (
"CallFunctionRequest",
Expand Down
4 changes: 1 addition & 3 deletions google/cloud/functions_v1/types/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
# 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 field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

import proto # type: ignore

__protobuf__ = proto.module(
package="google.cloud.functions.v1",
Expand Down
4 changes: 1 addition & 3 deletions google/cloud/functions_v1/types/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 any_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

import proto # type: ignore

__protobuf__ = proto.module(
package="google.cloud.functions.v1",
Expand Down
Loading