mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-08-31 15:51:17 +00:00
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>
This commit is contained in:
@@ -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 <<EOF
|
||||
[pytest]
|
||||
asyncio_mode = auto
|
||||
EOF
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user