postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
838 stars 91 forks source link

Wrap coroutines passed to asyncio.wait with create_tasks because asyncio.wait does not support passing coroutines since python 3.11 #2270

Closed maxileith closed 8 months ago

maxileith commented 8 months ago

Hello everybody,

yesterday I reported the bug #2268.

Today, I have taken a look at the problem. It was a fairly easy fix. The problem was that asyncio.wait forbidds to pass coroutine objects directly since Python 3.11.

To fix this issue, the coroutines can just be wrapped in a task by utilizing asyncio.create_task.

If there are any questions, feel free to ask :).

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (d8c6b4d) 88.95% compared to head (9b3c642) 88.74%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2270 +/- ## ========================================== - Coverage 88.95% 88.74% -0.22% ========================================== Files 168 168 Lines 11370 11370 ========================================== - Hits 10114 10090 -24 - Misses 1256 1280 +24 ``` | [Files](https://app.codecov.io/gh/postlund/pyatv/pull/2270?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pierre+St%C3%A5hl) | Coverage Δ | | |---|---|---| | [pyatv/support/knock.py](https://app.codecov.io/gh/postlund/pyatv/pull/2270?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pierre+St%C3%A5hl#diff-cHlhdHYvc3VwcG9ydC9rbm9jay5weQ==) | `97.36% <100.00%> (ø)` | | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/postlund/pyatv/pull/2270/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pierre+St%C3%A5hl)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

maxileith commented 8 months ago

@postlund I have updated the PR. Could you please trigger the automated tests again?

postlund commented 8 months ago

Looks reasonable to me, I'll try to make a release as soon as I can. Thanks! 👍