From 63ebdf7e98ed07a1362d15b066734a14b9d41905 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 16 Aug 2026 08:52:11 +0200 Subject: [PATCH] python3-bleak: fetch git tag with tests/ for ptest instead of PyPI sdist The PyPI sdist ships no tests/ directory at all, so ptest had nothing to run from it (pytest exits 5, "no tests collected"). Fetch the matching git tag instead, which does include tests/, mirroring python3-pydantic's fetch pattern. Also set asyncio_mode=auto via a ptest-local pytest.ini: tests/test_adapter_deprecation.py has plain "async def" tests with no @pytest.mark.asyncio marker; they rely on upstream's pyproject.toml setting asyncio_mode=auto, which isn't shipped into the ptest package. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- .../python/python3-bleak_3.0.2.bb | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/meta-python/recipes-devtools/python/python3-bleak_3.0.2.bb b/meta-python/recipes-devtools/python/python3-bleak_3.0.2.bb index 022582e0e9..4d1e0b1666 100644 --- a/meta-python/recipes-devtools/python/python3-bleak_3.0.2.bb +++ b/meta-python/recipes-devtools/python/python3-bleak_3.0.2.bb @@ -3,14 +3,17 @@ HOMEPAGE = "https://github.com/hbldh/bleak" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=bcbc2069a86cba1b5e47253679f66ed7" -SRC_URI:append = " \ +# The PyPI sdist ships no tests/ directory at all, so ptest has nothing to +# run from it (pytest exits 5, "no tests collected"). Fetch the matching +# git tag instead, which does include tests/, mirroring python3-pydantic. +SRCREV = "bb49377d38afb3a9fac9022aaf2c8f59d4ef7cfe" +PV .= "+git" +SRC_URI = "git://github.com/hbldh/bleak;protocol=https;branch=develop \ file://run-ptest \ file://0001-bleak-Support-newer-uv_build-versions.patch \ " -inherit pypi python_uv_build ptest-python-pytest - -SRC_URI[sha256sum] = "c2229cb8238d5876b4bd05c74bf7a1aea1f88da39d2e51ac9dfd5cc319d5265f" +inherit python_uv_build ptest-python-pytest RDEPENDS:${PN}-ptest += " \ python3-asyncio \ @@ -24,3 +27,13 @@ RDEPENDS:${PN} += " \ python3-dbus-fast \ python3-xml \ " + +do_install_ptest:append() { + # tests/test_adapter_deprecation.py has plain "async def" tests with no + # @pytest.mark.asyncio marker; they rely on upstream's pyproject.toml + # setting asyncio_mode=auto, which isn't shipped into the ptest package. + cat > ${D}${PTEST_PATH}/pytest.ini <