Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] package: add new python packages
@ 2026-02-10 21:01 Alexis Lothoré via buildroot
  2026-02-10 21:01 ` [Buildroot] [PATCH 1/2] package/python-gevent: new package Alexis Lothoré via buildroot
  2026-02-10 21:01 ` [Buildroot] [PATCH 2/2] package/python-flask-socketio: " Alexis Lothoré via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-02-10 21:01 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Alexis Lothoré, Nicolas Carrier,
	Thomas Petazzoni

Hello,

this small series aims to introduce two new python packages:
- python-flask-socketio: allows event-based bi-directional
  communication between Flask applications and server
- python-gevent: a coroutine-based network library, as a dependency of
  python-flask-socketio

python-flask-socketio needs at least one of those dependencies:
- eventlet
- gevent
- flask dev server

[0] mentions that eventlet is discouraged for new projects, and [1]
states that Flask webserver should not be used for production, hence
this series selects gevent as the default dependency for
python-flask-socketio.

- The two packages have been generated with ./utils/scanpypi, and adjusted
accordingly (license, and build/runtime dependencies).
- Both packages bring a minimal test ensuring at least that the
  corresponding import can be performed as well as basic
  instantation/manipulation
- Both packages have been tested locally with ./utils/test-pkg, and
  ./support/testing/run-tests (through ./utils/docker-run)

[0] https://eventlet.readthedocs.io/en/latest/
[1] https://flask-socketio.readthedocs.io/en/latest/intro.html#requirements

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
Alexis Lothoré (2):
      package/python-gevent: new package
      package/python-flask-socketio: new package

 DEVELOPERS                                            |  2 ++
 package/Config.in                                     |  2 ++
 package/python-flask-socketio/Config.in               | 14 ++++++++++++++
 .../python-flask-socketio/python-flask-socketio.hash  |  5 +++++
 .../python-flask-socketio/python-flask-socketio.mk    | 14 ++++++++++++++
 package/python-gevent/Config.in                       | 19 +++++++++++++++++++
 package/python-gevent/python-gevent.hash              |  5 +++++
 package/python-gevent/python-gevent.mk                | 16 ++++++++++++++++
 .../tests/package/sample_python_flask_socketio.py     |  5 +++++
 support/testing/tests/package/sample_python_gevent.py |  7 +++++++
 .../tests/package/test_python_flask_socketio.py       | 12 ++++++++++++
 support/testing/tests/package/test_python_gevent.py   | 12 ++++++++++++
 12 files changed, 113 insertions(+)
---
base-commit: 94a817a58909e1cfe0c1f63b63754079f1866523
change-id: 20250804-python-packages-5e4a98a47c1d

Best regards,
-- 
Alexis Lothoré <alexis.lothore@bootlin.com>

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

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

* [Buildroot] [PATCH 1/2] package/python-gevent: new package
  2026-02-10 21:01 [Buildroot] [PATCH 0/2] package: add new python packages Alexis Lothoré via buildroot
@ 2026-02-10 21:01 ` Alexis Lothoré via buildroot
  2026-02-10 21:01 ` [Buildroot] [PATCH 2/2] package/python-flask-socketio: " Alexis Lothoré via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-02-10 21:01 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Alexis Lothoré, Nicolas Carrier,
	Thomas Petazzoni

Bring python-gevent module as a standalone package.

Set GEVENTSETUP_EMBED=0 to prevent python-gevent from using its embedded
libuv, libev and c-ares and rather use those packaged with buildroot.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 DEVELOPERS                                            |  1 +
 package/Config.in                                     |  1 +
 package/python-gevent/Config.in                       | 19 +++++++++++++++++++
 package/python-gevent/python-gevent.hash              |  5 +++++
 package/python-gevent/python-gevent.mk                | 16 ++++++++++++++++
 support/testing/tests/package/sample_python_gevent.py |  7 +++++++
 support/testing/tests/package/test_python_gevent.py   | 12 ++++++++++++
 7 files changed, 61 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 225d1ac917dc..cc7c38c31873 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -155,6 +155,7 @@ N:	Alexey Lukyanchuk <skif@skif-web.ru>
 F:	package/zabbix/
 
 N: 	Alexis Lothoré <alexis.lothore@bootlin.com>
+F: 	package/python-gevent
 F: 	package/python-scp
 
 N:	Alistair Francis <alistair@alistair23.me>
diff --git a/package/Config.in b/package/Config.in
index 6284bea7f4ad..76c2a4365513 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1127,6 +1127,7 @@ menu "External python modules"
 	source "package/python-fonttools/Config.in"
 	source "package/python-frozenlist/Config.in"
 	source "package/python-future/Config.in"
+	source "package/python-gevent/Config.in"
 	source "package/python-git/Config.in"
 	source "package/python-gitdb2/Config.in"
 	source "package/python-gnupg/Config.in"
