Skip to content

Commit

Permalink
Ignore confluent_kafka imports which mypy can't check
Browse files Browse the repository at this point in the history
confluent_kafka doesn't itself publish stubs, though there is
https://pypi.org/project/confluent-kafka-stubs/. Unfortunately
that project is limited to too recent a version of Python to use,
see https://gitlab.com/theepic-dev/confluent-kafka-stubs/-/issues/1.
  • Loading branch information
PeterJCLaw committed Jul 6, 2024
1 parent 3fad237 commit b1a9f32
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mockafka/admin_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from confluent_kafka.cimpl import NewTopic, NewPartitions
from confluent_kafka.cimpl import NewTopic, NewPartitions # type: ignore[import-untyped]

from mockafka.cluster_metadata import ClusterMetadata
from mockafka.kafka_store import KafkaStore
Expand Down
2 changes: 1 addition & 1 deletion mockafka/kafka_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from __future__ import annotations

from confluent_kafka import KafkaException
from confluent_kafka import KafkaException # type: ignore[import-untyped]
from .message import Message
from copy import deepcopy

Expand Down
2 changes: 1 addition & 1 deletion mockafka/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Optional

from confluent_kafka import KafkaError
from confluent_kafka import KafkaError # type: ignore[import-untyped]


class Message:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from mockafka.admin_client import FakeAdminClientImpl, NewTopic
from mockafka.kafka_store import KafkaStore, KafkaException
from mockafka.producer import FakeProducer
from confluent_kafka import Message
from confluent_kafka import Message # type: ignore[import-untyped]


class TestFakeProducer(TestCase):
Expand Down

0 comments on commit b1a9f32

Please sign in to comment.