[Buildroot] [PATCH 03/11] package/python-crccheck: new package

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sat Oct 18 19:43:01 UTC 2025


This commit adds a new host only package for the crccheck Python
module, which is a dependency of Snagboot.

Homepage on PyPi: https://pypi.org/project/crccheck/

This commit also adds a very basic test case that allows to verify
that the Python module can be imported and that some minimal
functionality works.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 DEVELOPERS                                        |  2 ++
 package/python-crccheck/python-crccheck.hash      |  4 ++++
 package/python-crccheck/python-crccheck.mk        | 15 +++++++++++++++
 .../testing/tests/package/test_python_crccheck.py | 10 ++++++++++
 4 files changed, 31 insertions(+)
 create mode 100644 package/python-crccheck/python-crccheck.hash
 create mode 100644 package/python-crccheck/python-crccheck.mk
 create mode 100644 support/testing/tests/package/test_python_crccheck.py

diff --git a/DEVELOPERS b/DEVELOPERS
index 69f22259e8..ec52defef8 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3251,6 +3251,7 @@ F:	package/pkg-autotools.mk
 F:	package/pkg-generic.mk
 F:	package/python3/
 F:	package/python-augeas/
+F:	package/python-crccheck/
 F:	package/python-flask-expects-json/
 F:	package/python-git/
 F:	package/python-qrcode/
@@ -3280,6 +3281,7 @@ F:	support/testing/tests/package/sample_python_git.py
 F:	support/testing/tests/package/sample_python_unittest_xml_reporting.py
 F:	support/testing/tests/package/test_nodejs.py
 F:	support/testing/tests/package/test_python_augeas.py
+F:	support/testing/tests/package/test_python_crccheck.py
 F:	support/testing/tests/package/test_python_flask.py
 F:	support/testing/tests/package/test_python_flask_expects_json.py
 F:	support/testing/tests/package/test_python_git.py
diff --git a/package/python-crccheck/python-crccheck.hash b/package/python-crccheck/python-crccheck.hash
new file mode 100644
index 0000000000..3fb58a7299
--- /dev/null
+++ b/package/python-crccheck/python-crccheck.hash
@@ -0,0 +1,4 @@
+# From https://pypi.org/project/crccheck/#crccheck-1.3.1.tar.gz
+sha256  1544c0110bf0a697d875d4f29dc40d7079f9d4d402a9317383f55f90ca72563a  crccheck-1.3.1.tar.gz
+# Locally calculated
+sha256  1237ab8ea60caa782d77d9d2ac0cdccd765475e3848b0b91b5751d3f299e9d31  LICENSE.txt
diff --git a/package/python-crccheck/python-crccheck.mk b/package/python-crccheck/python-crccheck.mk
new file mode 100644
index 0000000000..32c1341d32
--- /dev/null
+++ b/package/python-crccheck/python-crccheck.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-crccheck
+#
+################################################################################
+
+PYTHON_CRCCHECK_VERSION = 1.3.1
+PYTHON_CRCCHECK_SOURCE = crccheck-$(PYTHON_CRCCHECK_VERSION).tar.gz
+PYTHON_CRCCHECK_SITE = https://files.pythonhosted.org/packages/3c/d1/a943f4f1ca899917cc3fe1cb89d59348edd1b407503e4b02608e8d6b421e
+PYTHON_CRCCHECK_LICENSE = MIT
+PYTHON_CRCCHECK_LICENSE_FILES = LICENSE.txt
+PYTHON_CRCCHECK_SETUP_TYPE = setuptools
+HOST_PYTHON_CRCCHECK_DEPENDENCIES = host-python-setuptools-scm
+
+$(eval $(host-python-package))
diff --git a/support/testing/tests/package/test_python_crccheck.py b/support/testing/tests/package/test_python_crccheck.py
new file mode 100644
index 0000000000..d51bdc7c9f
--- /dev/null
+++ b/support/testing/tests/package/test_python_crccheck.py
@@ -0,0 +1,10 @@
+import infra.basetest
+
+
+class TestHostPythonCrccheck(infra.basetest.BRHostPkgTest):
+    hostpkgs = ["host-python-crccheck"]
+
+    def test_run(self):
+        cmd = ["host/bin/python3", "-c", "import crccheck; print(crccheck.crc.Crc32.calc(bytearray.fromhex('DEADBEEF')))"]
+        res = infra.run_cmd_on_host(self.builddir, cmd)
+        self.assertEqual(res.strip(), "2090640218")
-- 
2.51.0



More information about the buildroot mailing list