From ff59eced7c2a2452ee573a169d22aaa3b1a65e6e Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Mon, 25 Mar 2024 21:58:14 +0200 Subject: python3-paho-mqtt: Upgrade 1.6.1 -> 2.0.0 Upgrade to version 2.0.0: - **BREAKING** Added callback_api_version. This break *ALL* users of paho-mqtt Client class. See migrations.md for details on how to upgrade. tl; dr; add CallbackAPIVersion.VERSION1 to first argument of Client() - **BREAKING** Drop support for Python 2.7, Python 3.5 and Python 3.6. Minimum tested version is Python 3.7. Python version up to Python 3.12 are tested. - **BREAKING** connect_srv changed it signature to take an additional bind_port parameter. This is a breaking change, but in previous version connect_srv was broken anyway. - **BREAKING** Remove some deprecated argument and method: * ``max_packets`` argument in loop(), loop_write() and loop_forever() is removed * ``force`` argument in loop_stop() is removed * method ``message_retry_set()`` is removed - **BREAKING** Remove the base62, WebsocketWrapper and ConnectionState, as user shouldn't directly use them. - Possible breaking change: Add properties to access most Client attribute. Since this add new properties like `logger`, if a sub-class defined `logger`, the two `logger` will conflict. - Add version 2 of user-callback which allow to access MQTTv5 reason code & properties that were missing from on_publish callback. Also it's more consistent in parameter order or between MQTTv3 and MQTTv5. - Add types to Client class, which caused few change which should be compatible. Known risk of breaking changes: - Use enum for returned error code (like MQTT_ERR_SUCCESS). It use an IntEnum which should be a drop-in replacement. Excepted if someone is doing "rc is 0" instead of "rc == 0". - reason in on_connect callback when using MQTTv5 is now always a ReasonCode object. It used to possibly be an integer with the value 132. - MQTTMessage field "dup" and "retain" used to be integer with value 0 and 1. They are now boolean. - Add support for ALPN protocols on TLS connection. - Add on_pre_connect() callback, which is called immediately before a connection attempt is made. - Fix subscribe.simple with MQTTv5. - Use better name for thread started by loop_start. - Fix possible bug during disconnection where self._sock is unexpectedly None. - Fix loading too weak TLS CA file but setting allowed ciphers before loading CA. - Allow to manually ack QoS > 0 messages. - Improve tests & linters. Modernize build (drop setup.py, use pyproject.toml) - Fix is_connected property to correctly return False when connection is lost and loop_start/loop_forever isn't used. - Fix wait_for_publish that could hang with QoS == 0 message on reconnection or publish during connection. - Correctly mark connection as broken on SSL error and don't crash loop_forever. - Fix handling of MQTT v5.0 PUBREL messages with remaining length not equal to 2. - Raise error on ``subscribe()`` when `topic` is an empty list. - Raise error on `publish.multiple()` when ``msgs`` is an empty list. - Don't add port to Host: header for websockets connections when the port if the default port. Signed-off-by: Leon Anavi Signed-off-by: Khem Raj --- .../python/python3-paho-mqtt_1.6.1.bb | 33 ------------------- .../python/python3-paho-mqtt_2.0.0.bb | 37 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 33 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python3-paho-mqtt_1.6.1.bb create mode 100644 meta-python/recipes-devtools/python/python3-paho-mqtt_2.0.0.bb diff --git a/meta-python/recipes-devtools/python/python3-paho-mqtt_1.6.1.bb b/meta-python/recipes-devtools/python/python3-paho-mqtt_1.6.1.bb deleted file mode 100644 index 9055772b5..000000000 --- a/meta-python/recipes-devtools/python/python3-paho-mqtt_1.6.1.bb +++ /dev/null @@ -1,33 +0,0 @@ -SUMMARY = "MQTT version 3.1/3.1.1 client library" -LICENSE = "EPL-1.0 | EDL-1.0" -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8e5f264c6988aec56808a3a11e77b913 \ - file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \ -" -SRCNAME = "paho-mqtt" - -inherit pypi setuptools3 - -SRC_URI[sha256sum] = "2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f" - -DEPENDS += "python3-pytest-runner-native" - -do_install:append() { - install -d -m0755 ${D}${datadir}/${BPN}/examples - cp --preserve=mode,timestamps -R ${S}/examples/* ${D}${datadir}/${BPN}/examples -} - -PACKAGES =+ "${PN}-examples" - -RDEPENDS:${PN}-examples += "${PN} python3-core" - -FILES:${PN}-examples = "${datadir}/${BPN}/examples" - -RDEPENDS:${PN} = "\ - python3-io \ - python3-logging \ - python3-math \ - python3-netclient \ - python3-threading \ -" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-python/recipes-devtools/python/python3-paho-mqtt_2.0.0.bb b/meta-python/recipes-devtools/python/python3-paho-mqtt_2.0.0.bb new file mode 100644 index 000000000..e4cf77a13 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-paho-mqtt_2.0.0.bb @@ -0,0 +1,37 @@ +SUMMARY = "MQTT version 3.1/3.1.1 client library" +LICENSE = "EPL-1.0 | EDL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8e5f264c6988aec56808a3a11e77b913 \ + file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \ +" +SRCNAME = "paho-mqtt" + +inherit pypi python_hatchling python_setuptools_build_meta + +SRC_URI[sha256sum] = "13b205f29251e4f2c66a6c923c31fc4fd780561e03b2d775cff8e4f2915cf947" + +PYPI_SRC_URI = "https://files.pythonhosted.org/packages/73/b7/a4df0f93bbdae237e16ba402752151eceee576cbe80c235a2475fbf81eea/paho_mqtt-${PV}.tar.gz" + +S = "${WORKDIR}/paho_mqtt-${PV}" + +DEPENDS += "python3-pytest-runner-native" + +do_install:append() { + install -d -m0755 ${D}${datadir}/${BPN}/examples + cp --preserve=mode,timestamps -R ${S}/examples/* ${D}${datadir}/${BPN}/examples +} + +PACKAGES =+ "${PN}-examples" + +RDEPENDS:${PN}-examples += "${PN} python3-core" + +FILES:${PN}-examples = "${datadir}/${BPN}/examples" + +RDEPENDS:${PN} = "\ + python3-io \ + python3-logging \ + python3-math \ + python3-netclient \ + python3-threading \ +" + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf