Skip to content

Commit 2d740a3

Browse files
committed
Remove setup.cfg and update dependencies to align with Python version upgrades
1 parent e2f0bcb commit 2d740a3

File tree

19 files changed

+1269
-1226
lines changed

19 files changed

+1269
-1226
lines changed

.github/workflows/actions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-22.04
88
strategy:
99
matrix:
10-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
10+
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
1111

1212
steps:
1313
- name: Setup dependencies
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-22.04
2525
strategy:
2626
matrix:
27-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
27+
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
2828

2929
steps:
3030
- name: Setup dependencies

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
_Shows logs when you need it_
44

5+
## Requirements
6+
7+
- Python 3.10+
8+
59

610
## Проблема/решение
711

poetry.lock

Lines changed: 1017 additions & 1082 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pybotx_smart_logger/contextvars.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
"""Contextvars for smart_logger."""
22

33
from contextvars import ContextVar
4-
from typing import Optional
54

65
from pybotx_smart_logger.schemas import AccumulatedLogs
76

8-
_accumulated_logs_var: ContextVar[Optional[AccumulatedLogs]] = ContextVar(
7+
_accumulated_logs_var: ContextVar[AccumulatedLogs | None] = ContextVar(
98
"accumulated_logs",
109
default=None,
1110
)

pybotx_smart_logger/log_levels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
TRACE = "TRACE"
44
DEBUG = "DEBUG"
5-
INFO = "INFO" # noqa: WPS110
5+
INFO = "INFO"
66
SUCCESS = "SUCCESS"
77
WARNING = "WARNING"
88
ERROR = "ERROR"

pybotx_smart_logger/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""Prints logs only if exception was raised while processing message."""
22

33
import inspect
4+
from datetime import datetime
45
from typing import Any
56

67
from loguru import logger
7-
from loguru._datetime import datetime # noqa: WPS436
88

99
from pybotx_smart_logger import log_levels
1010
from pybotx_smart_logger.contextvars import (

pybotx_smart_logger/schemas.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
"""Schemas for smart logger internals."""
22

33
from dataclasses import dataclass
4+
from datetime import datetime
45
from typing import Any
56

6-
from loguru._datetime import datetime # noqa: WPS436
7-
87

98
@dataclass
109
class LogEntry:

pybotx_smart_logger/wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import AsyncGenerator, Callable
12
from contextlib import asynccontextmanager
2-
from typing import AsyncGenerator, Callable
33

44
from loguru import logger
55

pyproject.toml

Lines changed: 63 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,69 @@ authors = ["Alexander Samoylenko <alexandr.samojlenko@ccsteam.ru>"]
66
readme = "README.md"
77

88
[tool.poetry.dependencies]
9-
python = ">=3.9, <3.14"
10-
11-
loguru = ">=0.6.0,<0.7.0"
12-
13-
[tool.poetry.dev-dependencies]
14-
add-trailing-comma = "3.1.0"
15-
autoflake = "2.3.1"
16-
black = "25.1.0"
17-
isort = "6.0.1"
18-
mypy = "1.15.0"
19-
wemake-python-styleguide = "0.19.2"
20-
bandit = "1.8.3"
21-
22-
pytest = "^8.3.5"
23-
pytest-asyncio = "^0.26.0"
24-
pytest-cov = "^6.1.1"
25-
requests = "^2.32.3"
26-
27-
fastapi = ">=0.70.0,<0.116.0"
28-
pybotx = ">=0.75.0,<1.0.0"
9+
python = ">=3.10, <3.14"
10+
11+
loguru = ">=0.7.3,<0.8.0"
12+
13+
[tool.poetry.group.dev.dependencies]
14+
mypy = "^1.19.1"
15+
bandit = "^1.9.3"
16+
17+
pytest = "^9.0.2"
18+
pytest-asyncio = "^1.3.0"
19+
pytest-cov = "^7.0.0"
20+
pytest-xdist = "^3.8.0"
21+
pytest-mock = "^3.15.1"
22+
freezegun = "^1.5.5"
23+
factory-boy = "^3.3.3"
24+
faker = "^40.4.0"
25+
requests = "^2.32.5"
26+
ruff = "^0.15.1"
27+
28+
fastapi = "^0.129.0"
29+
pybotx = ">=0.76.0,<1.0.0"
30+
pybotx-smartapp-rpc = "^0.13.0"
31+
32+
[tool.ruff]
33+
line-length = 88
34+
target-version = "py310"
35+
36+
[tool.ruff.lint]
37+
select = [
38+
"E",
39+
"F",
40+
"I",
41+
"B",
42+
"UP",
43+
]
44+
45+
[tool.ruff.lint.per-file-ignores]
46+
"tests/*" = ["S101"]
47+
48+
[tool.pytest.ini_options]
49+
testpaths = ["tests"]
50+
asyncio_mode = "auto"
51+
asyncio_default_fixture_loop_scope = "function"
52+
addopts = """
53+
--strict-markers
54+
--tb=short
55+
--cov=pybotx_smart_logger
56+
--cov-report=term-missing
57+
--cov-branch
58+
--no-cov-on-fail
59+
--cov-fail-under=100
60+
"""
61+
62+
[tool.mypy]
63+
plugins = ["pydantic.mypy"]
64+
disallow_untyped_defs = true
65+
warn_redundant_casts = true
66+
warn_unused_ignores = true
67+
show_error_codes = true
68+
69+
[[tool.mypy.overrides]]
70+
module = ["pytest.*"]
71+
ignore_missing_imports = true
2972

3073
[build-system]
3174
requires = ["poetry>=1.2.0"]

scripts/docs-lint

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ mkdir "${snippets_dir_path}"
99

1010
python scripts/collect_snippets.py
1111

12-
isort --profile black --check-only "${snippets_dir_path}"
13-
black --check --diff "${snippets_dir_path}"
12+
ruff format --check "${snippets_dir_path}"
13+
ruff check --ignore-noqa --select E,F,I,B "${snippets_dir_path}"
1414
mypy "${snippets_dir_path}"
15-
flake8 "${snippets_dir_path}"
1615

1716
rm -rf "${snippets_dir_path}"

0 commit comments

Comments
 (0)