Skip to content

Commit 82f9396

Browse files
committed
Drop python 3.8 and update code
1 parent 69f2555 commit 82f9396

File tree

7 files changed

+19
-134
lines changed

7 files changed

+19
-134
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- id: mixed-line-ending
99

1010
- repo: https://github.com/pycqa/isort
11-
rev: 5.13.2
11+
rev: 6.0.1
1212
hooks:
1313
- id: isort
1414
name: isort (python)
@@ -20,7 +20,7 @@ repos:
2020
types: [pyi]
2121

2222
- repo: https://github.com/psf/black
23-
rev: 24.8.0
23+
rev: 25.1.0
2424
hooks:
2525
- id: black
2626
# It is recommended to specify the latest version of Python
@@ -30,7 +30,7 @@ repos:
3030

3131
- repo: https://github.com/astral-sh/ruff-pre-commit
3232
# Ruff version.
33-
rev: v0.6.3
33+
rev: v0.11.8
3434
hooks:
3535
- id: ruff
3636
args: [ --fix, --exit-non-zero-on-fix ]

logwrap/log_on_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def max_iter(self, value: int) -> None:
654654
self.__max_iter = value
655655

656656
@property
657-
def __name__(self) -> str: # noqa: A003,PLW3201,RUF100
657+
def __name__(self) -> str: # type: ignore[override] # noqa: A003,PLW3201,RUF100
658658
"""Name getter.
659659
660660
:return: attribute name (may be overridden)

logwrap/repr_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ def parameter(self) -> Parameter:
160160
return self._parameter
161161

162162
@property
163-
def name(self) -> None | str:
163+
def name(self) -> str | None:
164164
"""Parameter name.
165165
166166
:return: parameter name. For `*args` and `**kwargs` add corresponding prefixes
167-
:rtype: None | str
167+
:rtype: str | None
168168
"""
169169
if self.kind == Parameter.VAR_POSITIONAL:
170170
return "*" + self.parameter.name

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build-backend="setuptools.build_meta"
1111
[project]
1212
name = "logwrap"
1313
description = "Decorator for logging function arguments and return value by human-readable way"
14-
requires-python = ">=3.8.0"
14+
requires-python = ">=3.9.0"
1515
keywords = ["logging", "debugging", "development"]
1616
license={text="Apache-2.0"} # Use SPDX classifier
1717
readme = {file = "README.rst", content-type = "text/x-rst"}
@@ -58,7 +58,7 @@ write_to = "logwrap/_version.py"
5858

5959
[tool.black]
6060
line-length = 120
61-
target-version = ["py38"]
61+
target-version = ["py39"]
6262

6363
[tool.isort]
6464
line_length = 120
@@ -96,6 +96,7 @@ addopts = "-vvv -s -p no:django -p no:ipdb"
9696
testpaths = ["test"]
9797
mock_use_standalone_module = false
9898
junit_family = "xunit2"
99+
asyncio_default_fixture_loop_scope = "function"
99100

100101
[tool.coverage.run]
101102
omit = ["test/*"]
@@ -141,7 +142,7 @@ pretty_print = true
141142
[tool.ruff]
142143
line-length = 120
143144
output-format = "full"
144-
target-version = "py38"
145+
target-version = "py39"
145146

146147
[tool.ruff.lint]
147148
extend-select = [
@@ -188,15 +189,15 @@ convention = "pep257"
188189
docstring-code-format = true
189190

190191
[tool.refurb]
191-
python_version = "3.8"
192+
python_version = "3.9"
192193
enable_all = true
193194
ignore = ["FURB120"]
194195

195196
[tool.pylint]
196197
extension-pkg-whitelist = ["lxml.etree"]
197198
ignore = ["CVS", "_version.py"]
198199
jobs = 0
199-
py-version = "3.8"
200+
py-version = "3.9"
200201

201202
load-plugins = [
202203
"pylint.extensions.docparams",

setup.py

Lines changed: 0 additions & 111 deletions
This file was deleted.

test/test_log_wrap_py35.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
class TestLogWrapAsync(unittest.TestCase):
3030
"""async def differs from asyncio.coroutine."""
3131

32-
@classmethod
33-
def setUpClass(cls):
34-
"""Global preparation for tests (run once per class)."""
35-
cls.loop = asyncio.get_event_loop()
36-
3732
def setUp(self):
3833
"""Preparation for tests.
3934
@@ -58,7 +53,7 @@ def test_coroutine_async(self):
5853
async def func():
5954
pass
6055

61-
self.loop.run_until_complete(func())
56+
asyncio.run(func())
6257
self.assertEqual(
6358
"DEBUG>Awaiting: \nfunc()\nDEBUG>Done: 'func' with result:\nNone\n",
6459
self.stream.getvalue(),
@@ -73,7 +68,7 @@ def test_coroutine_async_as_argumented(self):
7368
async def func():
7469
pass
7570

76-
self.loop.run_until_complete(func())
71+
asyncio.run(func())
7772

7873
self.assertEqual(
7974
[
@@ -89,7 +84,7 @@ async def func():
8984
raise Exception("Expected")
9085

9186
with self.assertRaises(Exception): # noqa: B017
92-
self.loop.run_until_complete(func())
87+
asyncio.run(func())
9388

9489
self.assertEqual(
9590
"DEBUG>Awaiting: \nfunc()\nERROR>Failed: \nfunc()\nTraceback (most recent call last):",
@@ -106,7 +101,7 @@ async def func():
106101
raise TypeError("Blacklisted")
107102

108103
with self.assertRaises(TypeError):
109-
self.loop.run_until_complete(func())
104+
asyncio.run(func())
110105

111106
# While we're not expanding result coroutine object from namespace,
112107
# do not check execution result

test/test_repr_utils_special.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class MyDict(dict):
3636
self.assertEqual("{\n key: value,\n}", logwrap.pretty_str(val))
3737

3838
def test_002_typing_specific_dict(self):
39-
class MyDict(typing.Dict[str, str]):
39+
class MyDict(dict[str, str]):
4040
"""Dict subclass."""
4141

4242
val = MyDict(key="value")
@@ -45,7 +45,7 @@ class MyDict(typing.Dict[str, str]):
4545
self.assertEqual("{\n key: value,\n}", logwrap.pretty_str(val))
4646

4747
def test_003_typing_specific_dict_repr_override(self):
48-
class MyDict(typing.Dict[str, str]):
48+
class MyDict(dict[str, str]):
4949
"""Dict subclass."""
5050

5151
def __repr__(self) -> str:

0 commit comments

Comments
 (0)