python-anyio: add test.sh and python3-urllib dep
authorAlexandru Ardelean <redacted>
Sun, 31 May 2026 08:12:04 +0000 (11:12 +0300)
committerAlexandru Ardelean <redacted>
Mon, 1 Jun 2026 05:10:59 +0000 (08:10 +0300)
Exercise anyio end-to-end with the structured-concurrency example
from the upstream "Creating and managing tasks" docs: spawn 5 child
tasks via create_task_group(), each appending to a shared list, then
verify all completed.

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/python-anyio/Makefile
lang/python/python-anyio/test.sh [new file with mode: 0755]

index 9dad76aa0d5bc64894e846ae798e677e6962ad6e..bb72bb8c44341b3ac02dff1bff41e373ab02e091 100644 (file)
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-anyio
 PKG_VERSION:=4.13.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PYPI_NAME:=anyio
 PKG_HASH:=334b70e641fd2221c1505b3890c69882fe4a2df910cba14d97019b90b24439dc
@@ -36,7 +36,8 @@ define Package/python3-anyio
     +python3-idna \
     +python3-light \
     +python3-logging \
-    +python3-openssl
+    +python3-openssl \
+    +python3-urllib
 endef
 
 define Package/python3-anyio/description
diff --git a/lang/python/python-anyio/test.sh b/lang/python/python-anyio/test.sh
new file mode 100755 (executable)
index 0000000..3c7da50
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+[ "$1" = python3-anyio ] || exit 0
+
+# anyio has no module-level __version__; apk already verifies the package
+# version, so this test exercises runtime behaviour instead.
+
+python3 - << 'EOF'
+from anyio import create_task_group, run, sleep
+
+# Spawn N children in a task group and check they all complete via a shared
+# sink — exercises the asyncio backend and structured-concurrency wait barrier.
+results = []
+
+
+async def child(num: int) -> None:
+    await sleep(0)
+    results.append(num)
+
+
+async def main() -> None:
+    async with create_task_group() as tg:
+        for num in range(5):
+            tg.start_soon(child, num)
+
+
+run(main)
+
+assert sorted(results) == [0, 1, 2, 3, 4], f"unexpected child completions: {results}"
+
+print("python3-anyio OK")
+EOF
git clone https://git.99rst.org/PROJECT