diff --git a/package/python-gevent/Config.in b/package/python-gevent/Config.in
new file mode 100644
index 000000000000..af7a97a49ce3
--- /dev/null
+++ b/package/python-gevent/Config.in
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_PYTHON_GEVENT
+	bool "python-gevent"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # C++20
+	select BR2_PACKAGE_C_ARES # runtime
+	select BR2_PACKAGE_LIBEV # runtime
+	select BR2_PACKAGE_LIBUV # runtime
+	select BR2_PACKAGE_HOST_PYTHON_CYTHON # build time
+	select BR2_PACKAGE_HOST_PYTHON_GREENLET # build time
+	select BR2_PACKAGE_HOST_PYTHON_CFFI # build time
+	select BR2_PACKAGE_PYTHON_GREENLET # runtime
+	select BR2_PACKAGE_PYTHON_ZOPEEVENT # runtime
+	select BR2_PACKAGE_PYTHON_ZOPE_INTERFACE # runtime
+	help
+	  Coroutine-based network library.
+
+	  http://www.gevent.org/
+
+comment "python-gevent needs a toolchain w/ C++, gcc >= 8"
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8
diff --git a/package/python-gevent/python-gevent.hash b/package/python-gevent/python-gevent.hash
new file mode 100644
index 000000000000..4356972ddd50
--- /dev/null
+++ b/package/python-gevent/python-gevent.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/gevent/json
+md5  a415693013e79df4c88a9e5fc90254bc  gevent-25.9.1.tar.gz
+sha256  adf9cd552de44a4e6754c51ff2e78d9193b7fa6eab123db9578a210e657235dd  gevent-25.9.1.tar.gz
+# Locally computed sha256 checksums
+sha256  4d46bc11d19e3853d54325973b8e2c53090f5638a7bf27fa1f5f1232c78901f7  LICENSE
diff --git a/package/python-gevent/python-gevent.mk b/package/python-gevent/python-gevent.mk
new file mode 100644
index 000000000000..10ddc895f74b
--- /dev/null
+++ b/package/python-gevent/python-gevent.mk
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python-gevent
+#
+################################################################################
+
+PYTHON_GEVENT_VERSION = 25.9.1
+PYTHON_GEVENT_SOURCE = gevent-$(PYTHON_GEVENT_VERSION).tar.gz
+PYTHON_GEVENT_SITE = https://files.pythonhosted.org/packages/9e/48/b3ef2673ffb940f980966694e40d6d32560f3ffa284ecaeb5ea3a90a6d3f
+PYTHON_GEVENT_SETUP_TYPE = setuptools
+PYTHON_GEVENT_DEPENDENCIES = libev libuv host-python-greenlet host-python-cffi host-python-cython
+PYTHON_GEVENT_LICENSE = MIT
+PYTHON_GEVENT_LICENSE_FILES = LICENSE
+PYTHON_GEVENT_ENV = GEVENTSETUP_EMBED=0
+
+$(eval $(python-package))
diff --git a/support/testing/tests/package/sample_python_gevent.py b/support/testing/tests/package/sample_python_gevent.py
new file mode 100644
index 000000000000..e8f065c17e88
--- /dev/null
+++ b/support/testing/tests/package/sample_python_gevent.py
@@ -0,0 +1,7 @@
+# Example taken from the official documentation
+import gevent
+from gevent import socket
+
+urls = ['www.google.com', 'www.example.com', 'www.python.org']
+jobs = [gevent.spawn(socket.gethostbyname, url) for url in urls]
+_ = gevent.joinall(jobs, timeout=2)
diff --git a/support/testing/tests/package/test_python_gevent.py b/support/testing/tests/package/test_python_gevent.py
new file mode 100644
index 000000000000..567cae182d2b
--- /dev/null
+++ b/support/testing/tests/package/test_python_gevent.py
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonGevent(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_GEVENT=y
+        """
+    sample_scripts = ["tests/package/sample_python_gevent.py"]
+    timeout = 30

-- 
2.52.0

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

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

* [Buildroot] [PATCH 2/2] package/python-flask-socketio: new package
  2026-02-10 21:01 [Buildroot] [PATCH 0/2] package: add new python packages Alexis Lothoré via buildroot
  2026-02-10 21:01 ` [Buildroot] [PATCH 1/2] package/python-gevent: new package Alexis Lothoré via buildroot
@ 2026-02-10 21:01 ` Alexis Lothoré via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-02-10 21:01 UTC (permalink / raw)
  To: buildroot
  Cc: James Hilliard, Alexis Lothoré, Nicolas Carrier,
	Thomas Petazzoni

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 DEVELOPERS                                                 |  1 +
 package/Config.in                                          |  1 +
 package/python-flask-socketio/Config.in                    | 14 ++++++++++++++
 package/python-flask-socketio/python-flask-socketio.hash   |  5 +++++
 package/python-flask-socketio/python-flask-socketio.mk     | 14 ++++++++++++++
 .../testing/tests/package/sample_python_flask_socketio.py  |  5 +++++
 .../testing/tests/package/test_python_flask_socketio.py    | 12 ++++++++++++
 7 files changed, 52 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index cc7c38c31873..4ff9b3b593de 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -155,6 +155,7 @@ N:	Alexey Lukyanchuk <skif@skif-web.ru>
 F:	package/zabbix/
 
 N: 	Alexis Lothoré <alexis.lothore@bootlin.com>
+F: 	package/python-flask-socketio
 F: 	package/python-gevent
 F: 	package/python-scp
 
diff --git a/package/Config.in b/package/Config.in
index 76c2a4365513..bbb7297dd2aa 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1120,6 +1120,7 @@ menu "External python modules"
 	source "package/python-flask-login/Config.in"
 	source "package/python-flask-restx/Config.in"
 	source "package/python-flask-smorest/Config.in"
+	source "package/python-flask-socketio/Config.in"
 	source "package/python-flask-sqlalchemy/Config.in"
 	source "package/python-flask-wtf/Config.in"
 	source "package/python-flatbuffers/Config.in"
diff --git a/package/python-flask-socketio/Config.in b/package/python-flask-socketio/Config.in
new file mode 100644
index 000000000000..ec7f3833f8cb
--- /dev/null
+++ b/package/python-flask-socketio/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_FLASK_SOCKETIO
+	bool "python-flask-socketio"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # C++20
+	select BR2_PACKAGE_PYTHON_FLASK # runtime
+	select BR2_PACKAGE_PYTHON_GEVENT # runtime
+	select BR2_PACKAGE_PYTHON_SOCKETIO # runtime
+	select BR2_PACKAGE_PYTHON3_SSL # runtime
+	help
+	  Socket.IO integration for Flask applications.
+
+	  https://github.com/miguelgrinberg/flask-socketio
+
+comment "python-flask-socketio needs a toolchain w/ C++, gcc >= 8"
+	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8
diff --git a/package/python-flask-socketio/python-flask-socketio.hash b/package/python-flask-socketio/python-flask-socketio.hash
new file mode 100644
index 000000000000..0d517134e6c4
--- /dev/null
+++ b/package/python-flask-socketio/python-flask-socketio.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/flask-socketio/json
+md5  50872c7e1d558fcbe60a942c5519703d  flask_socketio-5.6.0.tar.gz
+sha256  42a7bc552013633875ad320e39462323b4f7334594f1658d72b6ffed99940d4c  flask_socketio-5.6.0.tar.gz
+# Locally computed sha256 checksums
+sha256  68d0966e480a8d2fd3d5c26d002c996ef08cdfa2b15a77d0d0b593b9abee60a4  LICENSE
diff --git a/package/python-flask-socketio/python-flask-socketio.mk b/package/python-flask-socketio/python-flask-socketio.mk
new file mode 100644
index 000000000000..bdc60bdac24f
--- /dev/null
+++ b/package/python-flask-socketio/python-flask-socketio.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-flask-socketio
+#
+################################################################################
+
+PYTHON_FLASK_SOCKETIO_VERSION = 5.6.0
+PYTHON_FLASK_SOCKETIO_SOURCE = flask_socketio-$(PYTHON_FLASK_SOCKETIO_VERSION).tar.gz
+PYTHON_FLASK_SOCKETIO_SITE = https://files.pythonhosted.org/packages/53/28/deac60f5c6faf9c3e0aed07aa3a92b0741c6709841aa3eba12417bbc8303
+PYTHON_FLASK_SOCKETIO_SETUP_TYPE = setuptools
+PYTHON_FLASK_SOCKETIO_LICENSE = MIT
+PYTHON_FLASK_SOCKETIO_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
diff --git a/support/testing/tests/package/sample_python_flask_socketio.py b/support/testing/tests/package/sample_python_flask_socketio.py
new file mode 100644
index 000000000000..11f8050c7085
--- /dev/null
+++ b/support/testing/tests/package/sample_python_flask_socketio.py
@@ -0,0 +1,5 @@
+from flask import Flask
+from flask_socketio import SocketIO
+
+app = Flask('test')
+socketio = SocketIO(app)
diff --git a/support/testing/tests/package/test_python_flask_socketio.py b/support/testing/tests/package/test_python_flask_socketio.py
new file mode 100644
index 000000000000..e977db0b441e
--- /dev/null
+++ b/support/testing/tests/package/test_python_flask_socketio.py
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonFlaskSocketIO(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_FLASK_SOCKETIO=y
+        """
+    sample_scripts = ["tests/package/sample_python_flask_socketio.py"]
+    timeout = 30

-- 
2.52.0

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

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

end of thread, other threads:[~2026-02-10 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 21:01 [Buildroot] [PATCH 0/2] package: add new python packages Alexis Lothoré via buildroot
2026-02-10 21:01 ` [Buildroot] [PATCH 1/2] package/python-gevent: new package Alexis Lothoré via buildroot
2026-02-10 21:01 ` [Buildroot] [PATCH 2/2] package/python-flask-socketio: " Alexis Lothoré via buildroot

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