mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
python-paho-mqtt: update to 2.1.0
Update package to 2.1.0. This is a major version bump with API changes including new callback signatures. Add PYPI_SOURCE_NAME since PyPI switched sdist filename to use underscores (paho_mqtt-2.1.0.tar.gz). Add PKG_BUILD_DEPENDS for python-hatchling since upstream switched build backend from setuptools to hatchling. Add test.sh to verify basic client functionality. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
e05e7ab598
commit
3e548ca574
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = python3-paho-mqtt ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
# Verify version
|
||||
assert hasattr(mqtt, '__version__') or hasattr(mqtt.Client, '__module__')
|
||||
|
||||
# Test basic client instantiation
|
||||
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)
|
||||
assert client is not None
|
||||
|
||||
# Test that the client has expected methods
|
||||
assert callable(getattr(client, 'connect', None))
|
||||
assert callable(getattr(client, 'publish', None))
|
||||
assert callable(getattr(client, 'subscribe', None))
|
||||
assert callable(getattr(client, 'disconnect', None))
|
||||
|
||||
# Test MQTTMessage
|
||||
msg = mqtt.MQTTMessage(topic=b'test/topic')
|
||||
msg.payload = b'hello'
|
||||
assert msg.topic == 'test/topic'
|
||||
assert msg.payload == b'hello'
|
||||
|
||||
print("paho-mqtt OK")
|
||||
EOF
|
||||
Reference in New Issue
Block a user