Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/python-hid: new package
@ 2024-04-27 14:09 Peter Korsgaard
  2024-04-27 14:09 ` [Buildroot] [PATCH 2/2] support/testing: add python-hid test Peter Korsgaard
  2024-05-09 20:18 ` [Buildroot] [PATCH 1/2] package/python-hid: new package Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Korsgaard @ 2024-04-27 14:09 UTC (permalink / raw)
  To: buildroot; +Cc: Asaf Kahlon, James Hilliard, Thomas Petazzoni

A python wrapper for the hidapi library.  Hidapi has fairly complicated
dependencies, so use a select rather than a depends on.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 DEVELOPERS                         |  1 +
 package/Config.in                  |  1 +
 package/python-hid/Config.in       |  7 +++++++
 package/python-hid/python-hid.hash |  5 +++++
 package/python-hid/python-hid.mk   | 14 ++++++++++++++
 5 files changed, 28 insertions(+)
 create mode 100644 package/python-hid/Config.in
 create mode 100644 package/python-hid/python-hid.hash
 create mode 100644 package/python-hid/python-hid.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 399b2931ff..29c32f0a11 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2480,6 +2480,7 @@ F:	package/python-cached-property/
 F:	package/python-docker/
 F:	package/python-dockerpty/
 F:	package/python-docker-pycreds/
+F:	package/python-hid/
 F:	package/python-psutil/
 F:	package/python-request-id/
 F:	package/python-semver/
diff --git a/package/Config.in b/package/Config.in
index 1935077f0f..d4d951d903 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1121,6 +1121,7 @@ menu "External python modules"
 	source "package/python-gunicorn/Config.in"
 	source "package/python-h11/Config.in"
 	source "package/python-h2/Config.in"
+	source "package/python-hid/Config.in"
 	source "package/python-hiredis/Config.in"
 	source "package/python-hkdf/Config.in"
 	source "package/python-hpack/Config.in"
diff --git a/package/python-hid/Config.in b/package/python-hid/Config.in
new file mode 100644
index 0000000000..78af383e65
--- /dev/null
+++ b/package/python-hid/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_HID
+	bool "python-hid"
+	depends on BR2_PACKAGE_HIDAPI # runtime
+	help
+	  ctypes bindings for hidapi.
+
+	  https://github.com/apmorton/pyhidapi
diff --git a/package/python-hid/python-hid.hash b/package/python-hid/python-hid.hash
new file mode 100644
index 0000000000..d03757771b
--- /dev/null
+++ b/package/python-hid/python-hid.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/hid/json
+md5  1954df0dce4e15afd89197e898039e92  hid-1.0.6.tar.gz
+sha256  48d764d7ae9746ba123b96dbf457893ca80268b7791c4b1d2e051310eeb83860  hid-1.0.6.tar.gz
+# Locally computed sha256 checksums
+sha256  5524b425acacdfedeca3f959980f0cd38b00176ebbb292e4a96c520d6074353d  LICENSE
diff --git a/package/python-hid/python-hid.mk b/package/python-hid/python-hid.mk
new file mode 100644
index 0000000000..2f65bd1412
--- /dev/null
+++ b/package/python-hid/python-hid.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-hid
+#
+################################################################################
+
+PYTHON_HID_VERSION = 1.0.6
+PYTHON_HID_SOURCE = hid-$(PYTHON_HID_VERSION).tar.gz
+PYTHON_HID_SITE = https://files.pythonhosted.org/packages/50/b8/5f470948262b6cdda8e1b2382b19f67c57eacda1e07a14322807b911e0ce
+PYTHON_HID_SETUP_TYPE = setuptools
+PYTHON_HID_LICENSE = MIT
+PYTHON_HID_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] support/testing: add python-hid test
  2024-04-27 14:09 [Buildroot] [PATCH 1/2] package/python-hid: new package Peter Korsgaard
