Skip to content

Commit 2238311

Browse files
committed
Merge branch 'release/0.2.0'
2 parents b6a691b + 7563395 commit 2238311

File tree

8 files changed

+318
-479
lines changed

8 files changed

+318
-479
lines changed

.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,

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
pytest:
3030
services:
3131
zookeeper:
32-
image: bitnami/zookeeper
32+
image: bitnami/zookeeper:3.8.1
3333
ports:
3434
- 2181:2181
3535
env:
@@ -40,7 +40,7 @@ jobs:
4040
--health-timeout 5s
4141
--health-retries 5
4242
kafka:
43-
image: bitnami/kafka
43+
image: bitnami/kafka:3.4.1
4444
ports:
4545
- 9092:9092
4646
options: >-
@@ -53,13 +53,14 @@ jobs:
5353
ALLOW_PLAINTEXT_LISTENER: yes
5454
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
5555
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
56+
KAFKA_ENABLE_KRAFT: "no"
5657
permissions:
5758
checks: write
5859
pull-requests: write
5960
contents: write
6061
strategy:
6162
matrix:
62-
py_version: ["3.7", "3.8", "3.9", "3.10"]
63+
py_version: ["3.8", "3.9", "3.10", "3.11"]
6364
os: [ubuntu-latest]
6465
runs-on: "${{ matrix.os }}"
6566
steps:

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: 290 additions & 451 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ name = "taskiq-aio-kafka"
33
description = "Kafka broker for taskiq"
44
authors = ["Taskiq team <[email protected]>"]
55
maintainers = ["Taskiq team <[email protected]>"]
6-
version = "0.1.2"
6+
version = "0.2.0"
77
readme = "README.md"
88
license = "LICENSE"
99
classifiers = [
1010
"Typing :: Typed",
1111
"Programming Language :: Python",
1212
"Programming Language :: Python :: 3",
1313
"Programming Language :: Python :: 3 :: Only",
14-
"Programming Language :: Python :: 3.7",
1514
"Programming Language :: Python :: 3.8",
1615
"Programming Language :: Python :: 3.9",
1716
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
1818
"Operating System :: OS Independent",
1919
"Intended Audience :: Developers",
2020
"Topic :: System :: Networking",
@@ -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)