python-paho-mqtt: update to 2.1.0
authorAlexandru Ardelean <redacted>
Sat, 4 Apr 2026 22:32:10 +0000 (01:32 +0300)
committerAlexandru Ardelean <redacted>
Mon, 6 Apr 2026 05:29:13 +0000 (08:29 +0300)
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 <redacted>
lang/python/python-paho-mqtt/Makefile
lang/python/python-paho-mqtt/test.sh [new file with mode: 0644]

index 4028dc9cf81f4950323a0be4248ddc4c8d180184..4c4c16cb8192586a11c41e3df9abaeca006d1326 100644 (file)
@@ -5,15 +5,18 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-paho-mqtt
-PKG_VERSION:=1.6.1
-PKG_RELEASE:=2
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com>, Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=EPL-2.0 Eclipse Distribution License v1.0
 PKG_LICENSE_FILES:=epl-v20 edl-v10 LICENSE.txt
 
 PYPI_NAME:=paho-mqtt
-PKG_HASH:=2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f
+PYPI_SOURCE_NAME:=paho_mqtt
+PKG_HASH:=12d6e7511d4137555a3f6ea167ae846af2c7357b10bc6fa4f7c3968fc1723834
+
+PKG_BUILD_DEPENDS:=python-hatchling/host
 
 include ../pypi.mk
 include $(INCLUDE_DIR)/package.mk
@@ -25,7 +28,7 @@ define Package/python3-paho-mqtt
   SUBMENU:=Python
   TITLE:=MQTT version 5.0/3.1.1 client class
   URL:=http://eclipse.org/paho
-  DEPENDS:=+python3-light +python3-uuid
+  DEPENDS:=+python3-light +python3-uuid +python3-logging +python3-urllib
 endef
 
 define Package/python3-paho-mqtt/description
diff --git a/lang/python/python-paho-mqtt/test.sh b/lang/python/python-paho-mqtt/test.sh
new file mode 100644 (file)
index 0000000..2815fbc
--- /dev/null
@@ -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
git clone https://git.99rst.org/PROJECT