From: Alexandre Ondet <frcomdev@gmail.com>
To: buildroot@buildroot.org
Cc: buildroot@bubu1.eu, james.hilliard1@gmail.com,
thomas.petazzoni@bootlin.com
Subject: [Buildroot] [PATCH v2 06/13] package/python-nmcli: new package
Date: Tue, 23 Jun 2026 15:49:33 -0500 [thread overview]
Message-ID: <20260623204933.1251-1-frcomdev@gmail.com> (raw)
In-Reply-To: <4392c04e-203a-447a-9160-370717fe6099@bubu1.eu>
Signed-off-by: Alexandre Ondet <frcomdev@gmail.com>
---
Changes v1 -> v2:
- depend on network-manager and select nmcli support
- add a runtime test for the python nmcli module
- add DEVELOPERS entries for the package and runtime test
- fix missing trailing newlines in package files
DEVELOPERS | 5 ++++
package/Config.in | 1 +
package/python-nmcli/Config.in | 8 +++++++
package/python-nmcli/python-nmcli.hash | 3 +++
package/python-nmcli/python-nmcli.mk | 14 +++++++++++
.../tests/package/sample_python_nmcli.py | 8 +++++++
.../tests/package/test_python_nmcli.py | 24 +++++++++++++++++++
7 files changed, 63 insertions(+)
create mode 100644 package/python-nmcli/Config.in
create mode 100644 package/python-nmcli/python-nmcli.hash
create mode 100644 package/python-nmcli/python-nmcli.mk
create mode 100644 support/testing/tests/package/sample_python_nmcli.py
create mode 100644 support/testing/tests/package/test_python_nmcli.py
diff --git a/DEVELOPERS b/DEVELOPERS
index c6c228ae91..fb26c25928 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -147,6 +147,11 @@ N: Alexandre Esse <alexandre.esse.dev@gmail.com>
F: package/kvazaar/
F: package/v4l2loopback/
+N: Alexandre Ondet <frcomdev@gmail.com>
+F: package/python-nmcli/
+F: support/testing/tests/package/sample_python_nmcli.py
+F: support/testing/tests/package/test_python_nmcli.py
+
N: Alexey Brodkin <alexey.brodkin@synopsys.com>
F: board/cubietech/cubieboard2/
F: configs/cubieboard2_defconfig
diff --git a/package/Config.in b/package/Config.in
index 754bdee9f4..83c9e0809c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1261,6 +1261,7 @@ menu "External python modules"
source "package/python-netifaces/Config.in"
source "package/python-networkmanager/Config.in"
source "package/python-networkx/Config.in"
+ source "package/python-nmcli/Config.in"
source "package/python-numpy/Config.in"
source "package/python-oauthlib/Config.in"
source "package/python-opcua-asyncio/Config.in"
diff --git a/package/python-nmcli/Config.in b/package/python-nmcli/Config.in
new file mode 100644
index 0000000000..a860f511c4
--- /dev/null
+++ b/package/python-nmcli/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_NMCLI
+ bool "python-nmcli"
+ depends on BR2_PACKAGE_NETWORK_MANAGER # runtime
+ select BR2_PACKAGE_NETWORK_MANAGER_CLI # runtime
+ help
+ Python wrapper for nmcli (NetworkManager).
+
+ https://github.com/ushiboy/nmcli
diff --git a/package/python-nmcli/python-nmcli.hash b/package/python-nmcli/python-nmcli.hash
new file mode 100644
index 0000000000..a93e026dce
--- /dev/null
+++ b/package/python-nmcli/python-nmcli.hash
@@ -0,0 +1,3 @@
+# From https://pypi.org/pypi/nmcli/1.7.0/json
+sha256 4fb17b6c33d276a264a27b7109fa1d70987570536fa8852b51830f9f7732f982 nmcli-1.7.0.tar.gz
+sha256 9dbbc4debacc85f5f5f074614cd9cadd61da09eaa19f98f6bbb5463c34133820 LICENSE.txt
diff --git a/package/python-nmcli/python-nmcli.mk b/package/python-nmcli/python-nmcli.mk
new file mode 100644
index 0000000000..005519f0c1
--- /dev/null
+++ b/package/python-nmcli/python-nmcli.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-nmcli
+#
+################################################################################
+
+PYTHON_NMCLI_VERSION = 1.7.0
+PYTHON_NMCLI_SOURCE = nmcli-$(PYTHON_NMCLI_VERSION).tar.gz
+PYTHON_NMCLI_SITE = https://files.pythonhosted.org/packages/source/n/nmcli
+PYTHON_NMCLI_SETUP_TYPE = setuptools
+PYTHON_NMCLI_LICENSE = MIT
+PYTHON_NMCLI_LICENSE_FILES = LICENSE.txt
+
+$(eval $(python-package))
diff --git a/support/testing/tests/package/sample_python_nmcli.py b/support/testing/tests/package/sample_python_nmcli.py
new file mode 100644
index 0000000000..5fa8dee0c4
--- /dev/null
+++ b/support/testing/tests/package/sample_python_nmcli.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+import nmcli
+
+general = nmcli.general.status()
+print(general)
+
+assert general.state is not None
diff --git a/support/testing/tests/package/test_python_nmcli.py b/support/testing/tests/package/test_python_nmcli.py
new file mode 100644
index 0000000000..20fffa2356
--- /dev/null
+++ b/support/testing/tests/package/test_python_nmcli.py
@@ -0,0 +1,24 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Nmcli(TestPythonPackageBase):
+ __test__ = True
+ # Can't use TestPythonPackageBase.config because we need headers
+ # >= 5.4 for network-manager, so we have to use the bleeding-edge
+ # toolchain.
+ config = \
+ """
+ BR2_arm=y
+ BR2_TOOLCHAIN_EXTERNAL=y
+ BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+ BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_BLEEDING_EDGE=y
+ BR2_PACKAGE_PYTHON3=y
+ BR2_INIT_SYSTEMD=y
+ BR2_PACKAGE_NETWORK_MANAGER=y
+ BR2_PACKAGE_PYTHON_NMCLI=y
+ BR2_TARGET_ROOTFS_CPIO=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ """
+ sample_scripts = ["tests/package/sample_python_nmcli.py"]
+
+ timeout = 30
--
2.53.0.windows.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2026-06-23 20:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 17:20 [Buildroot] [PATCH 06/13] package/python-nmcli: new package Alexandre Ondet
2026-05-30 22:00 ` Marcus Hoffmann via buildroot
2026-06-11 19:15 ` Alexandre Ondet
2026-06-11 19:16 ` [Buildroot] [PATCH] package/python-nmcli: fix dependencies and add runtime test Alexandre Ondet
2026-06-12 10:54 ` [Buildroot] [PATCH 06/13] package/python-nmcli: new package Marcus Hoffmann via buildroot
2026-06-23 20:49 ` Alexandre Ondet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260623204933.1251-1-frcomdev@gmail.com \
--to=frcomdev@gmail.com \
--cc=buildroot@bubu1.eu \
--cc=buildroot@buildroot.org \
--cc=james.hilliard1@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox