Skip to content

Commit

Permalink
Update isort to support black
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 19, 2024
1 parent 553a46f commit 9f4fece
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 18 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ build-backend = "setuptools.build_meta"

[tool.isort]
line_length = 119
profile = "black"

[tool.black]
line-length = 119
target-version = ['py310']
target-version = ["py310"]
12 changes: 9 additions & 3 deletions reportportal_client/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@

"""Common package for Asynchronous I/O clients and utilities."""

from reportportal_client.aio.client import (DEFAULT_SHUTDOWN_TIMEOUT, DEFAULT_TASK_TIMEOUT,
DEFAULT_TASK_TRIGGER_INTERVAL, DEFAULT_TASK_TRIGGER_NUM, AsyncRPClient,
BatchedRPClient, ThreadedRPClient)
from reportportal_client.aio.client import (
DEFAULT_SHUTDOWN_TIMEOUT,
DEFAULT_TASK_TIMEOUT,
DEFAULT_TASK_TRIGGER_INTERVAL,
DEFAULT_TASK_TRIGGER_NUM,
AsyncRPClient,
BatchedRPClient,
ThreadedRPClient,
)
from reportportal_client.aio.tasks import BlockingOperationError, Task

__all__ = [
Expand Down
40 changes: 32 additions & 8 deletions reportportal_client/aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,52 @@

# noinspection PyProtectedMember
from reportportal_client._internal.aio.http import RetryingClientSession

# noinspection PyProtectedMember
from reportportal_client._internal.aio.tasks import (DEFAULT_TASK_TRIGGER_INTERVAL, DEFAULT_TASK_TRIGGER_NUM,
BackgroundTaskList, BatchedTaskFactory, ThreadedTaskFactory,
TriggerTaskBatcher)
from reportportal_client._internal.aio.tasks import (
DEFAULT_TASK_TRIGGER_INTERVAL,
DEFAULT_TASK_TRIGGER_NUM,
BackgroundTaskList,
BatchedTaskFactory,
ThreadedTaskFactory,
TriggerTaskBatcher,
)

# noinspection PyProtectedMember
from reportportal_client._internal.local import set_current

# noinspection PyProtectedMember
from reportportal_client._internal.logs.batcher import LogBatcher

# noinspection PyProtectedMember
from reportportal_client._internal.services.statistics import async_send_event

# noinspection PyProtectedMember
from reportportal_client._internal.static.abstract import AbstractBaseClass, abstractmethod

# noinspection PyProtectedMember
from reportportal_client._internal.static.defines import NOT_FOUND, NOT_SET
from reportportal_client.aio.tasks import Task
from reportportal_client.client import RP, OutputType
from reportportal_client.core.rp_issues import Issue
from reportportal_client.core.rp_requests import (AsyncHttpRequest, AsyncItemFinishRequest, AsyncItemStartRequest,
AsyncRPLogBatch, AsyncRPRequestLog, LaunchFinishRequest,
LaunchStartRequest, RPFile)
from reportportal_client.helpers import (LifoQueue, agent_name_version, await_if_necessary, root_uri_join, uri_join,
verify_value_length)
from reportportal_client.core.rp_requests import (
AsyncHttpRequest,
AsyncItemFinishRequest,
AsyncItemStartRequest,
AsyncRPLogBatch,
AsyncRPRequestLog,
LaunchFinishRequest,
LaunchStartRequest,
RPFile,
)
from reportportal_client.helpers import (
LifoQueue,
agent_name_version,
await_if_necessary,
root_uri_join,
uri_join,
verify_value_length,
)
from reportportal_client.logs import MAX_LOG_BATCH_PAYLOAD_SIZE
from reportportal_client.steps import StepReporter

Expand Down
17 changes: 14 additions & 3 deletions reportportal_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,29 @@

# noinspection PyProtectedMember
from reportportal_client._internal.local import set_current

# noinspection PyProtectedMember
from reportportal_client._internal.logs.batcher import LogBatcher

# noinspection PyProtectedMember
from reportportal_client._internal.services.statistics import send_event

# noinspection PyProtectedMember
from reportportal_client._internal.static.abstract import AbstractBaseClass

# noinspection PyProtectedMember
from reportportal_client._internal.static.defines import NOT_FOUND
from reportportal_client.core.rp_issues import Issue
from reportportal_client.core.rp_requests import (HttpRequest, ItemFinishRequest, ItemStartRequest,
LaunchFinishRequest, LaunchStartRequest, RPFile, RPLogBatch,
RPRequestLog)
from reportportal_client.core.rp_requests import (
HttpRequest,
ItemFinishRequest,
ItemStartRequest,
LaunchFinishRequest,
LaunchStartRequest,
RPFile,
RPLogBatch,
RPRequestLog,
)
from reportportal_client.helpers import LifoQueue, agent_name_version, uri_join, verify_value_length
from reportportal_client.logs import MAX_LOG_BATCH_PAYLOAD_SIZE
from reportportal_client.steps import StepReporter
Expand Down
2 changes: 2 additions & 0 deletions reportportal_client/core/rp_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
import aiohttp

from reportportal_client import helpers

# noinspection PyProtectedMember
from reportportal_client._internal.static.abstract import AbstractBaseClass, abstractmethod

# noinspection PyProtectedMember
from reportportal_client._internal.static.defines import DEFAULT_PRIORITY, LOW_PRIORITY, RP_LOG_LEVELS, Priority
from reportportal_client.core.rp_file import RPFile
Expand Down
1 change: 1 addition & 0 deletions reportportal_client/logs/log_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from threading import Lock

from reportportal_client import helpers

# noinspection PyProtectedMember
from reportportal_client._internal.static.defines import NOT_FOUND
from reportportal_client.core.rp_requests import HttpRequest, RPFile, RPLogBatch, RPRequestLog
Expand Down
2 changes: 2 additions & 0 deletions reportportal_client/steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ def test_my_nested_step():
from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union

import reportportal_client as rp

# noinspection PyProtectedMember
from reportportal_client._internal.aio.tasks import Task

# noinspection PyProtectedMember
from reportportal_client._internal.local import current
from reportportal_client.helpers import get_function_params, timestamp
Expand Down
1 change: 1 addition & 0 deletions tests/_internal/aio/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from unittest import mock

import aiohttp

# noinspection PyPackageRequirements
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/_internal/logs/test_log_batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os

from reportportal_client import helpers

# noinspection PyProtectedMember
from reportportal_client._internal.logs.batcher import LogBatcher
from reportportal_client.core.rp_file import RPFile
Expand Down
1 change: 1 addition & 0 deletions tests/_internal/services/test_client_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# noinspection PyProtectedMember
from reportportal_client._internal.services.client_id import get_client_id

# noinspection PyProtectedMember
from reportportal_client._internal.services.constants import RP_PROPERTIES_FILE_PATH

Expand Down
1 change: 1 addition & 0 deletions tests/_internal/services/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

# noinspection PyProtectedMember
from reportportal_client._internal.services.constants import CLIENT_INFO, ENDPOINT

# noinspection PyProtectedMember
from reportportal_client._internal.services.statistics import async_send_event, send_event

Expand Down
3 changes: 3 additions & 0 deletions tests/aio/test_aio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
from unittest import mock

import aiohttp

# noinspection PyPackageRequirements
import pytest
from aiohttp import ServerConnectionError

from reportportal_client import OutputType

# noinspection PyProtectedMember
from reportportal_client._internal.aio.http import DEFAULT_RETRY_NUMBER, RetryingClientSession

# noinspection PyProtectedMember
from reportportal_client._internal.static.defines import NOT_SET
from reportportal_client.aio.client import Client
Expand Down
1 change: 1 addition & 0 deletions tests/logs/test_rp_log_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License
import re

# noinspection PyUnresolvedReferences
from unittest import mock

Expand Down
1 change: 1 addition & 0 deletions tests/steps/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from unittest import mock

from reportportal_client import step

# noinspection PyProtectedMember
from reportportal_client._internal.local import set_current

Expand Down
15 changes: 12 additions & 3 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@
# noinspection PyPackageRequirements
import pytest

from reportportal_client.helpers import (ATTRIBUTE_LENGTH_LIMIT, TRUNCATE_REPLACEMENT, gen_attributes,
get_launch_sys_attrs, guess_content_type_from_bytes, is_binary, match_pattern,
to_bool, translate_glob_to_regex, verify_value_length)
from reportportal_client.helpers import (
ATTRIBUTE_LENGTH_LIMIT,
TRUNCATE_REPLACEMENT,
gen_attributes,
get_launch_sys_attrs,
guess_content_type_from_bytes,
is_binary,
match_pattern,
to_bool,
translate_glob_to_regex,
verify_value_length,
)


def test_gen_attributes():
Expand Down

0 comments on commit 9f4fece

Please sign in to comment.