diff mbox series

[10/11] python3-platformdirs: add recipe

Message ID 20230517201456.1608917-11-tgamblin@baylibre.com
State New
Headers show
Series patchtest: layer updates | expand

Commit Message

Trevor Gamblin May 17, 2023, 8:14 p.m. UTC
python3-pylint requires python3-platformdirs, so copy it from
meta-python to avoid requiring that layer for patchtest.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 .../python/python3-platformdirs/run-ptest     |  3 ++
 .../python/python3-platformdirs_3.5.1.bb      | 35 +++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 meta-patchtest/recipes-devtools/python/python3-platformdirs/run-ptest
 create mode 100644 meta-patchtest/recipes-devtools/python/python3-platformdirs_3.5.1.bb
diff mbox series

Patch

diff --git a/meta-patchtest/recipes-devtools/python/python3-platformdirs/run-ptest b/meta-patchtest/recipes-devtools/python/python3-platformdirs/run-ptest
new file mode 100644
index 0000000..b63c4de
--- /dev/null
+++ b/meta-patchtest/recipes-devtools/python/python3-platformdirs/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/SKIPPED/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-patchtest/recipes-devtools/python/python3-platformdirs_3.5.1.bb b/meta-patchtest/recipes-devtools/python/python3-platformdirs_3.5.1.bb
new file mode 100644
index 0000000..4fefe56
--- /dev/null
+++ b/meta-patchtest/recipes-devtools/python/python3-platformdirs_3.5.1.bb
@@ -0,0 +1,35 @@ 
+SUMMARY = "A small Python module for determining appropriate platform-specific dirs"
+HOMEPAGE = "https://github.com/platformdirs/platformdirs"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ea4f5a41454746a9ed111e3d8723d17a"
+
+SRC_URI = " \
+    git://github.com/platformdirs/platformdirs.git;branch=main;protocol=https \
+    file://run-ptest \
+"
+
+SRCREV ?= "b8c42ddca4def1fba38b9815a7d94ec2ac630b29"
+SRC_URI[sha256sum] = "7954a68d0ba23558d753f73437c55f89027cf8f5108c19844d4b82e5af396335"
+
+inherit python_setuptools_build_meta ptest
+
+DEPENDS += " \
+    python3-hatch-vcs-native \
+    python3-setuptools-scm-native \
+    python3-toml-native \
+"
+
+S = "${WORKDIR}/git"
+
+RDEPENDS:${PN}-ptest += " \
+    ${PYTHON_PN}-appdirs \
+    ${PYTHON_PN}-pytest \
+    ${PYTHON_PN}-pytest-mock \
+"
+
+do_install_ptest() {
+        install -d ${D}${PTEST_PATH}/Tests
+        cp -rf ${S}/tests ${D}${PTEST_PATH}/
+}
+
+BBCLASSEXTEND = "native"