From 969663e4d132ae1036593aebfc046a6e8c23c35f Mon Sep 17 00:00:00 2001 From: Jonatan Martens Date: Fri, 15 Oct 2021 19:13:50 +0300 Subject: [PATCH] Fix imports using isort --- examples/client.py | 7 ++++++- examples/worker.py | 8 +++++++- pyzeebe/channel/camunda_cloud_channel.py | 5 ++++- pyzeebe/grpc_internals/zeebe_adapter_base.py | 6 +++++- pyzeebe/grpc_internals/zeebe_job_adapter.py | 6 +++++- pyzeebe/worker/task_router.py | 7 ++++++- tests/unit/channel/camunda_cloud_channel_test.py | 5 ++++- .../unit/grpc_internals/zeebe_adapter_base_test.py | 6 +++++- .../unit/grpc_internals/zeebe_job_adapter_test.py | 14 +++++++++++--- 9 files changed, 53 insertions(+), 11 deletions(-) diff --git a/examples/client.py b/examples/client.py index 1e33b997..083a72b1 100644 --- a/examples/client.py +++ b/examples/client.py @@ -1,4 +1,9 @@ -from pyzeebe import ZeebeClient, create_camunda_cloud_channel, create_insecure_channel, create_secure_channel +from pyzeebe import ( + ZeebeClient, + create_camunda_cloud_channel, + create_insecure_channel, + create_secure_channel, +) # Create a zeebe client without credentials grpc_channel = create_insecure_channel(hostname="localhost", port=26500) diff --git a/examples/worker.py b/examples/worker.py index 978e84cc..8ab5edd0 100644 --- a/examples/worker.py +++ b/examples/worker.py @@ -1,7 +1,13 @@ import asyncio from typing import Dict -from pyzeebe import Job, ZeebeWorker, create_camunda_cloud_channel, create_insecure_channel, create_secure_channel +from pyzeebe import ( + Job, + ZeebeWorker, + create_camunda_cloud_channel, + create_insecure_channel, + create_secure_channel, +) from pyzeebe.errors import BusinessError diff --git a/pyzeebe/channel/camunda_cloud_channel.py b/pyzeebe/channel/camunda_cloud_channel.py index 68895cae..2d0ffaa0 100644 --- a/pyzeebe/channel/camunda_cloud_channel.py +++ b/pyzeebe/channel/camunda_cloud_channel.py @@ -6,7 +6,10 @@ from requests_oauthlib import OAuth2Session from pyzeebe.channel.channel_options import get_channel_options -from pyzeebe.errors import InvalidCamundaCloudCredentialsError, InvalidOAuthCredentialsError +from pyzeebe.errors import ( + InvalidCamundaCloudCredentialsError, + InvalidOAuthCredentialsError, +) def create_camunda_cloud_channel( diff --git a/pyzeebe/grpc_internals/zeebe_adapter_base.py b/pyzeebe/grpc_internals/zeebe_adapter_base.py index f4d8c6dd..d0bbdc18 100644 --- a/pyzeebe/grpc_internals/zeebe_adapter_base.py +++ b/pyzeebe/grpc_internals/zeebe_adapter_base.py @@ -5,7 +5,11 @@ import grpc from zeebe_grpc.gateway_pb2_grpc import GatewayStub -from pyzeebe.errors import ZeebeBackPressureError, ZeebeGatewayUnavailableError, ZeebeInternalError +from pyzeebe.errors import ( + ZeebeBackPressureError, + ZeebeGatewayUnavailableError, + ZeebeInternalError, +) logger = logging.getLogger(__name__) diff --git a/pyzeebe/grpc_internals/zeebe_job_adapter.py b/pyzeebe/grpc_internals/zeebe_job_adapter.py index 3810b9f0..fdfd828f 100644 --- a/pyzeebe/grpc_internals/zeebe_job_adapter.py +++ b/pyzeebe/grpc_internals/zeebe_job_adapter.py @@ -13,7 +13,11 @@ ThrowErrorResponse, ) -from pyzeebe.errors import ActivateJobsRequestInvalidError, JobAlreadyDeactivatedError, JobNotFoundError +from pyzeebe.errors import ( + ActivateJobsRequestInvalidError, + JobAlreadyDeactivatedError, + JobNotFoundError, +) from pyzeebe.grpc_internals.zeebe_adapter_base import ZeebeAdapterBase from pyzeebe.job.job import Job diff --git a/pyzeebe/worker/task_router.py b/pyzeebe/worker/task_router.py index 8341598b..326ed30a 100644 --- a/pyzeebe/worker/task_router.py +++ b/pyzeebe/worker/task_router.py @@ -1,7 +1,12 @@ import logging from typing import Callable, List, Optional, Tuple -from pyzeebe.errors import BusinessError, DuplicateTaskTypeError, NoVariableNameGivenError, TaskNotFoundError +from pyzeebe.errors import ( + BusinessError, + DuplicateTaskTypeError, + NoVariableNameGivenError, + TaskNotFoundError, +) from pyzeebe.function_tools import parameter_tools from pyzeebe.job.job import Job from pyzeebe.task import task_builder diff --git a/tests/unit/channel/camunda_cloud_channel_test.py b/tests/unit/channel/camunda_cloud_channel_test.py index dafa7de3..46e40445 100644 --- a/tests/unit/channel/camunda_cloud_channel_test.py +++ b/tests/unit/channel/camunda_cloud_channel_test.py @@ -7,7 +7,10 @@ from requests import HTTPError from pyzeebe import create_camunda_cloud_channel -from pyzeebe.errors import InvalidCamundaCloudCredentialsError, InvalidOAuthCredentialsError +from pyzeebe.errors import ( + InvalidCamundaCloudCredentialsError, + InvalidOAuthCredentialsError, +) @pytest.fixture diff --git a/tests/unit/grpc_internals/zeebe_adapter_base_test.py b/tests/unit/grpc_internals/zeebe_adapter_base_test.py index 00e0bf95..b7cdc018 100644 --- a/tests/unit/grpc_internals/zeebe_adapter_base_test.py +++ b/tests/unit/grpc_internals/zeebe_adapter_base_test.py @@ -2,7 +2,11 @@ import pytest from mock import AsyncMock -from pyzeebe.errors import ZeebeBackPressureError, ZeebeGatewayUnavailableError, ZeebeInternalError +from pyzeebe.errors import ( + ZeebeBackPressureError, + ZeebeGatewayUnavailableError, + ZeebeInternalError, +) from pyzeebe.grpc_internals.zeebe_adapter_base import ZeebeAdapterBase diff --git a/tests/unit/grpc_internals/zeebe_job_adapter_test.py b/tests/unit/grpc_internals/zeebe_job_adapter_test.py index 255b1b27..8893caa4 100644 --- a/tests/unit/grpc_internals/zeebe_job_adapter_test.py +++ b/tests/unit/grpc_internals/zeebe_job_adapter_test.py @@ -2,9 +2,17 @@ from uuid import uuid4 import pytest -from zeebe_grpc.gateway_pb2 import CompleteJobResponse, FailJobResponse, ThrowErrorResponse - -from pyzeebe.errors import ActivateJobsRequestInvalidError, JobAlreadyDeactivatedError, JobNotFoundError +from zeebe_grpc.gateway_pb2 import ( + CompleteJobResponse, + FailJobResponse, + ThrowErrorResponse, +) + +from pyzeebe.errors import ( + ActivateJobsRequestInvalidError, + JobAlreadyDeactivatedError, + JobNotFoundError, +) from pyzeebe.grpc_internals.zeebe_job_adapter import ZeebeJobAdapter from pyzeebe.job.job import Job from pyzeebe.task.task import Task