diff mbox series

[4/5] python3-websockets: enable ptest; use git fetcher

Message ID 20261102011816.3710992-4-tim.orling@konsulko.com
State Under Review
Headers show
Series [1/5] python3-uvloop: import 0.22.1 from meta-homeassistant | expand

Commit Message

Tim Orling Nov. 2, 2026, 1:18 a.m. UTC
From: Tim Orling <tim.orling@konsulko.com>

The PyPI sdist prunes tests/, so fetch the 17.1 tag from git. This
re-enables ptest, reverted in a0488f2e1d when the sdist dropped the tests.

Upstream advises packagers against running the suite because timeout
tests can flake on slow build farms; under ptest it runs on the target,
and it passed repeatedly on qemux86-64.

tests/trio is ignored because python3-trio is not in oe-core.
python3-misc provides tracemalloc for the test utilities. Set
CVE_PRODUCT to the NVD websockets_project:websockets, since the pypi
default no longer applies and never matched.

Tested with core-image-ptest-python3-websockets on qemux86-64 (kvm):
2031 passed, 75 skipped, 0 failed in 82s, so add it to PTESTS_SLOW.

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta/conf/distro/include/ptest-packagelists.inc   |  1 +
 .../python/python3-websockets/run-ptest           |  3 +++
 .../python/python3-websockets_17.1.bb             | 15 +++++++++++++--
 3 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100755 meta/recipes-devtools/python/python3-websockets/run-ptest
diff mbox series

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 50b971bace..7ec75757bc 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -155,6 +155,7 @@  PTESTS_SLOW = "\
     python3-cryptography \
     python3-numpy \
     python3-uvloop \
+    python3-websockets \
     python3-xmltodict \
     strace \
     tar \
diff --git a/meta/recipes-devtools/python/python3-websockets/run-ptest b/meta/recipes-devtools/python/python3-websockets/run-ptest
new file mode 100755
index 0000000000..a71ba0b951
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-websockets/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+# tests/trio requires python3-trio, which is not in oe-core
+pytest --automake --ignore=tests/trio
diff --git a/meta/recipes-devtools/python/python3-websockets_17.1.bb b/meta/recipes-devtools/python/python3-websockets_17.1.bb
index b5ee3ec661..d1bec373e0 100644
--- a/meta/recipes-devtools/python/python3-websockets_17.1.bb
+++ b/meta/recipes-devtools/python/python3-websockets_17.1.bb
@@ -4,12 +4,23 @@  HOMEPAGE = "https://github.com/aaugustin/websockets"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=51924a6af4495b8cfaee1b1da869b6f4"
 
-inherit pypi python_setuptools_build_meta
+# The PyPI sdist prunes tests, so fetch from git for ptest
+SRC_URI = "\
+    git://github.com/python-websockets/websockets;branch=main;protocol=https;tag=${PV} \
+    file://run-ptest \
+"
+SRCREV = "e87ea9be0373edd5065b5e94dfa714cfde23023b"
+
+CVE_PRODUCT = "websockets_project:websockets"
 
-SRC_URI[sha256sum] = "acfea4c20bf54384883ea33b1240fc1db4f52e190823a4e2b334bc3e8bfca96a"
+inherit python_setuptools_build_meta ptest-python-pytest
 
 BBCLASSEXTEND = "native nativesdk"
 
 RDEPENDS:${PN} = " \
     python3-asyncio \
 "
+
+RDEPENDS:${PN}-ptest += "\
+    python3-misc \
+"