Skip to contentSkip to conversation

package/python-yamllint: new package

PATCH Superseded Heiko Thiery 1 participant 3 messages Apr 12, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 package/python-yamllint: new package

This host package is needed since u-boot 2024.04 for building ti defconfigs.

This is an requirement for using buildman/binman [1].

[1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt?ref_type=tags#L3

---

v2:
- add missing runtime depnedencies
- a patch that enables the target build for python-pathspec is

    required https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

- add runtime test

 package/Config.in                                 |  1 +
 package/python-yamllint/Config.in                 |  8 ++++++++
 package/python-yamllint/python-yamllint.hash      |  3 +++
 package/python-yamllint/python-yamllint.mk        | 15 +++++++++++++++
 .../tests/package/sample_python_yamllint.py       | 13 +++++++++++++
 .../testing/tests/package/test_python_yamllint.py | 11 +++++++++++
 6 files changed, 51 insertions(+)
 create mode 100644 package/python-yamllint/Config.in
 create mode 100644 package/python-yamllint/python-yamllint.hash
 create mode 100644 package/python-yamllint/python-yamllint.mk
 create mode 100644 support/testing/tests/package/sample_python_yamllint.py
 create mode 100644 support/testing/tests/package/test_python_yamllint.py
package/Config.in +1 -0
index d9bbf64c95..1935077f0f 100644
@@ -1437,6 +1437,7 @@ menu "External python modules"
 	source "package/python-xmljson/Config.in"
 	source "package/python-xmltodict/Config.in"
 	source "package/python-xmodem/Config.in"
+	source "package/python-yamllint/Config.in"
 	source "package/python-yarl/Config.in"
 	source "package/python-yatl/Config.in"
 	source "package/python-zc-lockfile/Config.in"
package/python-yamllint/Config.in new file +8 -0
new file mode 100644
index 0000000000..5c0962f09f
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_YAMLLINT
+	bool "python-yamllint"
+	select BR2_PACKAGE_PYTHON_PATHSPEC # runtime
+	select BR2_PACKAGE_PYTHON_PYYAML # runtime
+	help
+	  A linter for YAML files.
+
+	  https://github.com/adrienverge/yamllint
package/python-yamllint/python-yamllint.hash new file +3 -0
new file mode 100644
index 0000000000..d80e0fdf42
@@ -0,0 +1,3 @@
+# Locally computed sha256 checksums
+sha256  7a003809f88324fd2c877734f2d575ee7881dd9043360657cc8049c809eba6cd  yamllint-1.35.1.tar.gz
+sha256  3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986  LICENSE
package/python-yamllint/python-yamllint.mk new file +15 -0
new file mode 100644
index 0000000000..ceaca3b0b8
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-yamllint
+#
+################################################################################
+
+PYTHON_YAMLLINT_VERSION = 1.35.1
+PYTHON_YAMLLINT_SOURCE = yamllint-$(PYTHON_YAMLLINT_VERSION).tar.gz
+PYTHON_YAMLLINT_SITE = https://files.pythonhosted.org/packages/da/06/d8cee5c3dfd550cc0a466ead8b321138198485d1034130ac1393cc49d63e
+PYTHON_YAMLLINT_SETUP_TYPE = pep517
+PYTHON_YAMLLINT_LICENSE = GPL-3.0
+PYTHON_YAMLLINT_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
+$(eval $(host-python-package))
support/testing/tests/package/sample_python_yamllint.py new file +13 -0
new file mode 100644
index 0000000000..369a3b8d7d
@@ -0,0 +1,13 @@
+# example form https://yamllint.readthedocs.io/en/stable/development.html
+
+from yamllint import (config, linter)
+
+data = '''---
+- &anchor
+  foo: bar
+- *anchor
+'''
+
+yaml_config = config.YamlLintConfig("extends: default")
+for p in linter.run(data, yaml_config):
+    print(p.desc, p.line, p.rule)
support/testing/tests/package/test_python_yamllint.py new file +11 -0
new file mode 100644
index 0000000000..226048ae87
@@ -0,0 +1,11 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonYamllint(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_YAMLLINT=y
+        """
+    sample_scripts = ["tests/package/sample_python_yamllint.py"]

--
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

PATCH v2 2/3 boot/ti-k3-r5-loader: add dependency to yamllint

Since U-Boot 2024.04 [1] binman also uses yamllint as dependency [2].

[1] https://source.denx.de/u-boot/u-boot/-/commit/10fee88d42f
[2] https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt?ref_type=tags#L3

---

v2:
- update URLs in the comment

 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
boot/ti-k3-r5-loader/ti-k3-r5-loader.mk +3 -2
index 0fb07f2d65..891783e40f 100644
@@ -35,8 +35,8 @@ TI_K3_R5_LOADER_LICENSE_FILES = Licenses/gpl-2.0.txt
 TI_K3_R5_LOADER_CPE_ID_VENDOR = denx
 TI_K3_R5_LOADER_CPE_ID_PRODUCT = u-boot
 TI_K3_R5_LOADER_INSTALL_IMAGES = YES
-# https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/tools/binman/binman.rst?plain=1#L377
-# https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/tools/buildman/requirements.txt
+# https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/binman/binman.rst?plain=1#L377
+# https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt
 # Make sure that all binman requirements are built before ti-k3-r5-loader.
 TI_K3_R5_LOADER_DEPENDENCIES = \
 	host-pkgconf \
@@ -49,6 +49,7 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
 	host-python-pylibfdt \
 	host-python-pyyaml \
 	host-python-setuptools \
+	host-python-yamllint \
 	ti-k3-boot-firmware
 
 TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)

--
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

PATCH v2 3/3 uboot/uboot: add new dependency to yamllint

In reply to Heiko Thiery

Since U-Boot 2024.04 [1] binman also uses yamllint as dependency [2].

[1] https://source.denx.de/u-boot/u-boot/-/commit/10fee88d42f
[2] https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt?ref_type=tags#L3

---

v2:
- update URLs in the comment

 boot/uboot/uboot.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
boot/uboot/uboot.mk +4 -2
index a894654698..0ee63cabdb 100644
@@ -276,10 +276,12 @@ UBOOT_DEPENDENCIES += host-vim
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_USE_BINMAN),y)
-# https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/tools/buildman/requirements.txt
+# https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/binman/binman.rst?plain=1#L377
+# https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt
 UBOOT_DEPENDENCIES += \
 	host-python-jsonschema \
-	host-python-pyyaml
+	host-python-pyyaml \
+	host-python-yamllint
 UBOOT_MAKE_OPTS += BINMAN_INDIRS=$(BINARIES_DIR)
 endif
 

--
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot