Skip to contentSkip to conversation

python-paho-mqtt: add new package

PATCH Superseded Davide Viti 5 participants 7 messages Dec 28, 2015 – Jan 1, 2016

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python-paho-mqtt: add new package

---
 package/Config.in                              |  1 +
 package/python-paho-mqtt/Config.in             |  9 +++++++++
 package/python-paho-mqtt/python-paho-mqtt.hash |  2 ++
 package/python-paho-mqtt/python-paho-mqtt.mk   | 21 +++++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 package/python-paho-mqtt/Config.in
 create mode 100644 package/python-paho-mqtt/python-paho-mqtt.hash
 create mode 100644 package/python-paho-mqtt/python-paho-mqtt.mk
package/Config.in +1 -0
index dd44743..aab1958 100644
@@ -659,6 +659,7 @@ menu "External python modules"
 	source "package/python-networkmanager/Config.in"
 	source "package/python-nfc/Config.in"
 	source "package/python-numpy/Config.in"
+	source "package/python-paho-mqtt/Config.in"
 	source "package/python-pam/Config.in"
 	source "package/python-posix-ipc/Config.in"
 	source "package/python-protobuf/Config.in"
package/python-paho-mqtt/Config.in new file +9 -0
new file mode 100644
index 0000000..1b20da9
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PAHO_MQTT
+	bool "python-paho-mqtt"
+	help
+	  The Paho Python Client provides a client class with support
+	  for both MQTT v3.1 and v3.1.1 on Python 2.7 or 3.x. It also
+	  provides some helper functions to make publishing one off
+	  messages to an MQTT server very straightforward.
+
+	  https://pypi.python.org/pypi/paho-mqtt
package/python-paho-mqtt/python-paho-mqtt.hash new file +2 -0
new file mode 100644
index 0000000..eb1dfb5
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256  0f7a629efe6e3a2c61b59d3550aa9f2c4529b5689a65fde45e6f1ac36b9a261e  paho-mqtt-1.1.tar.gz
package/python-paho-mqtt/python-paho-mqtt.mk new file +21 -0
new file mode 100644
index 0000000..f039835
@@ -0,0 +1,21 @@
+################################################################################
+#
+# python-paho-mqtt
+#
+################################################################################
+
+PYTHON_PAHO_MQTT_VERSION = 1.1
+PYTHON_PAHO_MQTT_SOURCE = paho-mqtt-$(PYTHON_PAHO_MQTT_VERSION).tar.gz
+PYTHON_PAHO_MQTT_SITE = https://pypi.python.org/packages/source/p/paho-mqtt
+PYTHON_PAHO_MQTT_LICENSE = EPLv1.0 or EDLv1.0
+PYTHON_PAHO_MQTT_LICENSE_FILES = LICENSE.txt edl-v10 epl-v10
+PYTHON_PAHO_MQTT_SETUP_TYPE = setuptools
+
+define PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+		$(HOST_DIR)/usr/bin/python2 setup.py install \
+		--root=/)
+endef
+
+$(eval $(python-package))
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 python-paho-mqtt: add new package

Hi Davide,

package/python-paho-mqtt/python-paho-mqtt.mk

Quoted 47 lines · Davide Viti
---
 package/Config.in                              |  1 +
 package/python-paho-mqtt/Config.in             |  9 +++++++++
 package/python-paho-mqtt/python-paho-mqtt.hash |  2 ++
 package/python-paho-mqtt/python-paho-mqtt.mk   | 21 +++++++++++++++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 package/python-paho-mqtt/Config.in
 create mode 100644 package/python-paho-mqtt/python-paho-mqtt.hash
 create mode 100644 package/python-paho-mqtt/python-paho-mqtt.mk
package/Config.in +1 -0
index dd44743..aab1958 100644
@@ -659,6 +659,7 @@ menu "External python modules"
        source "package/python-networkmanager/Config.in"
        source "package/python-nfc/Config.in"
        source "package/python-numpy/Config.in"
