pytest-kafka-broker 0.0.0__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/.gitignore +3 -2
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/.gitlab-ci.yml +4 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/PKG-INFO +3 -1
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/pyproject.toml +12 -0
- pytest_kafka_broker-0.0.0/src/pytest_kafka_broker.py → pytest_kafka_broker-0.2.0/src/pytest_kafka_broker/__init__.py +9 -11
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/PKG-INFO +3 -1
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/SOURCES.txt +2 -1
- pytest_kafka_broker-0.2.0/tests/__init__.py +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/.pre-commit-config.yaml +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/.readthedocs.yml +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/README.md +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/docs/Makefile +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/docs/conf.py +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/docs/index.rst +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/docs/make.bat +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/setup.cfg +0 -0
- /pytest_kafka_broker-0.0.0/tests/__init__.py → /pytest_kafka_broker-0.2.0/src/pytest_kafka_broker/py.typed +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/dependency_links.txt +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/entry_points.txt +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/requires.txt +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/top_level.txt +0 -0
- {pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/tests/test_kafka.py +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-kafka-broker
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Pytest plugin to run a single-broker Kafka cluster
|
|
5
5
|
Author-email: Leo Singer <leo.singer@ligo.org>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: source, https://git.ligo.org/ultra-swift/pytest-kafka-broker
|
|
8
|
+
Project-URL: documentation, https://pytest-kafka-broker.readthedocs.io/
|
|
7
9
|
Classifier: Framework :: Pytest
|
|
8
10
|
Classifier: Topic :: System :: Networking
|
|
9
11
|
Requires-Python: >=3.11
|
|
@@ -31,3 +31,15 @@ docs = [
|
|
|
31
31
|
"sphinx-astropy[confv2]",
|
|
32
32
|
"sphinx-automodapi>=0.20.0",
|
|
33
33
|
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
source = "https://git.ligo.org/ultra-swift/pytest-kafka-broker"
|
|
37
|
+
documentation = "https://pytest-kafka-broker.readthedocs.io/"
|
|
38
|
+
|
|
39
|
+
[tool.mypy]
|
|
40
|
+
exclude = [
|
|
41
|
+
"^docs/conf.py$",
|
|
42
|
+
]
|
|
43
|
+
exclude_gitignore = true
|
|
44
|
+
|
|
45
|
+
[tool.setuptools_scm]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import subprocess
|
|
3
|
+
from collections.abc import AsyncGenerator
|
|
3
4
|
from dataclasses import dataclass
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
from tarfile import TarFile
|
|
@@ -8,8 +9,8 @@ from uuid import uuid4
|
|
|
8
9
|
|
|
9
10
|
import pytest
|
|
10
11
|
import pytest_asyncio
|
|
11
|
-
from astropy.config import get_cache_dir_path
|
|
12
|
-
from astropy.utils.data import get_readable_fileobj
|
|
12
|
+
from astropy.config import get_cache_dir_path # type: ignore[import-untyped]
|
|
13
|
+
from astropy.utils.data import get_readable_fileobj # type: ignore[import-untyped]
|
|
13
14
|
from confluent_kafka import Consumer, Producer
|
|
14
15
|
from confluent_kafka.aio import AIOConsumer, AIOProducer
|
|
15
16
|
from rich.status import Status
|
|
@@ -24,7 +25,7 @@ SCALA_VERSION = "2.13"
|
|
|
24
25
|
KAFKA_VERSION = "4.1.1"
|
|
25
26
|
|
|
26
27
|
|
|
27
|
-
async def wait_port(port: int, timeout: float = 0.25):
|
|
28
|
+
async def wait_port(port: int, timeout: float = 0.25) -> None:
|
|
28
29
|
"""Wait until a connection is detected listening on the given port."""
|
|
29
30
|
while True:
|
|
30
31
|
try:
|
|
@@ -83,7 +84,7 @@ class KafkaBrokerContext:
|
|
|
83
84
|
bootstrap_server: str
|
|
84
85
|
"""Kafka bootstrap server in the form :samp:`{host}:{port}`."""
|
|
85
86
|
|
|
86
|
-
def config(self, config: dict | None = None):
|
|
87
|
+
def config(self, config: dict | None = None) -> dict:
|
|
87
88
|
return {**(config or {}), "bootstrap.servers": self.bootstrap_server}
|
|
88
89
|
|
|
89
90
|
def producer(self, config: dict | None = None) -> Producer:
|
|
@@ -113,13 +114,10 @@ del _doc
|
|
|
113
114
|
|
|
114
115
|
|
|
115
116
|
@pytest_asyncio.fixture
|
|
116
|
-
async def kafka_broker(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-------
|
|
121
|
-
: KafkaBrokerContext
|
|
122
|
-
"""
|
|
117
|
+
async def kafka_broker(
|
|
118
|
+
kafka_home, tmp_path, unused_tcp_port_factory
|
|
119
|
+
) -> AsyncGenerator[KafkaBrokerContext]:
|
|
120
|
+
"""Pytest fixture to run a local, temporary Kafka broker."""
|
|
123
121
|
kafka_storage = kafka_home / "bin" / "kafka-storage.sh"
|
|
124
122
|
kafka_server_start = kafka_home / "bin" / "kafka-server-start.sh"
|
|
125
123
|
config_path = tmp_path / "server.properties"
|
{pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/PKG-INFO
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-kafka-broker
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Pytest plugin to run a single-broker Kafka cluster
|
|
5
5
|
Author-email: Leo Singer <leo.singer@ligo.org>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: source, https://git.ligo.org/ultra-swift/pytest-kafka-broker
|
|
8
|
+
Project-URL: documentation, https://pytest-kafka-broker.readthedocs.io/
|
|
7
9
|
Classifier: Framework :: Pytest
|
|
8
10
|
Classifier: Topic :: System :: Networking
|
|
9
11
|
Requires-Python: >=3.11
|
{pytest_kafka_broker-0.0.0 → pytest_kafka_broker-0.2.0}/src/pytest_kafka_broker.egg-info/SOURCES.txt
RENAMED
|
@@ -8,7 +8,8 @@ docs/Makefile
|
|
|
8
8
|
docs/conf.py
|
|
9
9
|
docs/index.rst
|
|
10
10
|
docs/make.bat
|
|
11
|
-
src/pytest_kafka_broker.py
|
|
11
|
+
src/pytest_kafka_broker/__init__.py
|
|
12
|
+
src/pytest_kafka_broker/py.typed
|
|
12
13
|
src/pytest_kafka_broker.egg-info/PKG-INFO
|
|
13
14
|
src/pytest_kafka_broker.egg-info/SOURCES.txt
|
|
14
15
|
src/pytest_kafka_broker.egg-info/dependency_links.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|