Mic92 / python-mpd2

Python library which provides a client interface for the Music Player Daemon.
GNU Lesser General Public License v3.0
352 stars 119 forks source link

Updates to the asyncio backend #139

Closed chrysn closed 3 years ago

chrysn commented 3 years ago

Apart from small fixes, this brings two changes:

Tests were added for the new functionality.

One test was changed, which in theory indicates potential for a breaking change. As the breakage was just in moving the exception from the creation of the future to its awaiting, it's unlikely to hit user code -- especially given that the actual code is the one that's just testing the asynchronous mocker.

One item possibly worth discussing is the binary extraction process. Right now, this is following precisely what the synchronous one does for albumart: just produce the binary and ignore any other keys. In light of #121, that may be worth reconsidering.

Mic92 commented 3 years ago

Do you also plan to fix?

/home/runner/work/python-mpd2/python-mpd2/mpd/asyncio.py:219: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
chrysn commented 3 years ago

Thanks, missed that; WIP together with the suggested name changes.

chrysn commented 3 years ago

Next steps from me are looking into another warning that's raising (it's really coming out of the mocker tester, but still...).

One more step that could be taken in here is to do the #121 changes right away, for which I think I already have a half-baked proposal. The only reason to keep it in here though is that it'd revert / simplify some of the binary changes in this PR.

Mic92 commented 3 years ago

Next steps from me are looking into another warning that's raising (it's really coming out of the mocker tester, but still...).

One more step that could be taken in here is to do the #121 changes right away, for which I think I already have a half-baked proposal. The only reason to keep it in here though is that it'd revert / simplify some of the binary changes in this PR.

Maybe I should also remove the deprecated api (send_idle etc) so that the test logs are cleaner w.r.t. to deprecation messages.

chrysn commented 3 years ago

If the send/fetch pairs were to go away, that might make the changes to have _execute_binary more aligned with _execute easier; in this case, I'd rather not do the #121 changes in this PR but, pending your approval (upon which I'd squash in the fixups), when both this and the removal of the deprecated functions is through.

Mic92 commented 3 years ago

If the send/fetch pairs were to go away, that might make the changes to have _execute_binary more aligned with _execute easier; in this case, I'd rather not do the #121 changes in this PR but, pending your approval (upon which I'd squash in the fixups), when both this and the removal of the deprecated functions is through.

_send/_fetch is removed.

chrysn commented 3 years ago

This has been incorporated into #141 and approved there (with further commits squashing into those here); therefore, closing.