@ 2024-04-27 14:09 ` Peter Korsgaard
  2024-05-09 20:19   ` Thomas Petazzoni via buildroot
  2024-05-09 20:18 ` [Buildroot] [PATCH 1/2] package/python-hid: new package Thomas Petazzoni via buildroot
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2024-04-27 14:09 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 DEVELOPERS                                         |  1 +
 support/testing/tests/package/sample_python_hid.py |  3 +++
 support/testing/tests/package/test_python_hid.py   | 13 +++++++++++++
 3 files changed, 17 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_hid.py
 create mode 100644 support/testing/tests/package/test_python_hid.py

diff --git a/DEVELOPERS b/DEVELOPERS
index 29c32f0a11..f426aa376e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2494,6 +2494,7 @@ F:	package/triggerhappy/
 F:	package/wireguard-linux-compat/
 F:	package/wireguard-tools/
 F:	support/testing/tests/package/test_docker_compose.py
+F:	support/testing/tests/package/test_python_hid.py
 
 N:	Peter Seiderer <ps.report@gmx.net>
 F:	package/dotconf/
diff --git a/support/testing/tests/package/sample_python_hid.py b/support/testing/tests/package/sample_python_hid.py
new file mode 100644
index 0000000000..a581d7b7cb
--- /dev/null
+++ b/support/testing/tests/package/sample_python_hid.py
@@ -0,0 +1,3 @@
+import hid
+
+hid.enumerate()
diff --git a/support/testing/tests/package/test_python_hid.py b/support/testing/tests/package/test_python_hid.py
new file mode 100644
index 0000000000..b7a280b766
--- /dev/null
+++ b/support/testing/tests/package/test_python_hid.py
@@ -0,0 +1,13 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonHid(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_HID=y
+        BR2_PACKAGE_HIDAPI=y
+        """
+    sample_scripts = ["tests/package/sample_python_hid.py"]
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/python-hid: new package
  2024-04-27 14:09 [Buildroot] [PATCH 1/2] package/python-hid: new package Peter Korsgaard
  2024-04-27 14:09 ` [Buildroot] [PATCH 2/2] support/testing: add python-hid test Peter Korsgaard
@ 2024-05-09 20:18 ` Thomas Petazzoni via buildroot
  2024-05-11  9:09   ` Peter Korsgaard
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-09 20:18 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: James Hilliard, Asaf Kahlon, buildroot

On Sat, 27 Apr 2024 16:09:39 +0200
Peter Korsgaard <peter@korsgaard.com> wrote:

> A python wrapper for the hidapi library.  Hidapi has fairly complicated
> dependencies, so use a select rather than a depends on.

You actually did the opposite :-)

But in fact, there were only 3 depends, so not that much to propagate,
so I stuck to our normal way: a select BR2_PACKAGE_HIDAPI + propagation
of the depends on. Otherwise people will start using that as a counter
example and use "depends on" where "select" should be used.

Applied with this change. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 2/2] support/testing: add python-hid test
  2024-04-27 14:09 ` [Buildroot] [PATCH 2/2] support/testing: add python-hid test Peter Korsgaard
@ 2024-05-09 20:19   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-09 20:19 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: buildroot

On Sat, 27 Apr 2024 16:09:40 +0200
Peter Korsgaard <peter@korsgaard.com> wrote:

> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  DEVELOPERS                                         |  1 +
>  support/testing/tests/package/sample_python_hid.py |  3 +++
>  support/testing/tests/package/test_python_hid.py   | 13 +++++++++++++
>  3 files changed, 17 insertions(+)
>  create mode 100644 support/testing/tests/package/sample_python_hid.py
>  create mode 100644 support/testing/tests/package/test_python_hid.py

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/python-hid: new package
  2024-05-09 20:18 ` [Buildroot] [PATCH 1/2] package/python-hid: new package Thomas Petazzoni via buildroot
@ 2024-05-11  9:09   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2024-05-11  9:09 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: James Hilliard, Asaf Kahlon, buildroot

On 5/9/24 22:18, Thomas Petazzoni wrote:
> On Sat, 27 Apr 2024 16:09:39 +0200
> Peter Korsgaard <peter@korsgaard.com> wrote:
> 
>> A python wrapper for the hidapi library.  Hidapi has fairly complicated
>> dependencies, so use a select rather than a depends on.
> 
> You actually did the opposite :-)
> 
> But in fact, there were only 3 depends, so not that much to propagate,
> so I stuck to our normal way: a select BR2_PACKAGE_HIDAPI + propagation
> of the depends on. Otherwise people will start using that as a counter
> example and use "depends on" where "select" should be used.
> 
> Applied with this change. Thanks!

Heh, indeed - Sorry for the mess, and thanks for fixing it up. I see 
that the unit test still has an explicit BR2_PACKAGE_HIDAPI, but that 
can now be dropped.

I'll send a patch for that.

-- 
Bye, Peter Korsgaard

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-11  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-27 14:09 [Buildroot] [PATCH 1/2] package/python-hid: new package Peter Korsgaard
2024-04-27 14:09 ` [Buildroot] [PATCH 2/2] support/testing: add python-hid test Peter Korsgaard
2024-05-09 20:19   ` Thomas Petazzoni via buildroot
2024-05-09 20:18 ` [Buildroot] [PATCH 1/2] package/python-hid: new package Thomas Petazzoni via buildroot
2024-05-11  9:09   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox