Python 3.14 CI: ~25k `asyncio.get_event_loop_policy` / `set_event_loop_policy` deprecation warnings, all from the pinned pytest-asyncio 0.26
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 25/100
Línea de trabajo
The warnings come from the pinned pytest-asyncio 0.26 in the testing dependency group in pyproject.toml (line 51), so the pin is the place to look. The fix is already in draft PR #695, which changes the pin and adapts tests/conftest.py away from the removed event_loop fixture; start by reading that diff and PR #776 rather than starting fresh. Done means the Python 3.14 CI job no longer shows the policy deprecation annotations and the test suite still passes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The Run tests Python 3.14 job annotates every one of these calls. In https://github.com/zigpy/zha/actions/runs/32916926775/job/98022510877 that is 16,575 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16 plus 8,297 set_event_loop_policy — roughly 25k annotations in a single job, which buries the warnings that actually matter (the same log carries 82 asyncio.iscoroutinefunction ones and a handful of real quirks manufacturer_code warnings).
Source: pytest-asyncio, not zha
Every annotation that carries a file attributes to .venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py (lines 772, 777, 794, 874, 942, …). zha's own package and test suite contain no get_event_loop_policy / set_event_loop_policy call at all, and the only other installed package that even mentions the API does so in a comment (freezegun).
We pin pytest-asyncio<1.0 (pyproject.toml:51, in the testing dependency group) → 0.26.0, which calls the policy API directly. pytest-asyncio 1.0.0 wrapped every one of those calls in warnings.catch_warnings() + simplefilter("ignore", DeprecationWarning) — the _get_event_loop_policy() / _set_event_loop_policy() helpers in plugin.py — and 1.4.0 (still the current release) keeps them. So getting past the pin silences all ~25k with no change on our side; no local warning filter is needed.
Open PRs in this repo — and a wrinkle in two of them
The pin moved house: requirements_test.txt was deleted in #773 (3adff2ca, 2026-05-28) when the test dependencies became the testing dependency group in pyproject.toml. Two of the three PRs below still edit that deleted file, so neither of them moves the pin that is actually in effect today.
- #776 — dependabot: Bump pytest-asyncio from 0.26.0 to 1.4.0. Touches
pyproject.toml+uv.lock, i.e. the only one of the three aimed at where the pin now lives. - #695 — Bump pytest-asyncio to 1.3.0 (draft). This is the one that fixes this issue. Brought up to date in 9f981514: dev merged, the version bump moved from
requirements_test.txttopyproject.toml, anduv.lockregenerated to 1.4.0. With it, the suite goes from 12522 warnings to 83, none of them from pytest-asyncio. The substantive half is itstests/conftest.pyadaptation to the removedevent_loopfixture, without which the bump cannot work. - #476 — dependabot: Update pytest-asyncio requirement from
<1.0to<2.0(open since 2025-07-16). Editsrequirements_test.txtonly, so it is obsolete as it stands: dependabot is configured withpackage-ecosystem: uvand no longer manages that file at all. Probably closable. - #696 — Suppress expected warnings in tests (draft). Adjacent rather than a fix for this one: it filters warnings our own tests provoke, whereas these come from the plugin.
Home Assistant Core
- home-assistant/core#179871 — "Create event loops with a factory instead of an event loop policy" (balloob, merged 2026-08-25). This is the runtime half of the same 3.16 removal:
HassEventLoopPolicybecomes acreate_event_loop()factory, with the loop configuration moved intoconfigure_event_loop(), and the scripts passasyncio.run(..., loop_factory=...). zha installs no policy of its own, so there is nothing to port — but it is the reference for how the removal is being handled downstream, and worth watching if we ever want loop configuration of our own. - home-assistant/core#172886 — renovate: Update pytest-asyncio to 1.4.0 (merged 2026-06-03). HA Core is already past the pin, which is why their CI does not show this.
Related, same 3.16 removal wave
The same job logs 82 'asyncio.iscoroutinefunction' is deprecated … use inspect.iscoroutinefunction() instead warnings, and those are ours rather than the plugin's: zha/async_.py:136 is the only call site left. That half was tracked in #882 and is now fixed by #902 (merged), so it no longer contributes to the warning count. zigpy/bellows#741 already made the equivalent change there.
All PR states and file references re-verified against dev at c556ae20 on 2026-09-20.
- Lenguaje dominante
- Python
- Estrellas
- 96
- Forks
- 84
- Merge medio
- 3 d 1 h
- PR fusionados (30 d)
- 13
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de zigpy/zha
-
Analog output numbers and analog input sensors show eleven BACnet engineering units as a different unitPosiblemente ocupada @zigpy-review-bot la tomó hace 3 días. Abiertobot: code audit
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
device specific quirks
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
zigpy/zha#907 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
entities
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
zigpy/zha#855 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
quirks
Dificultad 3/5 Medio día Aptitud para principiantes 58/100
zigpy/zha#1072 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Issues similares
-
separate_packages splits imports from the same explicitly configured packagePosiblemente ocupada @rahul05ranjan la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
TigreGotico/text2spoken#626 ·
Los mantenedores suelen responder en 1 día
-
oncoref MappingProxyType in proteome.layers breaks deepcopy in reference_coverage._inventoryPosiblemente ocupada @iskandr la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
pipecat-ai/pipecat#7014 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
NL-BioImaging/biomero#136 ·
Los mantenedores suelen responder en 1 día