+       source "package/python-paho-mqtt/Config.in"
        source "package/python-pam/Config.in"
        source "package/python-posix-ipc/Config.in"
        source "package/python-protobuf/Config.in"
package/python-paho-mqtt/Config.in new file +9 -0
new file mode 100644
index 0000000..1b20da9
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PAHO_MQTT
+       bool "python-paho-mqtt"
+       help
+         The Paho Python Client provides a client class with support
+         for both MQTT v3.1 and v3.1.1 on Python 2.7 or 3.x. It also
+         provides some helper functions to make publishing one off
+         messages to an MQTT server very straightforward.
+
+         https://pypi.python.org/pypi/paho-mqtt
package/python-paho-mqtt/python-paho-mqtt.hash new file +2 -0
new file mode 100644
index 0000000..eb1dfb5
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256  0f7a629efe6e3a2c61b59d3550aa9f2c4529b5689a65fde45e6f1ac36b9a261e  paho-mqtt-1.1.tar.gz
package/python-paho-mqtt/python-paho-mqtt.mk +0 -0

please also provide oficial md5 from pypi like we do in for example package/python-pyudev

Quoted 14 lines

new file mode 100644
index 0000000..f039835

package/python-paho-mqtt/python-paho-mqtt.mk new file +9 -0
@@ -0,0 +1,21 @@
+################################################################################
+#
+# python-paho-mqtt
+#
+################################################################################
+
+PYTHON_PAHO_MQTT_VERSION = 1.1
+PYTHON_PAHO_MQTT_SOURCE = paho-mqtt-$(PYTHON_PAHO_MQTT_VERSION).tar.gz
+PYTHON_PAHO_MQTT_SITE = https://pypi.python.org/packages/source/p/paho-mqtt

package/python-paho-mqtt/python-paho-mqtt.mk line 19

Quoted 10 lines
package/python-paho-mqtt/python-paho-mqtt.mk new file +10 -0
+PYTHON_PAHO_MQTT_LICENSE = EPLv1.0 or EDLv1.0
+PYTHON_PAHO_MQTT_LICENSE_FILES = LICENSE.txt edl-v10 epl-v10
+PYTHON_PAHO_MQTT_SETUP_TYPE = setuptools
+
+define PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS
+       (cd $(@D); \
+               $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+               $(HOST_DIR)/usr/bin/python2 setup.py install \
+               --root=/)
+endef

Why do you need this and have you tested this with Python3?

Quoted 8 lines
package/python-paho-mqtt/python-paho-mqtt.mk new file +1 -1
+$(eval $(python-package))
--

2.1.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#2 lore raw

PATCH 1/1 python-paho-mqtt: add new package

In reply to Davide Viti

Davide,

package/python-paho-mqtt/Config.in line 7

Quoted 13 lines · Davide Viti
package/python-paho-mqtt/Config.in new file +7 -0
new file mode 100644
index 0000000..1b20da9
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PAHO_MQTT
+	bool "python-paho-mqtt"
+	help
+	  The Paho Python Client provides a client class with support
+	  for both MQTT v3.1 and v3.1.1 on Python 2.7 or 3.x. It also
+	  provides some helper functions to make publishing one off
+	  messages to an MQTT server very straightforward.

I know it was copy/pasted from the website, but this last sentence doesn't make much sense to me. Maybe it's because I'm not a native speaker, but "publishing one off messages" is not something that I can parse. Did they mean "publishing on/off messages" ? Or something else ?

package/python-paho-mqtt/Config.in

