Skip to content

Commit 33d6afc

Browse files
Merge pull request #6 from superstreamlabs/master
release
2 parents 61615a4 + b6eb656 commit 33d6afc

File tree

14 files changed

+604
-207
lines changed

14 files changed

+604
-207
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ venv/
22
__pycache__/
33
*.py[cod]
44
*$py.class
5-
superclient.egg-info
65
build/
7-
dist/
6+
dist/
7+
superstream_clients.egg-info/

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This installs the package in "editable" mode and enables automatic loading, whic
4242
## Uninstallation
4343

4444
```bash
45-
pip uninstall superclient && find venv/lib/python*/site-packages -name "superclient-init.pth" -delete && rm -rf build/ dist/ superclient.egg-info/ && find . -name "*.pyc" -delete && find . -name "__pycache__" -type d -exec rm -rf {} +
45+
pip uninstall superstream-clients && find venv/lib/python*/site-packages -name "superclient-init.pth" -delete && rm -rf build/ dist/ superstream_clients.egg-info/ && find . -name "*.pyc" -delete && find . -name "__pycache__" -type d -exec rm -rf {} +
4646
```
4747

4848
This single command:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The Superstream library needs to modify your producer's configuration to apply o
8080
## Installation
8181

8282
```bash
83-
pip install superclient && python -m superclient install_pth
83+
pip install superstream-clients && python -m superclient install_pth
8484
```
8585

8686
That's it! Superclient will now automatically load and optimize all Kafka producers in your Python environment.
@@ -114,7 +114,7 @@ When using Superstream Clients with containerized applications, include the pack
114114
FROM python:3.8-slim
115115

116116
# Install superclient
117-
RUN pip install superclient
117+
RUN pip install superstream-clients
118118
RUN python -m superclient install_pth
119119

120120
# Your application code

examples/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
kafka-python==2.0.2
1+
kafka-python==2.2.14
22
confluent-kafka==2.3.0
33
aiokafka==0.10.0
44
aws-msk-iam-sasl-signer-python==1.0.2

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "superstream-clients"
7-
version = "0.1.0"
7+
version = "0.1.5"
88
description = "Superstream optimisation library for Kafka producers"
99
authors = [{name = "Superstream Labs", email = "[email protected]"}]
1010
license = "Apache-2.0"

superclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from importlib.metadata import PackageNotFoundError, version as _pkg_version
22

33
try:
4-
__version__ = _pkg_version("superclient")
4+
__version__ = _pkg_version("superstream-clients")
55
except PackageNotFoundError:
66
# Fallback for when the package isn't installed (e.g. running from source without editable install)
77
__version__ = "0.0.0"

superclient/agent/__init__.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
set_debug_enabled(True)
2020

2121
logger = get_logger("agent")
22-
logger.info("Superstream Agent initialized with environment variables: {}", _ENV_VARS)
23-
if is_disabled():
24-
logger.warn("Superstream functionality disabled via SUPERSTREAM_DISABLED")
2522

2623
# Preserve reference to built-in import function
2724
_original_import = builtins.__import__
@@ -47,7 +44,12 @@ def _patch_module(module_name: str) -> None:
4744
# Check if Producer exists before patching
4845
confluent_module = sys.modules["confluent_kafka"]
4946
if hasattr(confluent_module, "Producer"):
50-
patch_confluent(confluent_module)
47+
# Additional check to ensure we can safely patch
48+
try:
49+
patch_confluent(confluent_module)
50+
except Exception as patch_exc:
51+
logger.error("[ERR-003] Failed to patch confluent_kafka Producer: {}", patch_exc)
52+
# Don't re-raise, just log the error
5153
except Exception as exc:
5254
logger.error("[ERR-001] Failed to patch {}: {}", module_name, exc)
5355

@@ -93,6 +95,12 @@ def initialize():
9395
2. Schedules patching of any pre-imported modules
9496
3. Starts the heartbeat thread
9597
"""
98+
99+
# Log initialization message
100+
logger.info("Superstream Agent initialized with environment variables: {}", _ENV_VARS)
101+
if is_disabled():
102+
logger.warn("Superstream functionality disabled via SUPERSTREAM_DISABLED")
103+
96104
if is_disabled():
97105
return
98106

0 commit comments

Comments
 (0)