From 56b1b5fb8f3c6bba54c9588993b9299847253cfe Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Mon, 26 Oct 2026 10:48:56 +0000 Subject: [PATCH 1/5] Changelog update --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a1de2d..e1d52e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] + +## [5.7.12] ### Changed - `certify` version range updated to mitigate a compromised certificate issue, by @HardNorth From d85ac15bdb618fffa679a4bceb839c7685704ae3 Mon Sep 17 00:00:00 2001 From: "reportportal.io" Date: Mon, 26 Oct 2026 10:48:57 +0000 Subject: [PATCH 2/5] Version update --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1c6ecc9..fbecb79 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup -__version__ = "5.7.12" +__version__ = "5.7.13" TYPE_STUBS = ["*.pyi"] From 6c56071944c5b41d77ef110040f2f9ef2473671f Mon Sep 17 00:00:00 2001 From: BlueX888 <140241684+BlueX888@users.noreply.github.com> Date: Mon, 9 Nov 2026 18:49:53 +0800 Subject: [PATCH 3/5] Fix own_client so close() closes the client created internally --- reportportal_client/aio/client.py | 3 ++- tests/aio/test_batched_client.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/reportportal_client/aio/client.py b/reportportal_client/aio/client.py index d3ebe7a..ad33528 100644 --- a/reportportal_client/aio/client.py +++ b/reportportal_client/aio/client.py @@ -771,6 +771,7 @@ def __setstate__(self, state: dict[str, Any]) -> None: :param dict state: object state dictionary """ self.__dict__.update(state) + self._session = None class AsyncRPClient(RP): @@ -1365,7 +1366,7 @@ def __init__( self.own_client = False else: self.__client = Client(endpoint, project, **kwargs) - self.own_client = False + self.own_client = True self.__launch_uuid = launch_uuid if launch_uuid: diff --git a/tests/aio/test_batched_client.py b/tests/aio/test_batched_client.py index 48343ff..56e72c5 100644 --- a/tests/aio/test_batched_client.py +++ b/tests/aio/test_batched_client.py @@ -18,16 +18,27 @@ # noinspection PyPackageRequirements import pytest -from reportportal_client.aio import BatchedRPClient +from reportportal_client.aio import BatchedRPClient, ThreadedRPClient from reportportal_client.core.rp_requests import AsyncRPRequestLog from reportportal_client.helpers import timestamp +@pytest.mark.parametrize("client_class", [BatchedRPClient, ThreadedRPClient]) +def test_own_client_reflects_client_ownership(client_class): + owned = client_class("http://endpoint", "project", api_key="api_key") + assert owned.own_client is True + + borrowed = client_class("http://endpoint", "project", api_key="api_key", client=mock.AsyncMock()) + assert borrowed.own_client is False + + def test_batched_rp_client_pickling(): client = BatchedRPClient("http://localhost:8080", "default_personal", api_key="test_key") pickled_client = pickle.dumps(client) unpickled_client = pickle.loads(pickled_client) assert unpickled_client is not None + assert unpickled_client.own_client is True + unpickled_client.close() async def __empty_string(): From b6f8709e25101ecace9cd5ababb1480aee611e91 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 9 Nov 2026 14:59:17 +0300 Subject: [PATCH 4/5] Drop Python 3.9 --- .github/workflows/tests.yml | 2 +- CHANGELOG.md | 4 ++++ reportportal_client/__init__.py | 1 - reportportal_client/_internal/aio/tasks.py | 7 +------ reportportal_client/aio/tasks.py | 7 +------ setup.py | 1 - tox.ini | 2 -- 7 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f8ff469..9f2d4a2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15' ] + python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14', '3.15' ] steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e1d52e7..db23b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog ## [Unreleased] +### Fixed +- Issue [#283](https://github.com/reportportal/client-Python/issues/283): Async RPClient doesn't close client session, by @BlueX888 +### Removed +- `Python 3.9` support, by @HardNorth ## [5.7.12] ### Changed diff --git a/reportportal_client/__init__.py b/reportportal_client/__init__.py index 5fe2e93..4180cbd 100644 --- a/reportportal_client/__init__.py +++ b/reportportal_client/__init__.py @@ -18,7 +18,6 @@ from enum import Enum from typing import Optional, TypedDict, Union -# noinspection PyUnreachableCode if sys.version_info >= (3, 11): from typing import Unpack else: diff --git a/reportportal_client/_internal/aio/tasks.py b/reportportal_client/_internal/aio/tasks.py index 263a4fd..f653bd1 100644 --- a/reportportal_client/_internal/aio/tasks.py +++ b/reportportal_client/_internal/aio/tasks.py @@ -17,15 +17,10 @@ import sys import time from asyncio import Future -from typing import Any, Coroutine, Generator, Generic, Optional, TypeVar, Union +from typing import Any, Coroutine, Generator, Generic, Optional, TypeAlias, TypeVar, Union from reportportal_client.aio.tasks import BlockingOperationError, Task -if sys.version_info >= (3, 10): - from typing import TypeAlias -else: - from typing_extensions import TypeAlias - _T = TypeVar("_T") DEFAULT_TASK_TRIGGER_NUM: int = 10 diff --git a/reportportal_client/aio/tasks.py b/reportportal_client/aio/tasks.py index b9913ea..40eea92 100644 --- a/reportportal_client/aio/tasks.py +++ b/reportportal_client/aio/tasks.py @@ -17,12 +17,7 @@ import sys from abc import abstractmethod from asyncio import Future -from typing import Any, Coroutine, Generator, Generic, Optional, TypeVar, Union - -if sys.version_info >= (3, 10): - from typing import TypeAlias -else: - from typing_extensions import TypeAlias +from typing import Any, Coroutine, Generator, Generic, Optional, TypeAlias, TypeVar, Union # noinspection PyProtectedMember from reportportal_client._internal.static.abstract import AbstractBaseClass diff --git a/setup.py b/setup.py index fbecb79..69a6554 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,6 @@ def read_file(fname): license="Apache-2.0", keywords=["testing", "reporting", "reportportal", "client"], classifiers=[ - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/tox.ini b/tox.ini index 8518999..c310c00 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ isolated_build = True envlist = pep - py39 py310 py311 py312 @@ -31,7 +30,6 @@ commands = pre-commit run --all-files --show-diff-on-failure [gh-actions] python = - 3.9: py39 3.10: pep, py310 3.11: py311 3.12: py312 From 5c0f4591698be2ef37fa9c62168e1580092a4c0e Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 9 Nov 2026 15:01:44 +0300 Subject: [PATCH 5/5] Bump minor version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 69a6554..38423ab 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup -__version__ = "5.7.13" +__version__ = "5.8.0" TYPE_STUBS = ["*.pyi"]