diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41100f4..b660222 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,30 +4,43 @@ 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 - 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 exclude: | (?x)^( tests/.* ) - repo: https://github.com/psf/black - rev: 24.10.0 + rev: '258e7dbf348bc23cb70b8cdf693481c04634ebcc' hooks: - id: black - args: [ '--check', './reportportal_client', './tests' ] + language: system + args: [ '--check' ] + files: ^(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", "reportportal_client" ] + pass_filenames: false + files: ^reportportal_client/ diff --git a/CHANGELOG.md b/CHANGELOG.md index e6dcdbf..9a1de2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog ## [Unreleased] +### Changed +- `certify` version range updated to mitigate a compromised certificate issue, by @HardNorth + +## [5.7.11] ### Added - Official `Python 3.15` support, by @HardNorth ### Changed 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/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 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/requirements-dev-lint.txt b/requirements-dev-lint.txt new file mode 100644 index 0000000..78c0336 --- /dev/null +++ b/requirements-dev-lint.txt @@ -0,0 +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 diff --git a/requirements-dev.txt b/requirements-dev.txt index c385c8a..9129bd0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,5 @@ pytest pytest-cov pytest-asyncio -black -isort types-requests -mypy==1.19.1 types-simplejson==3.20.0.20250822 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 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"] 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 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]