Quoted 13 lines
package/python-paho-mqtt/Config.in new file +13 -0
+PYTHON_PAHO_MQTT_VERSION = 1.1
+PYTHON_PAHO_MQTT_SOURCE = paho-mqtt-$(PYTHON_PAHO_MQTT_VERSION).tar.gz
+PYTHON_PAHO_MQTT_SITE = https://pypi.python.org/packages/source/p/paho-mqtt
+PYTHON_PAHO_MQTT_LICENSE = EPLv1.0 or EDLv1.0
+PYTHON_PAHO_MQTT_LICENSE_FILES = LICENSE.txt edl-v10 epl-v10
+PYTHON_PAHO_MQTT_SETUP_TYPE = setuptools
+
+define PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS
+	(cd $(@D); \
+		$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+		$(HOST_DIR)/usr/bin/python2 setup.py install \
+		--root=/)
+endef

Why do you need to override <pkg>_INSTALL_TARGET_CMDS ?

Using $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) for a target package looks clearly wrong. Also, since you're not passing --prefix=$(TARGET_DIR)/usr, I don't see how this overriden install target commands can even install something in $(TARGET_DIR).

Could you clarify this?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 python-paho-mqtt: add new package

*Hi Thomas and Yegor,*

I've tried to rebuild the package using python3 and the build fails finding $(HOST_DIR)/usr/bin/python2

I guess it's worth discussing the redefinition of PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS though, since it probably is the origin of the problems

2015-12-28 14:25 GMT+01:00 Thomas Petazzoni <
[email protected]>:

Quoted 13 lines · Davide Viti

package/python-paho-mqtt/python-paho-mqtt.mk line 19

Quoted 8 lines

...

package/python-paho-mqtt/python-paho-mqtt.mk new file +6 -0
+define PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS
+     (cd $(@D); \
+             $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+             $(HOST_DIR)/usr/bin/python2 setup.py install \
+             --root=/)
+endef

Why do you need to override <pkg>_INSTALL_TARGET_CMDS ?

Quoted 8 lines

Using $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) for a target package looks clearly wrong. Also, since you're not passing --prefix=$(TARGET_DIR)/usr, I don't see how this overriden install target commands can even install something in $(TARGET_DIR).

Could you clarify this?

The install stage of the package, fails with the following error (I replaced the custom paths with "..."):

.../bin/python setup.py install --prefix=... --executable=/usr/bin/python --single-version-externally-managed --root=/ )
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: option --executable not recognized

I narrowed this down to "--executable" and "--single-version-externally-managed" not being supported by setup.py I've looked at packages/pkg-python.mk and tried to fix it overriding "PYTHON_PAHO_MQTT_BASE_INSTALL_TARGET_OPTS" and "PYTHON_PAHO_MQTT_INSTALL_TARGET_OPTS" but it did not work, so I ended up overriding the entire rule.
Never packaged a python module before, so thank you for assisting me in this process

Davide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151229/98d3a12f/attachment.html>

#4 lore raw

PATCH 1/1 python-paho-mqtt: add new package

Quoted 47 lines · Davide Viti

Hi Thomas and Yegor,

I've tried to rebuild the package using python3 and the build fails finding $(HOST_DIR)/usr/bin/python2

I guess it's worth discussing the redefinition of PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS though, since it probably is the origin of the problems

2015-12-28 14:25 GMT+01:00 Thomas Petazzoni
<[email protected]>:

Quoted 14 lines · Davide Viti

package/python-paho-mqtt/python-paho-mqtt.mk line 19

Quoted 8 lines

...

package/python-paho-mqtt/python-paho-mqtt.mk new file +6 -0
+define PYTHON_PAHO_MQTT_INSTALL_TARGET_CMDS
+     (cd $(@D); \
+             $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+             $(HOST_DIR)/usr/bin/python2 setup.py install \
+             --root=/)
+endef

Why do you need to override <pkg>_INSTALL_TARGET_CMDS ?

Quoted 7 lines

Using $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) for a target package looks clearly wrong. Also, since you're not passing --prefix=$(TARGET_DIR)/usr, I don't see how this overriden install target commands can even install something in $(TARGET_DIR).

Could you clarify this?

