Files
Khem Raj 0d404d8ab3 python3-pylint: fix crash with astroid >= 4.2
pylint 4.0.8 passes asname=False to Import.infer(), a keyword argument
astroid 4.2 removed. With the astroid 4.3.1 in meta-python this makes
pylint crash on any import of a missing submodule:

  TypeError: NodeNG.infer() got an unexpected keyword argument 'asname'

which shows up in ptest as astroid-error in three functional tests:

  FAIL: tests/test_functional.py:test_functional[fallback_import_enabled]
  FAIL: tests/test_functional.py:test_functional[import_error]
  FAIL: tests/test_functional.py:test_functional[no_name_in_module]

Backport the pylint/ part of upstream commit 554b1d192434 ("Bump
astroid to 4.2.0b4"), which drops the argument.

meta-python-image-ptest-python3-pylint on qemux86-64 now passes
872 tests with none failing.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-09-12 16:52:16 -07:00

61 lines
1.9 KiB
BlitzBasic

SUMMARY = "Pylint is a Python source code analyzer"
HOMEPAGE = "https://www.pylint.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c107cf754550e65755c42985a5d4e9c9"
SRCREV = "ecb84baf74ae152a511e5fdada5000c85250a48f"
SRC_URI += "git://github.com/pylint-dev/pylint;branch=main;protocol=https;tag=v${PV} \
file://0001-Adjust-test-expectations-for-ptest.patch \
file://0002-pyproject.toml-Keep-tool.setuptools.license-files.patch \
file://0003-astroid-4.1.2-endlineno.patch \
file://0004-checkers-variables-do-not-pass-asname-to-Import.infer.patch \
file://run-ptest \
"
inherit python_setuptools_build_meta ptest
RDEPENDS:${PN} += "\
python3-astroid \
python3-difflib \
python3-dill \
python3-isort \
python3-json \
python3-mccabe \
python3-netserver \
python3-numbers \
python3-pkgutil \
python3-platformdirs \
python3-shell \
python3-tomlkit \
"
# python3-misc for timeit.py
RDEPENDS:${PN}-ptest += " \
python3-core \
python3-git \
python3-misc \
python3-py \
python3-pytest \
python3-pytest-benchmark \
python3-pytest-runner \
python3-pytest-timeout \
python3-pytest-xdist \
python3-requests \
python3-statistics \
python3-tomllib \
python3-typing-extensions \
python3-unittest-automake-output \
"
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
install -Dm 0644 ${S}/tests/.pylint_primer_tests/.gitkeep ${D}${PTEST_PATH}/tests/.pylint_primer_tests/.gitkeep
sed -i 's#/usr/bin/python$#/usr/bin/python3#g' ${D}${PTEST_PATH}/tests/data/a_script
# regression_distutil_import_error_73.py fails to run see
# https://lists.openembedded.org/g/openembedded-devel/topic/103181847
rm ${D}${PTEST_PATH}/tests/functional/r/regression_02/regression_distutil_import_error_73.py
}
BBCLASSEXTEND = "native nativesdk"