mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 00:20:38 -09:00
package/python-ruamel-yaml-clib: new package
Add optional c extension for python-ruamel-yaml which can speed up yaml loading/parsing. Extend the ruamel-yaml runtime test to check if the c extension works correctly. Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
21da0df09d
commit
f538c7e6bd
@@ -2157,6 +2157,7 @@ F: utils/diffconfig
|
||||
|
||||
N: Marcus Hoffmann <bubu@bubu1.eu>
|
||||
F: package/python-jc/
|
||||
F: package/python-ruamel-yaml-clib/
|
||||
F: support/testing/tests/package/test_python_fastapi.py
|
||||
F: support/testing/tests/package/test_python_ruamel_yaml.py
|
||||
F: support/testing/tests/package/sample_python_fastapi.py
|
||||
|
||||
@@ -1331,6 +1331,7 @@ menu "External python modules"
|
||||
source "package/python-rtoml/Config.in"
|
||||
source "package/python-rtslib-fb/Config.in"
|
||||
source "package/python-ruamel-yaml/Config.in"
|
||||
source "package/python-ruamel-yaml-clib/Config.in"
|
||||
source "package/python-s3transfer/Config.in"
|
||||
source "package/python-scandir/Config.in"
|
||||
source "package/python-scapy/Config.in"
|
||||
|
||||
8
package/python-ruamel-yaml-clib/Config.in
Normal file
8
package/python-ruamel-yaml-clib/Config.in
Normal file
@@ -0,0 +1,8 @@
|
||||
config BR2_PACKAGE_PYTHON_RUAMEL_YAML_CLIB
|
||||
bool "python-ruamel-yaml-clib"
|
||||
depends on BR2_PACKAGE_PYTHON_RUAMEL_YAML
|
||||
help
|
||||
C version of reader, parser and emitter for ruamel.yaml
|
||||
derived from libyaml
|
||||
|
||||
https://sourceforge.net/projects/ruamel-yaml/
|
||||
@@ -0,0 +1,5 @@
|
||||
# md5, sha256 from https://pypi.org/pypi/ruamel.yaml.clib/json
|
||||
md5 b72e549363fa1b9c4f9123e98f2b46cc ruamel.yaml.clib-0.2.8.tar.gz
|
||||
sha256 beb2e0404003de9a4cab9753a8805a8fe9320ee6673136ed7f04255fe60bb512 ruamel.yaml.clib-0.2.8.tar.gz
|
||||
# Locally computed sha256 checksums
|
||||
sha256 5458f90e82366f660f956b3c929ba5f7a0efdb99a99a847e2f51f2020ffbe887 LICENSE
|
||||
14
package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk
Normal file
14
package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk
Normal file
@@ -0,0 +1,14 @@
|
||||
################################################################################
|
||||
#
|
||||
# python-ruamel-yaml-clib
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON_RUAMEL_YAML_CLIB_VERSION = 0.2.8
|
||||
PYTHON_RUAMEL_YAML_CLIB_SOURCE = ruamel.yaml.clib-$(PYTHON_RUAMEL_YAML_CLIB_VERSION).tar.gz
|
||||
PYTHON_RUAMEL_YAML_CLIB_SITE = https://files.pythonhosted.org/packages/46/ab/bab9eb1566cd16f060b54055dd39cf6a34bfa0240c53a7218c43e974295b
|
||||
PYTHON_RUAMEL_YAML_CLIB_SETUP_TYPE = setuptools
|
||||
PYTHON_RUAMEL_YAML_CLIB_LICENSE = MIT
|
||||
PYTHON_RUAMEL_YAML_CLIB_LICENSE_FILES = LICENSE
|
||||
|
||||
$(eval $(python-package))
|
||||
@@ -25,3 +25,15 @@ parsed = yaml.load(yaml_text)
|
||||
|
||||
assert parsed['OneMoreRootKey'] == 9.99
|
||||
assert parsed['ListRoot'][1]['another-int'] == 1111
|
||||
|
||||
# Tests the C extension based loader
|
||||
# ruamel.yaml automatically falls back to the pure python version, so we need
|
||||
# to explicitly check if importing the CLoader works here.
|
||||
# Import this here, so it's clearer what part of the test is failing.
|
||||
from ruamel.yaml import CLoader # noqa: E402
|
||||
assert CLoader is not None
|
||||
yaml = YAML(typ='safe')
|
||||
parsed_from_c = yaml.load(yaml_text)
|
||||
|
||||
assert parsed_from_c['OneMoreRootKey'] == 9.99
|
||||
assert parsed_from_c['ListRoot'][1]['another-int'] == 1111
|
||||
|
||||
@@ -7,6 +7,7 @@ class TestPythonPy3RuamelYaml(TestPythonPackageBase):
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_RUAMEL_YAML=y
|
||||
BR2_PACKAGE_PYTHON_RUAMEL_YAML_CLIB=y
|
||||
"""
|
||||
sample_scripts = ["tests/package/sample_python_ruamel_yaml.py"]
|
||||
timeout = 40
|
||||
|
||||
Reference in New Issue
Block a user