diff mbox series

[meta-python] python3-pyyaml-include: add initial recipe for version 1.3.2

Message ID 20240214230452.2252927-1-derek@asterius.io
State Accepted
Headers show
Series [meta-python] python3-pyyaml-include: add initial recipe for version 1.3.2 | expand

Commit Message

Derek Straka Feb. 14, 2024, 11:04 p.m. UTC
Add a recipe for the pyyaml-include package that extends PyYAML to include
YAML files within YAML files.  Add a ptest to run the unit tests and include
the tests as part of the package lists in meta-python

Signed-off-by: Derek Straka <derek@asterius.io>
---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-pyyaml-include/run-ptest   |  3 ++
 .../python/python3-pyyaml-include_1.3.2.bb    | 28 +++++++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100755 meta-python/recipes-devtools/python/python3-pyyaml-include/run-ptest
 create mode 100644 meta-python/recipes-devtools/python/python3-pyyaml-include_1.3.2.bb
diff mbox series

Patch

diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index 44507b394..44704208e 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -38,6 +38,7 @@  PTESTS_FAST_META_PYTHON = "\
     python3-pyserial \
     python3-pytest-mock \
     python3-pytoml \
+    python3-pyyaml-include \
     python3-rapidjson \
     python3-requests-file \
     python3-requests-toolbelt \
diff --git a/meta-python/recipes-devtools/python/python3-pyyaml-include/run-ptest b/meta-python/recipes-devtools/python/python3-pyyaml-include/run-ptest
new file mode 100755
index 000000000..3385d6893
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pyyaml-include/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
diff --git a/meta-python/recipes-devtools/python/python3-pyyaml-include_1.3.2.bb b/meta-python/recipes-devtools/python/python3-pyyaml-include_1.3.2.bb
new file mode 100644
index 000000000..9bfaa2194
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pyyaml-include_1.3.2.bb
@@ -0,0 +1,28 @@ 
+SUMMARY = "Extending PyYAML with a custom constructor for including YAML files within YAML files"
+HOMEPAGE = "https://github.com/tanbro/pyyaml-include"
+LICENSE = "GPL-3.0-only"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS += "${PYTHON_PN}-setuptools-scm-native"
+SRCREV = "36b6975aa8fc7a6cbf37de40aa2ed6d996b2f7be"
+
+SRC_URI = " \
+            git://github.com/tanbro/pyyaml-include;protocol=https;branch=main \
+            file://run-ptest \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit python_setuptools_build_meta ptest
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+RDEPENDS:${PN} += " \
+    ${PYTHON_PN}-pyyaml \
+"
+RDEPENDS:${PN}-ptest += " \
+    ${PYTHON_PN}-pytest \
+"
+