diff mbox series

[patchtest,04/11] python3-pylint: upgrade 1.6.5 -> 2.17.4

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

Commit Message

Trevor Gamblin May 17, 2023, 8:22 p.m. UTC
Copy the recipe from meta-python to handle the upgrade, so that
patchtest can build it without requiring the layer.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 .../python/python3-pylint/run-ptest           |  3 ++
 .../python/python3-pylint_1.6.5.bb            | 33 ------------
 .../python/python3-pylint_2.17.4.bb           | 51 +++++++++++++++++++
 3 files changed, 54 insertions(+), 33 deletions(-)
 create mode 100644 meta-patchtest/recipes-devtools/python/python3-pylint/run-ptest
 delete mode 100644 meta-patchtest/recipes-devtools/python/python3-pylint_1.6.5.bb
 create mode 100644 meta-patchtest/recipes-devtools/python/python3-pylint_2.17.4.bb
diff mbox series

Patch

diff --git a/meta-patchtest/recipes-devtools/python/python3-pylint/run-ptest b/meta-patchtest/recipes-devtools/python/python3-pylint/run-ptest
new file mode 100644
index 0000000..7a5ceed
--- /dev/null
+++ b/meta-patchtest/recipes-devtools/python/python3-pylint/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --benchmark-disable -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-pylint_1.6.5.bb b/meta-patchtest/recipes-devtools/python/python3-pylint_1.6.5.bb
deleted file mode 100644
index 0bb9e3f..0000000
--- a/meta-patchtest/recipes-devtools/python/python3-pylint_1.6.5.bb
+++ /dev/null
@@ -1,33 +0,0 @@ 
-SUMMARY="Pylint is a Python source code analyzer"
-HOMEPAGE= "http://www.pylint.org/"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
-
-SRC_URI[md5sum] = "31da2185bf59142479e4fa16d8a9e347"
-SRC_URI[sha256sum] = "a673984a8dd78e4a8b8cfdee5359a1309d833cf38405008f4a249994a8456719"
-
-inherit pypi setuptools3
-
-SRC_URI += "file://0001-epylint-corrects-msg-template-object.patch"
-
-DEPENDS += "${PYTHON_PN}-pytest-runner-native"
-
-RDEPENDS_${PN} += "${PYTHON_PN}-astroid \
-                   ${PYTHON_PN}-isort \
-                   ${PYTHON_PN}-numbers \
-                   ${PYTHON_PN}-shell \
-                   ${PYTHON_PN}-json \
-                   ${PYTHON_PN}-pkgutil \
-                   ${PYTHON_PN}-difflib \
-                   ${PYTHON_PN}-netserver \
-                  "
-
-do_install:append(){
-    rm ${D}${bindir}/pylint
-    cat >> ${D}${bindir}/pylint <<EOF
-#!/usr/bin/env ${PYTHON_PN}
-from pylint import run_pylint
-run_pylint()
-EOF
-    chmod 755 ${D}${bindir}/pylint
-}
diff --git a/meta-patchtest/recipes-devtools/python/python3-pylint_2.17.4.bb b/meta-patchtest/recipes-devtools/python/python3-pylint_2.17.4.bb
new file mode 100644
index 0000000..96fce2e
--- /dev/null
+++ b/meta-patchtest/recipes-devtools/python/python3-pylint_2.17.4.bb
@@ -0,0 +1,51 @@ 
+SUMMARY="Pylint is a Python source code analyzer"
+HOMEPAGE= "http://www.pylint.org/"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c107cf754550e65755c42985a5d4e9c9"
+
+SRC_URI += " \
+        git://github.com/pylint-dev/pylint;branch=main;protocol=https \
+        file://run-ptest \
+        file://0001-pyproject.toml-Remove-hard-coded-dependencies.patch \
+        file://0001-pylint-remove-plugin-pickle-test.patch \
+        "
+SRCREV ?= "fc34a4b6abe56f3ac07ca15d846b1c1955545f85"
+
+inherit python_setuptools_build_meta ptest
+
+RDEPENDS:${PN} += "${PYTHON_PN}-astroid \
+                   ${PYTHON_PN}-dill \
+                   ${PYTHON_PN}-isort \
+                   ${PYTHON_PN}-mccabe \
+                   ${PYTHON_PN}-numbers \
+                   ${PYTHON_PN}-platformdirs \
+                   ${PYTHON_PN}-shell \
+                   ${PYTHON_PN}-json \
+                   ${PYTHON_PN}-pkgutil \
+                   ${PYTHON_PN}-difflib \
+                   ${PYTHON_PN}-netserver \
+                   ${PYTHON_PN}-tomlkit \
+                  "
+
+RDEPENDS:${PN}-ptest += " \
+        ${PYTHON_PN}-core \
+        ${PYTHON_PN}-git \
+        ${PYTHON_PN}-py \
+        ${PYTHON_PN}-pytest \
+        ${PYTHON_PN}-pytest-benchmark \
+        ${PYTHON_PN}-pytest-runner \
+        ${PYTHON_PN}-pytest-timeout \
+        ${PYTHON_PN}-pytest-xdist \
+        ${PYTHON_PN}-requests \
+        ${PYTHON_PN}-statistics \
+        ${PYTHON_PN}-tomllib \
+        ${PYTHON_PN}-typing-extensions \
+        "
+
+S = "${WORKDIR}/git"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+    sed -i 's#/usr/bin/python$#/usr/bin/python3#g' ${D}${PTEST_PATH}/tests/data/ascript
+}