Files
meta-openembedded/meta-python/recipes-devtools/python/python3-bleak_3.0.2.bb
T
Khem Raj 63ebdf7e98 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 <raj.khem@gmail.com>
2026-08-29 21:43:04 -07:00

40 lines
1.2 KiB
BlitzBasic

SUMMARY = "Bleak is a GATT client software, capable of connecting to BLE devices acting as GATT servers."
HOMEPAGE = "https://github.com/hbldh/bleak"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=bcbc2069a86cba1b5e47253679f66ed7"
# 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 python_uv_build ptest-python-pytest
RDEPENDS:${PN}-ptest += " \
python3-asyncio \
python3-pytest-asyncio \
python3-pytest-cov \
python3-bumble \
"
RDEPENDS:${PN} += " \
python3-core (>3.8) \
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 <<EOF
[pytest]
asyncio_mode = auto
EOF
}