Skip to content

Commit 39fa31c

Browse files
committed
Drop Python 3.7 support
1 parent 2d1e5d4 commit 39fa31c

File tree

14 files changed

+15
-117
lines changed

14 files changed

+15
-117
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
runs-on: ubuntu-latest
3535
strategy:
3636
matrix:
37-
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
37+
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
3838
steps:
3939
- name: Checkout repository
4040
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Removed
5+
- `Python 3.7` support, by @HardNorth
46

57
## [5.5.10]
68
### Added

reportportal_client/aio/tasks.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"""This module contains customized asynchronous Tasks and Task Factories for the ReportPortal client."""
1515

1616
import asyncio
17-
import sys
1817
from abc import abstractmethod
1918
from asyncio import Future
2019
from typing import TypeVar, Generic, Union, Generator, Awaitable, Optional
@@ -54,10 +53,7 @@ def __init__(
5453
:param name: the name of the task
5554
"""
5655
self.name = name
57-
if sys.version_info < (3, 8):
58-
super().__init__(coro, loop=loop)
59-
else:
60-
super().__init__(coro, loop=loop, name=name)
56+
super().__init__(coro, loop=loop, name=name)
6157

6258
@abstractmethod
6359
def blocking_result(self) -> _T:

reportportal_client/helpers.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import asyncio
1717
import inspect
1818
import logging
19-
import sys
2019
import threading
2120
import time
2221
import uuid
@@ -203,25 +202,13 @@ def get_package_parameters(package_name: str, parameters: List[str] = None) -> L
203202
if not parameters:
204203
return result
205204

206-
if sys.version_info < (3, 8):
207-
from pkg_resources import get_distribution, DistributionNotFound
208-
try:
209-
package_info = get_distribution(package_name)
210-
except DistributionNotFound:
211-
return [None] * len(parameters)
212-
for param in parameters:
213-
if param.lower() == 'name':
214-
param = 'project_name'
215-
result.append(getattr(package_info, param, None))
216-
else:
217-
# noinspection PyCompatibility
218-
from importlib.metadata import distribution, PackageNotFoundError
219-
try:
220-
package_info = distribution(package_name)
221-
except PackageNotFoundError:
222-
return [None] * len(parameters)
223-
for param in parameters:
224-
result.append(package_info.metadata[param.lower()[:1].upper() + param.lower()[1:]])
205+
from importlib.metadata import distribution, PackageNotFoundError
206+
try:
207+
package_info = distribution(package_name)
208+
except PackageNotFoundError:
209+
return [None] * len(parameters)
210+
for param in parameters:
211+
result.append(package_info.metadata[param.lower()[:1].upper() + param.lower()[1:]])
225212
return result
226213

227214

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
aenum
2-
requests>=2.31.0
3-
aiohttp>=3.8.6
2+
requests>=2.32.3
3+
aiohttp>=3.10.11
44
certifi>=2024.8.30

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from setuptools import setup, find_packages
66

7-
__version__ = '5.5.11'
7+
__version__ = '5.6.0'
88

99
TYPE_STUBS = ['*.pyi']
1010

@@ -40,7 +40,6 @@ def read_file(fname):
4040
license='Apache 2.0.',
4141
keywords=['testing', 'reporting', 'reportportal', 'client'],
4242
classifiers=[
43-
'Programming Language :: Python :: 3.7',
4443
'Programming Language :: Python :: 3.8',
4544
'Programming Language :: Python :: 3.9',
4645
'Programming Language :: Python :: 3.10',

tests/_internal/services/test_statistics.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# limitations under the License
2323

2424
import re
25-
import sys
2625
from unittest import mock
2726

2827
# noinspection PyPackageRequirements
@@ -107,13 +106,9 @@ def test_same_client_id(mocked_requests):
107106
assert result1 == result2
108107

109108

110-
MOCKED_AIOHTTP = None
111-
if not sys.version_info < (3, 8):
112-
MOCKED_AIOHTTP = mock.AsyncMock()
109+
MOCKED_AIOHTTP = mock.AsyncMock()
113110

114111

115-
@pytest.mark.skipif(sys.version_info < (3, 8),
116-
reason="the test requires AsyncMock which was introduced in Python 3.8")
117112
@mock.patch('reportportal_client._internal.services.statistics.get_client_id',
118113
mock.Mock(return_value='555'))
119114
@mock.patch('reportportal_client._internal.services.statistics.aiohttp.ClientSession.post', MOCKED_AIOHTTP)

tests/aio/test_aio_client.py

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ async def test_retries_param(retry_num, expected_class, expected_param):
7171
assert getattr(session, '_RetryingClientSession__retry_number') == expected_param
7272

7373

74-
@pytest.mark.skipif(sys.version_info < (3, 8),
75-
reason="For some reasons this does not work on Python 3.7 on Ubuntu, "
76-
"but works on my Mac. Unfortunately GHA use Python 3.7 on Ubuntu.")
7774
@pytest.mark.parametrize(
7875
'timeout_param, expected_connect_param, expected_sock_read_param',
7976
[
@@ -134,8 +131,6 @@ def test_clone():
134131
EXPECTED_DEBUG_URL = f'http://endpoint/ui/#project/userdebug/all/{LAUNCH_ID}'
135132

136133

137-
@pytest.mark.skipif(sys.version_info < (3, 8),
138-
reason="the test requires AsyncMock which was introduced in Python 3.8")
139134
@pytest.mark.parametrize(
140135
'launch_mode, project_name, expected_url',
141136
[
@@ -160,9 +155,6 @@ async def get_call(*args, **kwargs):
160155
assert await (aio_client.get_launch_ui_url('test_launch_uuid')) == expected_url
161156

162157

163-
@pytest.mark.skipif(sys.version_info < (3, 8),
164-
reason="For some reasons this does not work on Python 3.7 on Ubuntu, "
165-
"but works on my Mac. Unfortunately GHA use Python 3.7 on Ubuntu.")
166158
@pytest.mark.parametrize('default', [True, False])
167159
@mock.patch('reportportal_client.aio.client.aiohttp.TCPConnector')
168160
@pytest.mark.asyncio
@@ -179,9 +171,6 @@ async def test_verify_ssl_default(connector_mock: mock.Mock, default: bool):
179171
assert len(ssl_context.get_ca_certs()) > 0
180172

181173

182-
@pytest.mark.skipif(sys.version_info < (3, 8),
183-
reason="For some reasons this does not work on Python 3.7 on Ubuntu, "
184-
"but works on my Mac. Unfortunately GHA use Python 3.7 on Ubuntu.")
185174
@pytest.mark.parametrize('param_value', [False, None])
186175
@mock.patch('reportportal_client.aio.client.aiohttp.TCPConnector')
187176
@pytest.mark.asyncio
@@ -194,9 +183,6 @@ async def test_verify_ssl_off(connector_mock: mock.Mock, param_value):
194183
assert ssl_context is not None and isinstance(ssl_context, bool) and not ssl_context
195184

196185

197-
@pytest.mark.skipif(sys.version_info < (3, 8),
198-
reason="For some reasons this does not work on Python 3.7 on Ubuntu, "
199-
"but works on my Mac. Unfortunately GHA use Python 3.7 on Ubuntu.")
200186
@mock.patch('reportportal_client.aio.client.aiohttp.TCPConnector')
201187
@pytest.mark.asyncio
202188
async def test_verify_ssl_str(connector_mock: mock.Mock):
@@ -213,9 +199,6 @@ async def test_verify_ssl_str(connector_mock: mock.Mock):
213199
assert certificate['notAfter'] == 'Jun 4 11:04:38 2035 GMT'
214200

215201

216-
@pytest.mark.skipif(sys.version_info < (3, 8),
217-
reason="For some reasons this does not work on Python 3.7 on Ubuntu, "
218-
"but works on my Mac. Unfortunately GHA use Python 3.7 on Ubuntu.")
219202
@mock.patch('reportportal_client.aio.client.aiohttp.TCPConnector')
220203
@pytest.mark.asyncio
221204
async def test_keepalive_timeout(connector_mock: mock.Mock):
@@ -229,8 +212,6 @@ async def test_keepalive_timeout(connector_mock: mock.Mock):
229212
assert timeout is not None and timeout == keepalive_timeout
230213

231214

232-
@pytest.mark.skipif(sys.version_info < (3, 8),
233-
reason="the test requires AsyncMock which was introduced in Python 3.8")
234215
@pytest.mark.asyncio
235216
async def test_close(aio_client: Client):
236217
# noinspection PyTypeChecker
@@ -260,8 +241,6 @@ def verify_attributes(expected_attributes: Optional[dict], actual_attributes: Op
260241
assert attribute.get('system') == hidden
261242

262243

263-
@pytest.mark.skipif(sys.version_info < (3, 8),
264-
reason='the test requires AsyncMock which was introduced in Python 3.8')
265244
@pytest.mark.asyncio
266245
async def test_start_launch(aio_client: Client):
267246
# noinspection PyTypeChecker
@@ -292,8 +271,6 @@ async def test_start_launch(aio_client: Client):
292271
verify_attributes(attributes, actual_attributes)
293272

294273

295-
@pytest.mark.skipif(sys.version_info < (3, 8),
296-
reason='the test requires AsyncMock which was introduced in Python 3.8')
297274
@mock.patch('reportportal_client.aio.client.async_send_event')
298275
@pytest.mark.asyncio
299276
async def test_start_launch_statistics_send(async_send_event):
@@ -321,8 +298,6 @@ async def test_start_launch_statistics_send(async_send_event):
321298
assert len(kwargs.items()) == 0
322299

323300

324-
@pytest.mark.skipif(sys.version_info < (3, 8),
325-
reason='the test requires AsyncMock which was introduced in Python 3.8')
326301
@mock.patch('reportportal_client.aio.client.getenv')
327302
@mock.patch('reportportal_client.aio.client.async_send_event')
328303
@pytest.mark.asyncio
@@ -343,8 +318,6 @@ async def test_start_launch_no_statistics_send(async_send_event, getenv):
343318
async_send_event.assert_not_called()
344319

345320

346-
@pytest.mark.skipif(sys.version_info < (3, 8),
347-
reason="the test requires AsyncMock which was introduced in Python 3.8")
348321
@pytest.mark.asyncio
349322
async def test_launch_uuid_print():
350323
str_io = StringIO()
@@ -358,8 +331,6 @@ async def test_launch_uuid_print():
358331
assert 'ReportPortal Launch UUID: ' in str_io.getvalue()
359332

360333

361-
@pytest.mark.skipif(sys.version_info < (3, 8),
362-
reason="the test requires AsyncMock which was introduced in Python 3.8")
363334
@pytest.mark.asyncio
364335
async def test_no_launch_uuid_print():
365336
str_io = StringIO()
@@ -373,8 +344,6 @@ async def test_no_launch_uuid_print():
373344
assert 'ReportPortal Launch UUID: ' not in str_io.getvalue()
374345

375346

376-
@pytest.mark.skipif(sys.version_info < (3, 8),
377-
reason="the test requires AsyncMock which was introduced in Python 3.8")
378347
@pytest.mark.asyncio
379348
@mock.patch('reportportal_client.client.sys.stdout', new_callable=StringIO)
380349
async def test_launch_uuid_print_default_io(mock_stdout):
@@ -386,8 +355,6 @@ async def test_launch_uuid_print_default_io(mock_stdout):
386355
assert 'ReportPortal Launch UUID: ' in mock_stdout.getvalue()
387356

388357

389-
@pytest.mark.skipif(sys.version_info < (3, 8),
390-
reason="the test requires AsyncMock which was introduced in Python 3.8")
391358
@pytest.mark.asyncio
392359
@mock.patch('reportportal_client.client.sys.stdout', new_callable=StringIO)
393360
async def test_launch_uuid_print_default_print(mock_stdout):
@@ -427,8 +394,6 @@ def request_error(*args, **kwargs):
427394
raise ValueError()
428395

429396

430-
@pytest.mark.skipif(sys.version_info < (3, 8),
431-
reason="the test requires AsyncMock which was introduced in Python 3.8")
432397
@pytest.mark.parametrize(
433398
'requests_method, client_method, client_params',
434399
[
@@ -479,8 +444,6 @@ def verify_parameters(expected_parameters: dict, actual_parameters: List[dict]):
479444
assert expected_parameters.get(attribute.get('key')) == attribute.get('value')
480445

481446

482-
@pytest.mark.skipif(sys.version_info < (3, 8),
483-
reason='the test requires AsyncMock which was introduced in Python 3.8')
484447
@pytest.mark.parametrize(
485448
'parent_id, expected_uri',
486449
[
@@ -533,8 +496,6 @@ async def test_start_test_item(aio_client: Client, parent_id, expected_uri):
533496
verify_parameters(parameters, actual_parameters)
534497

535498

536-
@pytest.mark.skipif(sys.version_info < (3, 8),
537-
reason='the test requires AsyncMock which was introduced in Python 3.8')
538499
@pytest.mark.asyncio
539500
async def test_start_test_item_default_values(aio_client: Client):
540501
# noinspection PyTypeChecker
@@ -576,8 +537,6 @@ def mock_basic_put_response(session):
576537
session.put.return_value = return_object
577538

578539

579-
@pytest.mark.skipif(sys.version_info < (3, 8),
580-
reason='the test requires AsyncMock which was introduced in Python 3.8')
581540
@pytest.mark.asyncio
582541
async def test_finish_test_item(aio_client: Client):
583542
# noinspection PyTypeChecker
@@ -618,8 +577,6 @@ async def test_finish_test_item(aio_client: Client):
618577
assert entry[1] == expected_issue[entry[0]]
619578

620579

621-
@pytest.mark.skipif(sys.version_info < (3, 8),
622-
reason='the test requires AsyncMock which was introduced in Python 3.8')
623580
@pytest.mark.asyncio
624581
async def test_finish_test_item_default_values(aio_client: Client):
625582
# noinspection PyTypeChecker
@@ -649,8 +606,6 @@ async def test_finish_test_item_default_values(aio_client: Client):
649606
assert actual_json.get('issue') is None
650607

651608

652-
@pytest.mark.skipif(sys.version_info < (3, 8),
653-
reason='the test requires AsyncMock which was introduced in Python 3.8')
654609
@pytest.mark.asyncio
655610
async def test_finish_launch(aio_client: Client):
656611
# noinspection PyTypeChecker
@@ -678,8 +633,6 @@ async def test_finish_launch(aio_client: Client):
678633
verify_attributes(attributes, actual_attributes)
679634

680635

681-
@pytest.mark.skipif(sys.version_info < (3, 8),
682-
reason='the test requires AsyncMock which was introduced in Python 3.8')
683636
@pytest.mark.asyncio
684637
async def test_finish_launch_default_values(aio_client: Client):
685638
# noinspection PyTypeChecker
@@ -711,8 +664,6 @@ def mock_basic_get_response(session):
711664
session.get.return_value = return_object
712665

713666

714-
@pytest.mark.skipif(sys.version_info < (3, 8),
715-
reason='the test requires AsyncMock which was introduced in Python 3.8')
716667
@pytest.mark.asyncio
717668
async def test_update_item(aio_client: Client):
718669
# noinspection PyTypeChecker
@@ -738,8 +689,6 @@ async def test_update_item(aio_client: Client):
738689
verify_attributes(attributes, actual_attributes)
739690

740691

741-
@pytest.mark.skipif(sys.version_info < (3, 8),
742-
reason='the test requires AsyncMock which was introduced in Python 3.8')
743692
@pytest.mark.asyncio
744693
async def test_get_item_id_by_uuid(aio_client: Client):
745694
# noinspection PyTypeChecker
@@ -756,8 +705,6 @@ async def test_get_item_id_by_uuid(aio_client: Client):
756705
assert expected_uri == call_args[0][0]
757706

758707

759-
@pytest.mark.skipif(sys.version_info < (3, 8),
760-
reason='the test requires AsyncMock which was introduced in Python 3.8')
761708
@pytest.mark.asyncio
762709
async def test_get_launch_ui_url(aio_client: Client):
763710
# noinspection PyTypeChecker
@@ -774,8 +721,6 @@ async def test_get_launch_ui_url(aio_client: Client):
774721
assert expected_uri == call_args[0][0]
775722

776723

777-
@pytest.mark.skipif(sys.version_info < (3, 8),
778-
reason='the test requires AsyncMock which was introduced in Python 3.8')
779724
@pytest.mark.parametrize(
780725
'method, mock_method, call_method, arguments',
781726
[

tests/aio/test_async_client.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ def test_clone():
6464
and async_client.current_item() == cloned.current_item()
6565

6666

67-
@pytest.mark.skipif(sys.version_info < (3, 8),
68-
reason='the test requires AsyncMock which was introduced in Python 3.8')
6967
@pytest.mark.asyncio
7068
async def test_start_launch():
7169
aio_client = mock.AsyncMock()
@@ -92,8 +90,6 @@ async def test_start_launch():
9290
assert kwargs.get('rerun_of') == rerun_of
9391

9492

95-
@pytest.mark.skipif(sys.version_info < (3, 8),
96-
reason='the test requires AsyncMock which was introduced in Python 3.8')
9793
@pytest.mark.parametrize(
9894
'launch_uuid, method, params',
9995
[
@@ -154,8 +150,6 @@ async def test_launch_uuid_usage(launch_uuid, method, params):
154150
assert args[i + 1] == param
155151

156152

157-
@pytest.mark.skipif(sys.version_info < (3, 8),
158-
reason='the test requires AsyncMock which was introduced in Python 3.8')
159153
@pytest.mark.asyncio
160154
async def test_start_item_tracking(async_client: AsyncRPClient):
161155
aio_client = async_client.client
@@ -174,8 +168,6 @@ async def test_start_item_tracking(async_client: AsyncRPClient):
174168
assert async_client.current_item() is None
175169

176170

177-
@pytest.mark.skipif(sys.version_info < (3, 8),
178-
reason='the test requires AsyncMock which was introduced in Python 3.8')
179171
@pytest.mark.asyncio
180172
async def test_logs_flush_on_close(async_client: AsyncRPClient):
181173
# noinspection PyTypeChecker

0 commit comments

Comments
 (0)