diff --git a/DEVELOPERS b/DEVELOPERS index 6fd1021e98..f91c4e9a2b 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -3110,6 +3110,11 @@ F: package/time/ N: Will Wagner F: package/yaffs2utils/ +N: Witold Lipieta +F: package/python-segno/ +F: support/testing/tests/package/sample_python_segno.py +F: support/testing/tests/package/test_python_segno.py + N: Wojciech M. Zabolotny F: package/avrdude/ F: package/jack2/ diff --git a/package/Config.in b/package/Config.in index 3ce869f310..3d16ea37d1 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1288,6 +1288,7 @@ menu "External python modules" source "package/python-sdnotify/Config.in" source "package/python-secretstorage/Config.in" source "package/python-see/Config.in" + source "package/python-segno/Config.in" source "package/python-selenium/Config.in" source "package/python-semver/Config.in" source "package/python-sentry-sdk/Config.in" diff --git a/package/python-segno/Config.in b/package/python-segno/Config.in new file mode 100644 index 0000000000..3957cd79bf --- /dev/null +++ b/package/python-segno/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_PYTHON_SEGNO + bool "python-segno" + select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime + help + QR Code and Micro QR Code generator for Python 2 and Python 3 + + https://github.com/heuer/segno/ diff --git a/package/python-segno/python-segno.hash b/package/python-segno/python-segno.hash new file mode 100644 index 0000000000..286bdf3615 --- /dev/null +++ b/package/python-segno/python-segno.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/segno/json +md5 6d7c852f951501cd3af85ef061d6bee4 segno-1.5.2.tar.gz +sha256 983424b296e62189d70fc73460cd946cf56dcbe82b9bda18c066fc1b24371cdc segno-1.5.2.tar.gz +# Locally computed sha256 checksums +sha256 98b0a86ca0cbf68c95051741bc983425a43fdece775fe0e2712e66be459cc9d1 LICENSE diff --git a/package/python-segno/python-segno.mk b/package/python-segno/python-segno.mk new file mode 100644 index 0000000000..c832f38f4b --- /dev/null +++ b/package/python-segno/python-segno.mk @@ -0,0 +1,14 @@ +################################################################################ +# +# python-segno +# +################################################################################ + +PYTHON_SEGNO_VERSION = 1.5.2 +PYTHON_SEGNO_SOURCE = segno-$(PYTHON_SEGNO_VERSION).tar.gz +PYTHON_SEGNO_SITE = https://files.pythonhosted.org/packages/90/2a/2fedf1023f9273d8326362df7936748ebadef92ba53ab7970d9b8df1a6c2 +PYTHON_SEGNO_SETUP_TYPE = setuptools +PYTHON_SEGNO_LICENSE = BSD-3-Clause +PYTHON_SEGNO_LICENSE_FILES = LICENSE + +$(eval $(python-package)) diff --git a/support/testing/tests/package/sample_python_segno.py b/support/testing/tests/package/sample_python_segno.py new file mode 100644 index 0000000000..c96d6087ce --- /dev/null +++ b/support/testing/tests/package/sample_python_segno.py @@ -0,0 +1,13 @@ +import segno +import os +import tempfile + +qr = segno.make_qr('http:/www.example.org/') +with tempfile.NamedTemporaryFile('wb', suffix='.png', delete=False) as f: + fn = f.name +qr.save(fn) +expected = b'\211PNG\r\n\032\n' # PNG magic number +with open(fn, mode='rb') as f: + val = f.read(len(expected)) +os.unlink(fn) +assert expected == val diff --git a/support/testing/tests/package/test_python_segno.py b/support/testing/tests/package/test_python_segno.py new file mode 100644 index 0000000000..75e7124399 --- /dev/null +++ b/support/testing/tests/package/test_python_segno.py @@ -0,0 +1,11 @@ +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3Segno(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_SEGNO=y + """ + sample_scripts = ["tests/package/sample_python_segno.py"]