Skip to content

Commit 649abf4

Browse files
committed
Dependencies update, fixed some lints.
Signed-off-by: Pavel Kirilin <win10@list.ru>
1 parent 8ff849d commit 649abf4

7 files changed

Lines changed: 304 additions & 466 deletions

File tree

.flake8

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@ ignore =
9191
; Do not perform function calls in argument defaults.
9292
B008,
9393

94-
; all init files
95-
__init__.py:
96-
; ignore not used imports
97-
F401,
98-
; ignore import with wildcard
99-
F403,
100-
; Found wrong metadata variable
101-
WPS410,
102-
10394
per-file-ignores =
10495
; all tests
10596
test_*.py,tests.py,tests_*.py,*/tests/*:
@@ -116,6 +107,15 @@ per-file-ignores =
116107
; Found outer scope names shadowing
117108
tests/conftest.py: WPS442
118109

110+
; all init files
111+
__init__.py:
112+
; ignore not used imports
113+
F401,
114+
; ignore import with wildcard
115+
F403,
116+
; Found wrong metadata variable
117+
WPS410,
118+
119119
exclude =
120120
./.git,
121121
./venv,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async def test() -> None:
1515

1616
## Non-obvious things
1717

18-
You can configure kafka producer and consumer with special methods `configure_producer` and `configure_consumer`.
18+
You can configure kafka producer and consumer with special methods `configure_producer` and `configure_consumer`.
1919
Example:
2020
```python
2121
from taskiq_aio_kafka import AioKafkaBroker

poetry.lock

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

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ keywords = ["taskiq", "tasks", "distributed", "async", "kafka", "aiokafka"]
2424
packages = [{ include = "taskiq_aio_kafka" }]
2525

2626
[tool.poetry.dependencies]
27-
python = "^3.7"
27+
python = "^3.8.1"
2828
taskiq = "^0"
2929
aiokafka = "^0.8.0"
3030
pydantic = "^1.10.7"
3131

3232
[tool.poetry.group.dev.dependencies]
3333
pytest = "^7.1.2"
34-
flake8 = "^4.0.1"
34+
flake8 = "^6"
3535
isort = "^5.10.1"
3636
mypy = "^1.2.0"
3737
pre-commit = "^2.20.0"
3838
yesqa = "^1.3.0"
3939
autoflake = "^1.4"
40-
wemake-python-styleguide = "^0.16.1"
40+
wemake-python-styleguide = "^0.18.0"
4141
coverage = "^6.4.2"
4242
pytest-cov = "^3.0.0"
4343
mock = "^4.0.3"

taskiq_aio_kafka/broker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import pickle # noqa: S403
32
from logging import getLogger
43
from typing import Any, AsyncGenerator, Callable, List, Optional, Set, TypeVar, Union
54

taskiq_aio_kafka/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ class KafkaProducerParameters(BaseModel):
4040
class KafkaConsumerParameters(BaseModel):
4141
"""Parameters to kafka consumer."""
4242

43-
client_id: str = "aiokafka-" + __version__ # noqa: WPS336
43+
client_id: str = f"aiokafka-{__version__}"
4444
group_id: Optional[str] = None
4545
key_deserializer: Optional[Callable[..., Any]] = None
4646
value_deserializer: Optional[Callable[..., Any]] = None
4747
fetch_max_wait_ms: int = 500
4848
fetch_max_bytes: int = 52428800
4949
fetch_min_bytes: int = 1
50-
max_partition_fetch_bytes: int = 1 * 1024 * 1024 # noqa: WPS345
51-
request_timeout_ms: int = 40 * 1000 # noqa: WPS432
50+
max_partition_fetch_bytes: int = 1024 * 1024
51+
request_timeout_ms: int = 40000
5252
retry_backoff_ms: int = 100
5353
auto_offset_reset: str = "latest"
5454
enable_auto_commit: bool = True

tests/test_broker.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import asyncio
2-
import pickle # noqa: S403
2+
import pickle
33
from typing import Dict, List
44
from uuid import uuid4
55

@@ -17,7 +17,7 @@ async def get_first_task(broker: AioKafkaBroker) -> bytes: # type: ignore
1717
1818
:returns: first message from listen method
1919
"""
20-
async for message in broker.listen(): # noqa: WPS328
20+
async for message in broker.listen():
2121
return message
2222

2323

@@ -65,13 +65,13 @@ async def test_startup(
6565
:param broker_without_arguments: broker.
6666
:param base_topic_name: base topic name.
6767
"""
68-
assert broker_without_arguments._aiokafka_consumer # noqa: WPS437
69-
assert broker_without_arguments._aiokafka_producer # noqa: WPS437
70-
assert broker_without_arguments._kafka_admin_client # noqa: WPS437
68+
assert broker_without_arguments._aiokafka_consumer
69+
assert broker_without_arguments._aiokafka_producer
70+
assert broker_without_arguments._kafka_admin_client
7171

7272
all_kafka_topics: List[
7373
str
74-
] = broker_without_arguments._kafka_admin_client.list_topics() # noqa: WPS437
74+
] = broker_without_arguments._kafka_admin_client.list_topics()
7575

7676
assert broker_without_arguments._kafka_topic.name in all_kafka_topics
7777

0 commit comments

Comments
 (0)