From d389ed9e3342aadcca29a18340b4fe07924ad69e Mon Sep 17 00:00:00 2001 From: Zhang Xiao Date: Mon, 27 Apr 2026 07:00:57 +0000 Subject: [PATCH] python3-aspectlib: Fix pytest compatibility Partially backport upstream commit to fix pytest compatibility issue. Fixes pytest errors e.g. | pytest.PytestRemovedIn9Warning: The (path: py.path.local) argument is deprecated, please use (collection_path: pathlib.Path) | see https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path | ERROR: Exit status is 1 Signed-off-by: Zhang Xiao Signed-off-by: Khem Raj --- ...-aspectlib-backport-fix-for-selftest.patch | 37 +++++++++++++++++++ .../python/python3-aspectlib_2.0.0.bb | 1 + 2 files changed, 38 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-aspectlib/0001-python3-aspectlib-backport-fix-for-selftest.patch diff --git a/meta-python/recipes-devtools/python/python3-aspectlib/0001-python3-aspectlib-backport-fix-for-selftest.patch b/meta-python/recipes-devtools/python/python3-aspectlib/0001-python3-aspectlib-backport-fix-for-selftest.patch new file mode 100644 index 0000000000..05d7b63126 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-aspectlib/0001-python3-aspectlib-backport-fix-for-selftest.patch @@ -0,0 +1,37 @@ +From 2e007c5c3ed048491c29e37991e6788f41728b31 Mon Sep 17 00:00:00 2001 +From: Ionel Cristian Mărieș +Date: Fri, 24 Apr 2026 13:17:54 +0000 +Subject: [PATCH] python3-aspectlib: backport fix for selftest + +Partial backport of upstream commit b85abdb056("Fix some cleanup regressions") + +Changes excluded: +The stacklevel assertion updates in test_aspectlib.py and +test_integrations.py are omitted. These are specific to upstream's +test suite configuration and cause failures in this environment +without providing functional value to the core library. + +Upstream-Status: Backport [https://github.com/ionelmc/python-aspectlib/commit/b85abdb0565d1598ce56bd49d49dc709d4e16081] + +Signed-off-by: Zhang Xiao +--- + tests/conftest.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index ee54d9d..29caa50 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -1,5 +1,6 @@ +-def pytest_ignore_collect(path, config): +- basename = path.basename ++from pathlib import Path + +- if 'pytestsupport' in basename: ++ ++def pytest_ignore_collect(collection_path: Path, config): ++ if 'pytestsupport' in collection_path.__fspath__(): + return True +-- +2.53.0 + diff --git a/meta-python/recipes-devtools/python/python3-aspectlib_2.0.0.bb b/meta-python/recipes-devtools/python/python3-aspectlib_2.0.0.bb index 854a14441c..7bfee7ff7a 100644 --- a/meta-python/recipes-devtools/python/python3-aspectlib_2.0.0.bb +++ b/meta-python/recipes-devtools/python/python3-aspectlib_2.0.0.bb @@ -8,6 +8,7 @@ HOMEPAGE = "https://github.com/ionelmc/python-aspectlib" LICENSE = "BSD-2-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=80721ace117fd1f814049ecb81c6be76" +SRC_URI += "file://0001-python3-aspectlib-backport-fix-for-selftest.patch" SRC_URI[sha256sum] = "a4b461b9da0b531aebcb93efcde3de808a72c60226dd8d902c467d13faf7ce92" inherit ptest-python-pytest pypi setuptools3