package/python-crccheck: new package

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@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Thomas Petazzoni
2025-10-18 21:43:01 +02:00
committed by Julien Olivain
parent 9468f1c099
commit d03cfe515b
4 changed files with 31 additions and 0 deletions

View File

@@ -3255,6 +3255,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/
@@ -3284,6 +3285,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

View File

@@ -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

View File

@@ -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))

View File

@@ -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")