The install stage of the package, fails with the following error (I replaced the custom paths with "..."):

.../bin/python setup.py install --prefix=... --executable=/usr/bin/python --single-version-externally-managed --root=/ )
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: option --executable not recognized

Quoted 8 lines

I narrowed this down to "--executable" and "--single-version-externally-managed" not being supported by setup.py I've looked at packages/pkg-python.mk and tried to fix it overriding "PYTHON_PAHO_MQTT_BASE_INSTALL_TARGET_OPTS" and "PYTHON_PAHO_MQTT_INSTALL_TARGET_OPTS" but it did not work, so I ended up overriding the entire rule.
Never packaged a python module before, so thank you for assisting me in this process

Just change PYTHON_PAHO_MQTT_SETUP_TYPE = setuptools

to

PYTHON_PAHO_MQTT_SETUP_TYPE = distutils

Yegor

#5 lore raw

PATCH 1/1 python-paho-mqtt: add new package

In reply to Thomas Petazzoni
Quoted 11 lines · Thomas Petazzoni
Quoted 9 lines · Davide Viti
Quoted 9 lines
package/python-paho-mqtt/Config.in new file +3 -0
new file mode 100644
index 0000000..1b20da9
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PAHO_MQTT
+	bool "python-paho-mqtt"
+	help
Quoted 9 lines
Quoted 4 lines

package/python-paho-mqtt/Config.in line 7

Quoted 4 lines
package/python-paho-mqtt/Config.in new file +4 -0
+	  The Paho Python Client provides a client class with support
+	  for both MQTT v3.1 and v3.1.1 on Python 2.7 or 3.x. It also
+	  provides some helper functions to make publishing one off
+	  messages to an MQTT server very straightforward.

I know it was copy/pasted from the website, but this last sentence doesn't make much sense to me. Maybe it's because I'm not a native speaker, but "publishing one off messages" is not something that I can parse. Did they mean "publishing on/off messages" ? Or something else ?

They mean "publishing one-off messages", which I guess translates to having a
simple function to publish a message without the need for setting up a connection etc.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH 1/1 python-paho-mqtt: add new package

Quoted 51 lines · Arnout Vandecappelle
Quoted 3 lines · Thomas Petazzoni
Quoted 1 line · Davide Viti

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/python-paho-mqtt/Config.in

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

new file mode 100644
index 0000000..1b20da9

package/python-paho-mqtt/Config.in new file +3 -0
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PAHO_MQTT
+  bool "python-paho-mqtt"
+  help
Quoted 9 lines
Quoted 4 lines

package/python-paho-mqtt/Config.in line 7

Quoted 4 lines
package/python-paho-mqtt/Config.in new file +4 -0
+    The Paho Python Client provides a client class with support
+    for both MQTT v3.1 and v3.1.1 on Python 2.7 or 3.x. It also
+    provides some helper functions to make publishing one off
+    messages to an MQTT server very straightforward.

I know it was copy/pasted from the website, but this last sentence doesn't make much sense to me. Maybe it's because I'm not a native speaker, but "publishing one off messages" is not something that I can parse. Did they mean "publishing on/off messages" ? Or something else ?

They mean "publishing one-off messages", which I guess translates to
having a
simple function to publish a message without the need for setting up a connection etc.

Regards,
Arnout

?
one-off
British informal
*adjective*
adjective: *one-off*

1. *1*.
done, made, or happening only once and not repeated. "one-off tax deductible donations to charity"

*noun*
noun: *one-off*; plural noun: *one-offs*

1. *1*.
something done, made, or happening only once, not as part of a regular sequence.
"the meeting is a one-off"
- a person who is unusual or unique, especially in an admirable way. "he's a one-off, no one else has his skills"

Quoted 3 lines

?My interpretation: A hack or something done quick and dirty without setting up infrastructure etc.

?Regards, Steve?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160101/0bf1c070/attachment.html>