From 3250524504127dca88f1ff394b6b5f0c1bf70a42 Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Tue, 20 Oct 2026 09:05:52 +0000 Subject: [PATCH 01/35] Changelog update --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6dcdbf..b79f92b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] + +## [5.7.11] ### Added - Official `Python 3.15` support, by @HardNorth ### Changed From 9bd7de4fde960b0933467054cb0a20fac327bceb Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Tue, 20 Oct 2026 09:05:53 +0000 Subject: [PATCH 02/35] Version update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e64fbaf..1c6ecc9 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup -__version__ = "5.7.11" +__version__ = "5.7.12" TYPE_STUBS = ["*.pyi"] From 72de9dbf1e893ee5c7e7f3937e4dc9cb91981225 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:02:27 +0300 Subject: [PATCH 03/35] Update certify --- CHANGELOG.md | 2 ++ requirements.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b79f92b..9a1de2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Changed +- `certify` version range updated to mitigate a compromised certificate issue, by @HardNorth ## [5.7.11] ### Added diff --git a/requirements.txt b/requirements.txt index b626b36..7dbcaf8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ typing-extensions>=4.13.2, <=4.16.0 requests>=2.32.5, <=2.34.2 aiohttp>=3.13.4, <=3.14.5 -certifi>=2026.2.25, <=2026.10.19 +certifi>=2026.10.19, <=2026.10.23 From 75464336c92be725bcd80b784e16f849b3964cfd Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:26:37 +0300 Subject: [PATCH 04/35] Fix mypy --- reportportal_client/aio/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reportportal_client/aio/util.py b/reportportal_client/aio/util.py index 82d99a7..9806c7f 100644 --- a/reportportal_client/aio/util.py +++ b/reportportal_client/aio/util.py @@ -33,4 +33,6 @@ async def await_if_necessary(obj: Union[_T, Task[_T], Coroutine[_T, None, None]] return await obj elif asyncio.iscoroutinefunction(obj): return await obj() - return obj + else: + return obj + return None From fc7b2ef43881725c290c416f5e5c8a4e0ae67330 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:34:04 +0300 Subject: [PATCH 05/35] requirements-dev.txt update --- requirements-dev.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c385c8a..bd39156 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,11 @@ -pytest -pytest-cov -pytest-asyncio -black -isort -types-requests +# Linters +black==26.10.1 +isort==7.0.0 +flake8==7.3.0 mypy==1.19.1 + +pytest==9.0.3 +pytest-cov==7.1.0 +pytest-asyncio==1.4.0 +types-requests==2.32.4.20260324 types-simplejson==3.20.0.20250822 From 66d84ca1f8c6508c3819e9a08a0cfe0831eedb9d Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:34:14 +0300 Subject: [PATCH 06/35] Update hooks versions --- .pre-commit-config.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41100f4..0bc9f28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ default_language_version: python: python3.10 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: '3e8a8703264a2f4a69428a0aa4dcb512790b2c8c' hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -14,20 +14,31 @@ repos: rev: 6.3.0 hooks: - id: pydocstyle + language: system exclude: | (?x)^( tests/.* ) - repo: https://github.com/psf/black - rev: 24.10.0 + rev: '258e7dbf348bc23cb70b8cdf693481c04634ebcc' hooks: - id: black + language: system args: [ '--check', './reportportal_client', './tests' ] - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: '0a09c783808cfe77bb3269250f663ff733d23302' hooks: - id: isort + language: system - repo: https://github.com/pycqa/flake8 - rev: 7.1.1 + rev: 'c48217e1fc006c2dddd14df54e83b67da15de5cd' hooks: - id: flake8 + language: system + - repo: https://github.com/pre-commit/mirrors-mypy + rev: 'a66e98df7b4aeeb3724184b332785976d062b92e' + hooks: + - id: mypy + language: system + args: [ "--ignore-missing-imports" ] + exclude: 'tests/' From 67cba3d08350b7e935f2a808e02ee4733c2eede8 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:41:15 +0300 Subject: [PATCH 07/35] Update dependencies --- requirements-dev-lint.txt | 5 +++++ requirements-dev.txt | 6 ------ tox.ini | 6 +++++- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 requirements-dev-lint.txt diff --git a/requirements-dev-lint.txt b/requirements-dev-lint.txt new file mode 100644 index 0000000..3a2b319 --- /dev/null +++ b/requirements-dev-lint.txt @@ -0,0 +1,5 @@ +black==26.10.1 +isort==7.0.0 +flake8==7.3.0 +mypy==1.19.1 +pre-commit==4.5.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index bd39156..efe9a72 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,3 @@ -# Linters -black==26.10.1 -isort==7.0.0 -flake8==7.3.0 -mypy==1.19.1 - pytest==9.0.3 pytest-cov==7.1.0 pytest-asyncio==1.4.0 diff --git a/tox.ini b/tox.ini index 465854c..8518999 100644 --- a/tox.ini +++ b/tox.ini @@ -21,8 +21,12 @@ setenv = commands = pytest --cov=reportportal_client --cov-report=xml tests/ -s -vv [testenv:pep] +deps = + -rrequirements.txt + -rrequirements-dev.txt + -rrequirements-dev-lint.txt + skip_install = True -deps = pre-commit>=1.19.0 commands = pre-commit run --all-files --show-diff-on-failure [gh-actions] From 267c24b5e6e50a3749f471f97ffc26e46161eb18 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:48:02 +0300 Subject: [PATCH 08/35] Update dependencies --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index efe9a72..68cb0fd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -pytest==9.0.3 +pytest pytest-cov==7.1.0 pytest-asyncio==1.4.0 types-requests==2.32.4.20260324 From bc16e5457e76f8bc0b6d12b010328ac623c7901a Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:48:23 +0300 Subject: [PATCH 09/35] Update dependencies --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 68cb0fd..0ec029b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ pytest -pytest-cov==7.1.0 -pytest-asyncio==1.4.0 +pytest-cov +pytest-asyncio types-requests==2.32.4.20260324 types-simplejson==3.20.0.20250822 From d229e3137864d3a3148a1ca6b08e7bdffdf9f7bd Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 11:50:21 +0300 Subject: [PATCH 10/35] Update dependencies --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0ec029b..9129bd0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ pytest pytest-cov pytest-asyncio -types-requests==2.32.4.20260324 +types-requests types-simplejson==3.20.0.20250822 From 97e21e4eb3e94fc5b6cdab724153a47d705ed878 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:02:49 +0300 Subject: [PATCH 11/35] Update dependencies --- .pre-commit-config.yaml | 2 +- requirements-dev-lint.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0bc9f28..9955d92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/PyCQA/pydocstyle - rev: 6.3.0 + rev: '07f6707e2c5612960347f7c00125620457f490a7' hooks: - id: pydocstyle language: system diff --git a/requirements-dev-lint.txt b/requirements-dev-lint.txt index 3a2b319..78c0336 100644 --- a/requirements-dev-lint.txt +++ b/requirements-dev-lint.txt @@ -1,5 +1,6 @@ black==26.10.1 isort==7.0.0 flake8==7.3.0 +pydocstyle==6.3.0 mypy==1.19.1 pre-commit==4.5.0 From 97487aa2d8b0a9f03ebe5400667c1225aae77e35 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:08:11 +0300 Subject: [PATCH 12/35] Fix black --- reportportal_client/_internal/static/defines.py | 1 + reportportal_client/helpers/common_helpers.py | 10 ++-------- reportportal_client/steps/__init__.py | 1 + tests/__init__.py | 1 + tests/helpers/test_helpers.py | 1 + 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/reportportal_client/_internal/static/defines.py b/reportportal_client/_internal/static/defines.py index 9f29902..325dd05 100644 --- a/reportportal_client/_internal/static/defines.py +++ b/reportportal_client/_internal/static/defines.py @@ -12,6 +12,7 @@ # limitations under the License """This module provides RP client static objects and variables.""" + from enum import Enum, IntEnum from reportportal_client.helpers import ATTRIBUTE_LENGTH_LIMIT as ATTRIBUTE_LIMIT diff --git a/reportportal_client/helpers/common_helpers.py b/reportportal_client/helpers/common_helpers.py index e5ae0a9..196f867 100644 --- a/reportportal_client/helpers/common_helpers.py +++ b/reportportal_client/helpers/common_helpers.py @@ -327,22 +327,16 @@ def get_function_params(func: Callable, args: tuple, kwargs: dict[str, Any]) -> TYPICAL_MULTIPART_BOUNDARY: str = "--972dbca3abacfd01fb4aea0571532b52" -TYPICAL_JSON_PART_HEADER: str = ( - TYPICAL_MULTIPART_BOUNDARY - + """\r +TYPICAL_JSON_PART_HEADER: str = TYPICAL_MULTIPART_BOUNDARY + """\r Content-Disposition: form-data; name="json_request_part"\r Content-Type: application/json\r \r """ -) -TYPICAL_FILE_PART_HEADER: str = ( - TYPICAL_MULTIPART_BOUNDARY - + """\r +TYPICAL_FILE_PART_HEADER: str = TYPICAL_MULTIPART_BOUNDARY + """\r Content-Disposition: form-data; name="file"; filename="{0}"\r Content-Type: {1}\r \r """ -) TYPICAL_JSON_PART_HEADER_LENGTH: int = len(TYPICAL_JSON_PART_HEADER) TYPICAL_MULTIPART_FOOTER: str = "\r\n" + TYPICAL_MULTIPART_BOUNDARY + "--" TYPICAL_MULTIPART_FOOTER_LENGTH: int = len(TYPICAL_MULTIPART_FOOTER) diff --git a/reportportal_client/steps/__init__.py b/reportportal_client/steps/__init__.py index 0e73bab..38960ad 100644 --- a/reportportal_client/steps/__init__.py +++ b/reportportal_client/steps/__init__.py @@ -42,6 +42,7 @@ def test_my_nested_step(): pass """ + from datetime import datetime, timezone from functools import wraps from typing import Any, Callable, Optional, TypeVar, Union diff --git a/tests/__init__.py b/tests/__init__.py index 758c534..b4d8505 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -12,4 +12,5 @@ # limitations under the License """Package which contains all ReportPortal client tests.""" + # This file is here because otherwise code coverage is not working. But pytest does not require package files. diff --git a/tests/helpers/test_helpers.py b/tests/helpers/test_helpers.py index b898389..f41d180 100644 --- a/tests/helpers/test_helpers.py +++ b/tests/helpers/test_helpers.py @@ -12,6 +12,7 @@ # limitations under the License """This script contains unit tests for the helpers script.""" + from typing import Optional from unittest import mock From e0ef83e2709f5126428d5bdd317bf18e8a22a419 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:17:54 +0300 Subject: [PATCH 13/35] Fix mypy --- .../_internal/local/__init__.py | 7 +++++-- .../_internal/local/__init__.pyi | 19 ------------------- 2 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 reportportal_client/_internal/local/__init__.pyi diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index da4dabb..cc5ed2f 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -14,18 +14,21 @@ """ReportPortal client context storing and retrieving module.""" from threading import local +from typing import Optional + +from reportportal_client import RP __INSTANCES = local() -def current(): +def current() -> Optional[RP]: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client): +def set_current(client: Optional[RP]) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls diff --git a/reportportal_client/_internal/local/__init__.pyi b/reportportal_client/_internal/local/__init__.pyi deleted file mode 100644 index ffde91d..0000000 --- a/reportportal_client/_internal/local/__init__.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2022 EPAM Systems -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License - -from typing import Optional - -from reportportal_client import RP - -def current() -> Optional[RP]: ... -def set_current(client: Optional[RP]) -> None: ... From 5c52c82626461e43b9f58e8f63a857a636dff007 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:24:57 +0300 Subject: [PATCH 14/35] A try to fix imports --- reportportal_client/_internal/local/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index cc5ed2f..66fd452 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -16,19 +16,19 @@ from threading import local from typing import Optional -from reportportal_client import RP +from reportportal_client.client import RP __INSTANCES = local() -def current() -> Optional[RP]: +def current() -> Optional['RP']: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional[RP]) -> None: +def set_current(client: Optional['RP']) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls From 02352b026023586fe5274a0d36d200ee24aa33e8 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:25:14 +0300 Subject: [PATCH 15/35] A try to fix imports --- reportportal_client/_internal/local/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index 66fd452..84cca1c 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -21,14 +21,14 @@ __INSTANCES = local() -def current() -> Optional['RP']: +def current() -> Optional[RP]: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional['RP']) -> None: +def set_current(client: Optional[RP]) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls From e818df6af0f42af40fbd050ac2ccda8e31e6985f Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:30:32 +0300 Subject: [PATCH 16/35] A try to fix imports --- reportportal_client/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reportportal_client/client.py b/reportportal_client/client.py index 58ffa23..fa79f76 100644 --- a/reportportal_client/client.py +++ b/reportportal_client/client.py @@ -29,10 +29,10 @@ from requests.adapters import DEFAULT_RETRIES, HTTPAdapter, Retry # noinspection PyProtectedMember -from reportportal_client._internal.http import ClientSession +import reportportal_client._internal.local # noinspection PyProtectedMember -from reportportal_client._internal.local import set_current +from reportportal_client._internal.http import ClientSession # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -576,7 +576,8 @@ def __init__( :param launch_description_length_limit: Maximum allowed launch description length. :param item_description_length_limit: Maximum allowed test item description length. """ - set_current(self) + # noinspection PyProtectedMember + reportportal_client._internal.local.set_current(self) self.api_v1, self.api_v2 = "v1", "v2" self.__endpoint = endpoint self.__project = project From f9d04ebea64f534828ee5ca15f8afcaa1cf9a6dc Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:37:52 +0300 Subject: [PATCH 17/35] A try to fix imports --- reportportal_client/aio/client.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index d3ebe7a..1c9a654 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -28,6 +28,9 @@ import aiohttp import certifi +# noinspection PyProtectedMember +import reportportal_client._internal.local + # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -41,9 +44,6 @@ TriggerTaskBatcher, ) -# noinspection PyProtectedMember -from reportportal_client._internal.local import set_current - # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -898,7 +898,8 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - set_current(self) + # noinspection PyProtectedMember + reportportal_client._internal.local.set_current(self) def __cache_api_info(self, api_info: Optional[dict]) -> Optional[dict]: if not isinstance(api_info, dict): @@ -1376,7 +1377,8 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - set_current(self) + # noinspection PyProtectedMember + reportportal_client._internal.local.set_current(self) @abstractmethod def create_task(self, coro: Coroutine[Any, Any, _T]) -> Task[_T]: From 17500dbc3da86ba4c38d4f80291b65901dd0a97a Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:49:53 +0300 Subject: [PATCH 18/35] A try to fix imports --- reportportal_client/aio/client.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index 1c9a654..cfd7c8b 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -31,6 +31,9 @@ # noinspection PyProtectedMember import reportportal_client._internal.local +# noinspection PyProtectedMember +import reportportal_client._internal.logs.batcher + # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -44,9 +47,6 @@ TriggerTaskBatcher, ) -# noinspection PyProtectedMember -from reportportal_client._internal.logs.batcher import LogBatcher - # noinspection PyProtectedMember from reportportal_client._internal.services.auth import ApiKeyAuthAsync, AuthAsync, OAuthPasswordGrantAsync @@ -784,7 +784,8 @@ class AsyncRPClient(RP): log_batch_size: int log_batch_payload_limit: int _item_stack: LifoQueue - _log_batcher: LogBatcher + # noinspection PyProtectedMember + _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher __client: Client __launch_uuid: Optional[str] __step_reporter: StepReporter @@ -842,7 +843,8 @@ def __init__( launch_uuid: Optional[str] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - log_batcher: Optional[LogBatcher] = None, + # noinspection PyProtectedMember + log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -885,7 +887,9 @@ def __init__( self._item_stack = LifoQueue() self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) + self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( + log_batch_size, log_batch_payload_limit + ) if client: self.__client = client else: @@ -1262,7 +1266,8 @@ class _RPClient(RP, metaclass=AbstractBaseClass): own_launch: bool own_client: bool _item_stack: LifoQueue - _log_batcher: LogBatcher + # noinspection PyProtectedMember + _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher __client: Client __launch_uuid: Optional[Task[Optional[str]]] __endpoint: str @@ -1321,7 +1326,8 @@ def __init__( launch_uuid: Optional[Task[str]] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - log_batcher: Optional[LogBatcher] = None, + # noinspection PyProtectedMember + log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -1359,7 +1365,10 @@ def __init__( self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) + # noinspection PyProtectedMember + self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( + log_batch_size, log_batch_payload_limit + ) if client: self.__client = client From 9583ed0e1a3408e0c790406040a81474362ee6fb Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:56:11 +0300 Subject: [PATCH 19/35] Revert "A try to fix imports" This reverts commit 17500dbc3da86ba4c38d4f80291b65901dd0a97a. --- reportportal_client/aio/client.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index cfd7c8b..1c9a654 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -31,9 +31,6 @@ # noinspection PyProtectedMember import reportportal_client._internal.local -# noinspection PyProtectedMember -import reportportal_client._internal.logs.batcher - # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -47,6 +44,9 @@ TriggerTaskBatcher, ) +# noinspection PyProtectedMember +from reportportal_client._internal.logs.batcher import LogBatcher + # noinspection PyProtectedMember from reportportal_client._internal.services.auth import ApiKeyAuthAsync, AuthAsync, OAuthPasswordGrantAsync @@ -784,8 +784,7 @@ class AsyncRPClient(RP): log_batch_size: int log_batch_payload_limit: int _item_stack: LifoQueue - # noinspection PyProtectedMember - _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher + _log_batcher: LogBatcher __client: Client __launch_uuid: Optional[str] __step_reporter: StepReporter @@ -843,8 +842,7 @@ def __init__( launch_uuid: Optional[str] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - # noinspection PyProtectedMember - log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, + log_batcher: Optional[LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -887,9 +885,7 @@ def __init__( self._item_stack = LifoQueue() self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( - log_batch_size, log_batch_payload_limit - ) + self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) if client: self.__client = client else: @@ -1266,8 +1262,7 @@ class _RPClient(RP, metaclass=AbstractBaseClass): own_launch: bool own_client: bool _item_stack: LifoQueue - # noinspection PyProtectedMember - _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher + _log_batcher: LogBatcher __client: Client __launch_uuid: Optional[Task[Optional[str]]] __endpoint: str @@ -1326,8 +1321,7 @@ def __init__( launch_uuid: Optional[Task[str]] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - # noinspection PyProtectedMember - log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, + log_batcher: Optional[LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -1365,10 +1359,7 @@ def __init__( self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - # noinspection PyProtectedMember - self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( - log_batch_size, log_batch_payload_limit - ) + self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) if client: self.__client = client From f543ff9a146d798bf69c20a921faa680cc6e5e78 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:56:12 +0300 Subject: [PATCH 20/35] Revert "A try to fix imports" This reverts commit f9d04ebea64f534828ee5ca15f8afcaa1cf9a6dc. --- reportportal_client/aio/client.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index 1c9a654..d3ebe7a 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -28,9 +28,6 @@ import aiohttp import certifi -# noinspection PyProtectedMember -import reportportal_client._internal.local - # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -44,6 +41,9 @@ TriggerTaskBatcher, ) +# noinspection PyProtectedMember +from reportportal_client._internal.local import set_current + # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -898,8 +898,7 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - # noinspection PyProtectedMember - reportportal_client._internal.local.set_current(self) + set_current(self) def __cache_api_info(self, api_info: Optional[dict]) -> Optional[dict]: if not isinstance(api_info, dict): @@ -1377,8 +1376,7 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - # noinspection PyProtectedMember - reportportal_client._internal.local.set_current(self) + set_current(self) @abstractmethod def create_task(self, coro: Coroutine[Any, Any, _T]) -> Task[_T]: From af821939a7e24a5175aeace8628e3e3a9a691e71 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:56:12 +0300 Subject: [PATCH 21/35] Revert "A try to fix imports" This reverts commit e818df6af0f42af40fbd050ac2ccda8e31e6985f. --- reportportal_client/client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reportportal_client/client.py b/reportportal_client/client.py index fa79f76..58ffa23 100644 --- a/reportportal_client/client.py +++ b/reportportal_client/client.py @@ -29,10 +29,10 @@ from requests.adapters import DEFAULT_RETRIES, HTTPAdapter, Retry # noinspection PyProtectedMember -import reportportal_client._internal.local +from reportportal_client._internal.http import ClientSession # noinspection PyProtectedMember -from reportportal_client._internal.http import ClientSession +from reportportal_client._internal.local import set_current # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -576,8 +576,7 @@ def __init__( :param launch_description_length_limit: Maximum allowed launch description length. :param item_description_length_limit: Maximum allowed test item description length. """ - # noinspection PyProtectedMember - reportportal_client._internal.local.set_current(self) + set_current(self) self.api_v1, self.api_v2 = "v1", "v2" self.__endpoint = endpoint self.__project = project From 1e2897db7d0110e2301fcb5224b67b73e33b860e Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:56:12 +0300 Subject: [PATCH 22/35] Revert "A try to fix imports" This reverts commit 02352b026023586fe5274a0d36d200ee24aa33e8. --- reportportal_client/_internal/local/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index 84cca1c..66fd452 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -21,14 +21,14 @@ __INSTANCES = local() -def current() -> Optional[RP]: +def current() -> Optional['RP']: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional[RP]) -> None: +def set_current(client: Optional['RP']) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls From d0505b00cee7b091361e243432a1601503ddd449 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:56:12 +0300 Subject: [PATCH 23/35] Revert "A try to fix imports" This reverts commit 5c52c82626461e43b9f58e8f63a857a636dff007. --- reportportal_client/_internal/local/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index 66fd452..cc5ed2f 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -16,19 +16,19 @@ from threading import local from typing import Optional -from reportportal_client.client import RP +from reportportal_client import RP __INSTANCES = local() -def current() -> Optional['RP']: +def current() -> Optional[RP]: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional['RP']) -> None: +def set_current(client: Optional[RP]) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls From 6abae38ca836ed18279b58cd2076e09acb7f7a44 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:56:41 +0300 Subject: [PATCH 24/35] A try to fix imports --- reportportal_client/_internal/local/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index cc5ed2f..c585f36 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -16,19 +16,19 @@ from threading import local from typing import Optional -from reportportal_client import RP +import reportportal_client.client __INSTANCES = local() -def current() -> Optional[RP]: +def current() -> Optional['reportportal_client.client.RP']: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional[RP]) -> None: +def set_current(client: Optional['reportportal_client.client.RP']) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls From 5a800081cdd2af196ab6aa318d1a02c122030b88 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:58:35 +0300 Subject: [PATCH 25/35] Reapply "A try to fix imports" This reverts commit af821939a7e24a5175aeace8628e3e3a9a691e71. --- reportportal_client/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reportportal_client/client.py b/reportportal_client/client.py index 58ffa23..fa79f76 100644 --- a/reportportal_client/client.py +++ b/reportportal_client/client.py @@ -29,10 +29,10 @@ from requests.adapters import DEFAULT_RETRIES, HTTPAdapter, Retry # noinspection PyProtectedMember -from reportportal_client._internal.http import ClientSession +import reportportal_client._internal.local # noinspection PyProtectedMember -from reportportal_client._internal.local import set_current +from reportportal_client._internal.http import ClientSession # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -576,7 +576,8 @@ def __init__( :param launch_description_length_limit: Maximum allowed launch description length. :param item_description_length_limit: Maximum allowed test item description length. """ - set_current(self) + # noinspection PyProtectedMember + reportportal_client._internal.local.set_current(self) self.api_v1, self.api_v2 = "v1", "v2" self.__endpoint = endpoint self.__project = project From b44b4661a382663aebba87e44aa260fb6fc3db40 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 12:59:59 +0300 Subject: [PATCH 26/35] Reapply "A try to fix imports" This reverts commit f543ff9a146d798bf69c20a921faa680cc6e5e78. --- reportportal_client/aio/client.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index d3ebe7a..1c9a654 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -28,6 +28,9 @@ import aiohttp import certifi +# noinspection PyProtectedMember +import reportportal_client._internal.local + # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -41,9 +44,6 @@ TriggerTaskBatcher, ) -# noinspection PyProtectedMember -from reportportal_client._internal.local import set_current - # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -898,7 +898,8 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - set_current(self) + # noinspection PyProtectedMember + reportportal_client._internal.local.set_current(self) def __cache_api_info(self, api_info: Optional[dict]) -> Optional[dict]: if not isinstance(api_info, dict): @@ -1376,7 +1377,8 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - set_current(self) + # noinspection PyProtectedMember + reportportal_client._internal.local.set_current(self) @abstractmethod def create_task(self, coro: Coroutine[Any, Any, _T]) -> Task[_T]: From 94b49b253d4cc1b4ddd1c846deca624439de6bc0 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:01:57 +0300 Subject: [PATCH 27/35] Reapply "A try to fix imports" This reverts commit 9583ed0e1a3408e0c790406040a81474362ee6fb. --- reportportal_client/aio/client.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index 1c9a654..cfd7c8b 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -31,6 +31,9 @@ # noinspection PyProtectedMember import reportportal_client._internal.local +# noinspection PyProtectedMember +import reportportal_client._internal.logs.batcher + # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -44,9 +47,6 @@ TriggerTaskBatcher, ) -# noinspection PyProtectedMember -from reportportal_client._internal.logs.batcher import LogBatcher - # noinspection PyProtectedMember from reportportal_client._internal.services.auth import ApiKeyAuthAsync, AuthAsync, OAuthPasswordGrantAsync @@ -784,7 +784,8 @@ class AsyncRPClient(RP): log_batch_size: int log_batch_payload_limit: int _item_stack: LifoQueue - _log_batcher: LogBatcher + # noinspection PyProtectedMember + _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher __client: Client __launch_uuid: Optional[str] __step_reporter: StepReporter @@ -842,7 +843,8 @@ def __init__( launch_uuid: Optional[str] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - log_batcher: Optional[LogBatcher] = None, + # noinspection PyProtectedMember + log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -885,7 +887,9 @@ def __init__( self._item_stack = LifoQueue() self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) + self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( + log_batch_size, log_batch_payload_limit + ) if client: self.__client = client else: @@ -1262,7 +1266,8 @@ class _RPClient(RP, metaclass=AbstractBaseClass): own_launch: bool own_client: bool _item_stack: LifoQueue - _log_batcher: LogBatcher + # noinspection PyProtectedMember + _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher __client: Client __launch_uuid: Optional[Task[Optional[str]]] __endpoint: str @@ -1321,7 +1326,8 @@ def __init__( launch_uuid: Optional[Task[str]] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - log_batcher: Optional[LogBatcher] = None, + # noinspection PyProtectedMember + log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -1359,7 +1365,10 @@ def __init__( self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) + # noinspection PyProtectedMember + self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( + log_batch_size, log_batch_payload_limit + ) if client: self.__client = client From 9281b1684b13487bfb789b471f9785d8e41c76b4 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:07:52 +0300 Subject: [PATCH 28/35] A try to fix imports --- reportportal_client/aio/client.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index cfd7c8b..6ec7218 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -28,6 +28,9 @@ import aiohttp import certifi +# noinspection PyProtectedMember +import reportportal_client.client + # noinspection PyProtectedMember import reportportal_client._internal.local @@ -62,7 +65,6 @@ # noinspection PyProtectedMember from reportportal_client.aio.tasks import EmptyTask, Task from reportportal_client.aio.util import await_if_necessary -from reportportal_client.client import RP, OutputType from reportportal_client.core.rp_issues import Issue from reportportal_client.core.rp_requests import ( AsyncHttpRequest, @@ -130,7 +132,7 @@ class Client: keepalive_timeout: Optional[float] mode: str launch_uuid_print: bool - print_output: OutputType + print_output: reportportal_client.client.OutputType truncate_attributes: bool truncate_fields: bool replace_binary_chars: bool @@ -156,7 +158,7 @@ def __init__( keepalive_timeout: Optional[float] = None, mode: str = "DEFAULT", launch_uuid_print: bool = False, - print_output: OutputType = OutputType.STDOUT, + print_output: reportportal_client.client.OutputType = reportportal_client.client.OutputType.STDOUT, truncate_attributes: bool = True, truncate_fields: bool = True, replace_binary_chars: bool = True, @@ -773,7 +775,7 @@ def __setstate__(self, state: dict[str, Any]) -> None: self.__dict__.update(state) -class AsyncRPClient(RP): +class AsyncRPClient('reportportal_client.client.RP'): """Asynchronous ReportPortal Client. This class implements common RP client interface but all its methods are async, so it capable to use in @@ -1256,7 +1258,7 @@ async def close(self) -> None: # noinspection PyAbstractClass -class _RPClient(RP, metaclass=AbstractBaseClass): +class _RPClient('reportportal_client.client.RP', metaclass=AbstractBaseClass): """Base class for different synchronous to asynchronous client implementations.""" __metaclass__ = AbstractBaseClass From 10c1922788092cfe76e4f28973a73b6c42ea801a Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:16:24 +0300 Subject: [PATCH 29/35] Revert "A try to fix imports" This reverts commit 9281b1684b13487bfb789b471f9785d8e41c76b4. --- reportportal_client/aio/client.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index 6ec7218..cfd7c8b 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -28,9 +28,6 @@ import aiohttp import certifi -# noinspection PyProtectedMember -import reportportal_client.client - # noinspection PyProtectedMember import reportportal_client._internal.local @@ -65,6 +62,7 @@ # noinspection PyProtectedMember from reportportal_client.aio.tasks import EmptyTask, Task from reportportal_client.aio.util import await_if_necessary +from reportportal_client.client import RP, OutputType from reportportal_client.core.rp_issues import Issue from reportportal_client.core.rp_requests import ( AsyncHttpRequest, @@ -132,7 +130,7 @@ class Client: keepalive_timeout: Optional[float] mode: str launch_uuid_print: bool - print_output: reportportal_client.client.OutputType + print_output: OutputType truncate_attributes: bool truncate_fields: bool replace_binary_chars: bool @@ -158,7 +156,7 @@ def __init__( keepalive_timeout: Optional[float] = None, mode: str = "DEFAULT", launch_uuid_print: bool = False, - print_output: reportportal_client.client.OutputType = reportportal_client.client.OutputType.STDOUT, + print_output: OutputType = OutputType.STDOUT, truncate_attributes: bool = True, truncate_fields: bool = True, replace_binary_chars: bool = True, @@ -775,7 +773,7 @@ def __setstate__(self, state: dict[str, Any]) -> None: self.__dict__.update(state) -class AsyncRPClient('reportportal_client.client.RP'): +class AsyncRPClient(RP): """Asynchronous ReportPortal Client. This class implements common RP client interface but all its methods are async, so it capable to use in @@ -1258,7 +1256,7 @@ async def close(self) -> None: # noinspection PyAbstractClass -class _RPClient('reportportal_client.client.RP', metaclass=AbstractBaseClass): +class _RPClient(RP, metaclass=AbstractBaseClass): """Base class for different synchronous to asynchronous client implementations.""" __metaclass__ = AbstractBaseClass From 62fc2098392c6cddbe7c5104749775c914720fdf Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:16:24 +0300 Subject: [PATCH 30/35] Revert "Reapply "A try to fix imports"" This reverts commit 94b49b253d4cc1b4ddd1c846deca624439de6bc0. --- reportportal_client/aio/client.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index cfd7c8b..1c9a654 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -31,9 +31,6 @@ # noinspection PyProtectedMember import reportportal_client._internal.local -# noinspection PyProtectedMember -import reportportal_client._internal.logs.batcher - # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -47,6 +44,9 @@ TriggerTaskBatcher, ) +# noinspection PyProtectedMember +from reportportal_client._internal.logs.batcher import LogBatcher + # noinspection PyProtectedMember from reportportal_client._internal.services.auth import ApiKeyAuthAsync, AuthAsync, OAuthPasswordGrantAsync @@ -784,8 +784,7 @@ class AsyncRPClient(RP): log_batch_size: int log_batch_payload_limit: int _item_stack: LifoQueue - # noinspection PyProtectedMember - _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher + _log_batcher: LogBatcher __client: Client __launch_uuid: Optional[str] __step_reporter: StepReporter @@ -843,8 +842,7 @@ def __init__( launch_uuid: Optional[str] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - # noinspection PyProtectedMember - log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, + log_batcher: Optional[LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -887,9 +885,7 @@ def __init__( self._item_stack = LifoQueue() self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( - log_batch_size, log_batch_payload_limit - ) + self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) if client: self.__client = client else: @@ -1266,8 +1262,7 @@ class _RPClient(RP, metaclass=AbstractBaseClass): own_launch: bool own_client: bool _item_stack: LifoQueue - # noinspection PyProtectedMember - _log_batcher: reportportal_client._internal.logs.batcher.LogBatcher + _log_batcher: LogBatcher __client: Client __launch_uuid: Optional[Task[Optional[str]]] __endpoint: str @@ -1326,8 +1321,7 @@ def __init__( launch_uuid: Optional[Task[str]] = None, log_batch_size: int = 20, log_batch_payload_limit: int = MAX_LOG_BATCH_PAYLOAD_SIZE, - # noinspection PyProtectedMember - log_batcher: Optional[reportportal_client._internal.logs.batcher.LogBatcher] = None, + log_batcher: Optional[LogBatcher] = None, **kwargs: Any, ) -> None: """Initialize the class instance with arguments. @@ -1365,10 +1359,7 @@ def __init__( self.log_batch_size = log_batch_size self.log_batch_payload_limit = log_batch_payload_limit - # noinspection PyProtectedMember - self._log_batcher = log_batcher or reportportal_client._internal.logs.batcher.LogBatcher( - log_batch_size, log_batch_payload_limit - ) + self._log_batcher = log_batcher or LogBatcher(log_batch_size, log_batch_payload_limit) if client: self.__client = client From 9477ad7bf1afac4c6c3d9703212c1e7928bed715 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:16:24 +0300 Subject: [PATCH 31/35] Revert "Reapply "A try to fix imports"" This reverts commit b44b4661a382663aebba87e44aa260fb6fc3db40. --- reportportal_client/aio/client.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index 1c9a654..d3ebe7a 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -28,9 +28,6 @@ import aiohttp import certifi -# noinspection PyProtectedMember -import reportportal_client._internal.local - # noinspection PyProtectedMember from reportportal_client._internal.aio.http import ClientSession, RetryingClientSession @@ -44,6 +41,9 @@ TriggerTaskBatcher, ) +# noinspection PyProtectedMember +from reportportal_client._internal.local import set_current + # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -898,8 +898,7 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - # noinspection PyProtectedMember - reportportal_client._internal.local.set_current(self) + set_current(self) def __cache_api_info(self, api_info: Optional[dict]) -> Optional[dict]: if not isinstance(api_info, dict): @@ -1377,8 +1376,7 @@ def __init__( self._api_info_task = None self._api_info_cache = None self._use_microseconds = None - # noinspection PyProtectedMember - reportportal_client._internal.local.set_current(self) + set_current(self) @abstractmethod def create_task(self, coro: Coroutine[Any, Any, _T]) -> Task[_T]: From 862e0c89717ed744f21369bcc691a1e7bf4415fe Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:16:24 +0300 Subject: [PATCH 32/35] Revert "Reapply "A try to fix imports"" This reverts commit 5a800081cdd2af196ab6aa318d1a02c122030b88. --- reportportal_client/client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reportportal_client/client.py b/reportportal_client/client.py index fa79f76..58ffa23 100644 --- a/reportportal_client/client.py +++ b/reportportal_client/client.py @@ -29,10 +29,10 @@ from requests.adapters import DEFAULT_RETRIES, HTTPAdapter, Retry # noinspection PyProtectedMember -import reportportal_client._internal.local +from reportportal_client._internal.http import ClientSession # noinspection PyProtectedMember -from reportportal_client._internal.http import ClientSession +from reportportal_client._internal.local import set_current # noinspection PyProtectedMember from reportportal_client._internal.logs.batcher import LogBatcher @@ -576,8 +576,7 @@ def __init__( :param launch_description_length_limit: Maximum allowed launch description length. :param item_description_length_limit: Maximum allowed test item description length. """ - # noinspection PyProtectedMember - reportportal_client._internal.local.set_current(self) + set_current(self) self.api_v1, self.api_v2 = "v1", "v2" self.__endpoint = endpoint self.__project = project From 2e1e4c1e784f0ce61243ef8bd6b994012dc4ada0 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:16:24 +0300 Subject: [PATCH 33/35] Revert "A try to fix imports" This reverts commit 6abae38ca836ed18279b58cd2076e09acb7f7a44. --- reportportal_client/_internal/local/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index c585f36..cc5ed2f 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -16,19 +16,19 @@ from threading import local from typing import Optional -import reportportal_client.client +from reportportal_client import RP __INSTANCES = local() -def current() -> Optional['reportportal_client.client.RP']: +def current() -> Optional[RP]: """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional['reportportal_client.client.RP']) -> None: +def set_current(client: Optional[RP]) -> None: """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls From 8767090bd9d1894dd1f31d5c6895c8e763946e54 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:20:31 +0300 Subject: [PATCH 34/35] Revert "Fix mypy" This reverts commit e0ef83e2709f5126428d5bdd317bf18e8a22a419. --- .../_internal/local/__init__.py | 7 ++----- .../_internal/local/__init__.pyi | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 reportportal_client/_internal/local/__init__.pyi diff --git a/reportportal_client/_internal/local/__init__.py b/reportportal_client/_internal/local/__init__.py index cc5ed2f..da4dabb 100644 --- a/reportportal_client/_internal/local/__init__.py +++ b/reportportal_client/_internal/local/__init__.py @@ -14,21 +14,18 @@ """ReportPortal client context storing and retrieving module.""" from threading import local -from typing import Optional - -from reportportal_client import RP __INSTANCES = local() -def current() -> Optional[RP]: +def current(): """Return current ReportPortal client.""" if hasattr(__INSTANCES, "current"): return __INSTANCES.current return None -def set_current(client: Optional[RP]) -> None: +def set_current(client): """Save ReportPortal client as current. The method is not intended to use used by users. ReportPortal client calls diff --git a/reportportal_client/_internal/local/__init__.pyi b/reportportal_client/_internal/local/__init__.pyi new file mode 100644 index 0000000..ffde91d --- /dev/null +++ b/reportportal_client/_internal/local/__init__.pyi @@ -0,0 +1,19 @@ +# Copyright (c) 2022 EPAM Systems +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License + +from typing import Optional + +from reportportal_client import RP + +def current() -> Optional[RP]: ... +def set_current(client: Optional[RP]) -> None: ... From a7e24001a1fad1da2a4f79d69c88a341922d0e8b Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 26 Oct 2026 13:41:13 +0300 Subject: [PATCH 35/35] Fix pre-commit configuration --- .pre-commit-config.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9955d92..b660222 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,8 @@ repos: hooks: - id: black language: system - args: [ '--check', './reportportal_client', './tests' ] + args: [ '--check' ] + files: ^(reportportal_client|tests)/ - repo: https://github.com/pycqa/isort rev: '0a09c783808cfe77bb3269250f663ff733d23302' hooks: @@ -40,5 +41,6 @@ repos: hooks: - id: mypy language: system - args: [ "--ignore-missing-imports" ] - exclude: 'tests/' + args: [ "--ignore-missing-imports", "reportportal_client" ] + pass_filenames: false + files: ^reportportal_client/