package/python-segno: new package

segno 1.5.2 https://pypi.org/project/segno/

Signed-off-by: Witold Lipieta <witold.lipieta@thaumatec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Witold Lipieta 2023-04-18 13:42:04 +02:00 committed by Thomas Petazzoni
parent bdb15addcb
commit 7412789bfd
7 changed files with 56 additions and 0 deletions

View File

@ -3110,6 +3110,11 @@ F: package/time/
N: Will Wagner <will_wagner@carallon.com>
F: package/yaffs2utils/
N: Witold Lipieta <witold.lipieta@thaumatec.com>
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 <wzab01@gmail.com>
F: package/avrdude/
F: package/jack2/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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