Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-python-mpd2 for openSUSE:Factory checked in at 2022-04-11 23:49:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-mpd2 (Old) and /work/SRC/openSUSE:Factory/.python-python-mpd2.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-mpd2" Mon Apr 11 23:49:31 2022 rev:4 rq:969216 version:3.0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-mpd2/python-python-mpd2.changes 2021-10-19 23:04:35.245293656 +0200 +++ /work/SRC/openSUSE:Factory/.python-python-mpd2.new.1900/python-python-mpd2.changes 2022-04-11 23:50:56.149912059 +0200 @@ -1,0 +2,9 @@ +Mon Apr 11 13:08:14 UTC 2022 - Mark??ta Machov?? <mmach...@suse.com> + +- Update to 3.0.5 + * python 3.10 compatibility + * fixes for using idle in async + * use python's internal mock library instead of external mock + * expose connection status in async (connected property) + +------------------------------------------------------------------- Old: ---- python-mpd2-3.0.4.tar.gz New: ---- python-mpd2-3.0.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-mpd2.spec ++++++ --- /var/tmp/diff_new_pack.WAdxTY/_old 2022-04-11 23:50:56.673906081 +0200 +++ /var/tmp/diff_new_pack.WAdxTY/_new 2022-04-11 23:50:56.677906035 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-python-mpd2 # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-python-mpd2 -Version: 3.0.4 +Version: 3.0.5 Release: 0 Summary: A Python MPD client library License: LGPL-3.0-only @@ -27,7 +27,6 @@ URL: https://github.com/Mic92/python-mpd2 Source: https://files.pythonhosted.org/packages/source/p/python-mpd2/python-mpd2-%{version}.tar.gz BuildRequires: %{python_module Twisted} -BuildRequires: %{python_module mock} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros ++++++ python-mpd2-3.0.4.tar.gz -> python-mpd2-3.0.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/PKG-INFO new/python-mpd2-3.0.5/PKG-INFO --- old/python-mpd2-3.0.4/PKG-INFO 2021-02-02 12:55:17.601168400 +0100 +++ new/python-mpd2-3.0.5/PKG-INFO 2022-01-17 18:41:12.224058400 +0100 @@ -1,152 +1,11 @@ Metadata-Version: 2.1 Name: python-mpd2 -Version: 3.0.4 +Version: 3.0.5 Summary: A Python MPD client library Home-page: https://github.com/Mic92/python-mpd2 Author: Joerg Thalheim Author-email: jo...@thalheim.io License: GNU Lesser General Public License v3 (LGPLv3) -Description: python-mpd2 - =========== - - .. image:: https://travis-ci.org/Mic92/python-mpd2.png?branch=master - :target: http://travis-ci.org/Mic92/python-mpd2 - :alt: Build Status - - *python-mpd2* is a Python library which provides a client interface for - the `Music Player Daemon <http://musicpd.org>`__. - - - Difference with python-mpd - -------------------------- - - python-mpd2 is a fork of `python-mpd`_. While 0.4.x was backwards compatible - with python-mpd, starting with 0.5 provides enhanced features which are *NOT* - backward compatibles with the original `python-mpd`_ package (see `Porting - Guide <https://python-mpd2.readthedocs.io/en/latest/topics/porting.html>`__ - for more information). - - The following features were added: - - - Python 3 support (but you need at least Python 3.6) - - asyncio/twisted support - - support for the client-to-client protocol - - support for new commands from MPD (seekcur, prio, prioid, - config, searchadd, searchaddpl, listfiles, rangeid, addtagid, cleartagid, - mount, umount, listmounts, listneighbors) - - remove deprecated commands (volume) - - explicitly declared MPD commands (which is handy when using for - example `IPython <http://ipython.org>`__) - - a test suite - - API documentation to add new commands (see `Future Compatible <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#future-compatible>`__) - - support for Unicode strings in all commands (optionally in python2, - default in python3 - see `Unicode Handling <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#unicode-handling>`__) - - configureable timeouts - - support for `logging <https://python-mpd2.readthedocs.io/en/latest/topics/logging.html>`__ - - improved support for sticker - - improved support for ranges - - - Getting the latest source code - ------------------------------ - - If you would like to use the latest source code, you can grab a - copy of the development version from Git by running the command:: - - $ git clone https://github.com/Mic92/python-mpd2.git - - - Getting the latest release - -------------------------- - - The latest stable release of *python-mpd2* can be found on - `PyPI <http://pypi.python.org/pypi?:action=display&name=python-mpd2>`__ - - - PyPI: - ~~~~~ - - :: - - $ pip install python-mpd2 - - - Installation in Linux/BSD distributions - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Until Linux distributions adapt this package, here are some ready to use - packages to test your applications: - - See `INSTALL.rst <INSTALL.rst>`__ - - - Installing from source - ---------------------- - - To install *python-mpd2* from source, simply run the command:: - - $ python setup.py install - - You can use the *--help* switch to *setup.py* for a complete list of commands - and their options. See the `Installing Python Modules <http://docs.python.org/inst/inst.html>`__ document for more details. - - - Documentation - ------------- - - `Documentation <https://python-mpd2.readthedocs.io/en/latest/>`__ - - `Getting Started <https://python-mpd2.readthedocs.io/en/latest/topics/getting-started.html>`__ - - `Command Reference <https://python-mpd2.readthedocs.io/en/latest/topics/commands.html>`__ - - `Examples <examples>`__ - - - Testing - ------- - - Just run:: - - $ python setup.py test - - This will install `Tox <http://tox.testrun.org/>`__. Tox will take care of - testing against all the supported Python versions (at least available) on our - computer, with the required dependencies - - If you have nix, you can also use the provided `default.nix` to bring all supported - python versions in scope using `nix-shell`. In that case run `tox` directly instead - of using `setup.py`:: - - $ nix-shell --command 'tox' - - - Building Documentation - ---------------------- - - Install Sphinx:: - - $ easy_install -U Sphinx - - Change to the source directory and run:: - - $ python ./setup.py build_sphinx - - The command reference is generated from the official mpd protocol documentation. - In order to update it, install python-lxml and run the following command:: - - $ python ./doc/generate_command_reference.py > ./doc/topics/commands.rst - - - Contacting the author - --------------------- - - Just contact me (Mic92) on Github or via email (jo...@thalheim.io). - - .. |Build Status| image:: https://travis-ci.org/Mic92/python-mpd2.png - - .. _python-mpd: https://pypi.python.org/pypi/python-mpd/ - Keywords: mpd Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable @@ -159,3 +18,140 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.6 Provides-Extra: twisted +License-File: LICENSE.txt + +python-mpd2 +=========== + +.. image:: https://travis-ci.org/Mic92/python-mpd2.png?branch=master + :target: http://travis-ci.org/Mic92/python-mpd2 + :alt: Build Status + +*python-mpd2* is a Python library which provides a client interface for +the `Music Player Daemon <http://musicpd.org>`__. + + +Difference with python-mpd +-------------------------- + +python-mpd2 is a fork of `python-mpd`_. While 0.4.x was backwards compatible +with python-mpd, starting with 0.5 provides enhanced features which are *NOT* +backward compatibles with the original `python-mpd`_ package (see `Porting +Guide <https://python-mpd2.readthedocs.io/en/latest/topics/porting.html>`__ +for more information). + +The following features were added: + +- Python 3 support (but you need at least Python 3.6) +- asyncio/twisted support +- support for the client-to-client protocol +- support for new commands from MPD (seekcur, prio, prioid, + config, searchadd, searchaddpl, listfiles, rangeid, addtagid, cleartagid, + mount, umount, listmounts, listneighbors) +- remove deprecated commands (volume) +- explicitly declared MPD commands (which is handy when using for + example `IPython <http://ipython.org>`__) +- a test suite +- API documentation to add new commands (see `Future Compatible <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#future-compatible>`__) +- support for Unicode strings in all commands (optionally in python2, + default in python3 - see `Unicode Handling <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#unicode-handling>`__) +- configurable timeouts +- support for `logging <https://python-mpd2.readthedocs.io/en/latest/topics/logging.html>`__ +- improved support for sticker +- improved support for ranges + + +Getting the latest source code +------------------------------ + +If you would like to use the latest source code, you can grab a +copy of the development version from Git by running the command:: + + $ git clone https://github.com/Mic92/python-mpd2.git + + +Getting the latest release +-------------------------- + +The latest stable release of *python-mpd2* can be found on +`PyPI <http://pypi.python.org/pypi?:action=display&name=python-mpd2>`__ + + +PyPI: +~~~~~ + +:: + + $ pip install python-mpd2 + + +Installation in Linux/BSD distributions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Until Linux distributions adapt this package, here are some ready to use +packages to test your applications: + +See `INSTALL.rst <INSTALL.rst>`__ + + +Installing from source +---------------------- + +To install *python-mpd2* from source, simply run the command:: + + $ python setup.py install + +You can use the *--help* switch to *setup.py* for a complete list of commands +and their options. See the `Installing Python Modules <http://docs.python.org/inst/inst.html>`__ document for more details. + + +Documentation +------------- + +`Documentation <https://python-mpd2.readthedocs.io/en/latest/>`__ + +`Getting Started <https://python-mpd2.readthedocs.io/en/latest/topics/getting-started.html>`__ + +`Command Reference <https://python-mpd2.readthedocs.io/en/latest/topics/commands.html>`__ + +`Examples <examples>`__ + + +Testing +------- + +Just run:: + + $ python setup.py test + +This will install `Tox <http://tox.testrun.org/>`__. Tox will take care of +testing against all the supported Python versions (at least available) on our +computer, with the required dependencies + +If you have nix, you can also use the provided `default.nix` to bring all supported +python versions in scope using `nix-shell`. In that case run `tox` directly instead +of using `setup.py`:: + + $ nix-shell --command 'tox' + + +Building Documentation +---------------------- + +Install Sphinx:: + + $ easy_install -U Sphinx + +Change to the source directory and run:: + + $ python ./setup.py build_sphinx + +The command reference is generated from the official mpd protocol documentation. +In order to update it, install python-lxml and run the following command:: + + $ python ./doc/generate_command_reference.py > ./doc/topics/commands.rst + + +.. _python-mpd: https://pypi.python.org/pypi/python-mpd/ + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/README.rst new/python-mpd2-3.0.5/README.rst --- old/python-mpd2-3.0.4/README.rst 2020-12-24 07:08:45.000000000 +0100 +++ new/python-mpd2-3.0.5/README.rst 2021-10-29 21:31:55.000000000 +0200 @@ -33,7 +33,7 @@ - API documentation to add new commands (see `Future Compatible <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#future-compatible>`__) - support for Unicode strings in all commands (optionally in python2, default in python3 - see `Unicode Handling <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#unicode-handling>`__) -- configureable timeouts +- configurable timeouts - support for `logging <https://python-mpd2.readthedocs.io/en/latest/topics/logging.html>`__ - improved support for sticker - improved support for ranges @@ -130,11 +130,4 @@ $ python ./doc/generate_command_reference.py > ./doc/topics/commands.rst -Contacting the author ---------------------- - -Just contact me (Mic92) on Github or via email (jo...@thalheim.io). - -.. |Build Status| image:: https://travis-ci.org/Mic92/python-mpd2.png - .. _python-mpd: https://pypi.python.org/pypi/python-mpd/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/doc/changes.rst new/python-mpd2-3.0.5/doc/changes.rst --- old/python-mpd2-3.0.4/doc/changes.rst 2021-02-02 12:41:53.000000000 +0100 +++ new/python-mpd2-3.0.5/doc/changes.rst 2022-01-17 18:35:45.000000000 +0100 @@ -1,6 +1,14 @@ python-mpd2 Changes List ======================== +Changes in v3.0.5 +----------------- + +* python 3.10 compatibility +* fixes for using idle in async +* use python's internal mock library instead of external mock +* expose connection status in async (connected property) + Changes in v3.0.4 ----------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/doc/topics/advanced.rst new/python-mpd2-3.0.5/doc/topics/advanced.rst --- old/python-mpd2-3.0.4/doc/topics/advanced.rst 2020-11-20 15:53:59.000000000 +0100 +++ new/python-mpd2-3.0.5/doc/topics/advanced.rst 2021-10-29 21:31:55.000000000 +0200 @@ -21,7 +21,7 @@ Thread-Safety ------------- -Currently ``MPDClient`` is **NOT** thread-safe. As it use a socket internaly, +Currently ``MPDClient`` is **NOT** thread-safe. As it use a socket internally, only one thread can send or receive at the time. But ``MPDClient`` can be easily extended to be thread-safe using `locks diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/doc/topics/commands.rst new/python-mpd2-3.0.5/doc/topics/commands.rst --- old/python-mpd2-3.0.4/doc/topics/commands.rst 2021-01-14 09:37:37.000000000 +0100 +++ new/python-mpd2-3.0.5/doc/topics/commands.rst 2021-10-29 21:31:55.000000000 +0200 @@ -825,7 +825,7 @@ Multiple storages can be "mounted" together, similar to the mount command on many operating systems, but without cooperation from - the kernel. No superuser privileges are necessary, beause this + the kernel. No superuser privileges are necessary, because this mapping exists only inside the MPD process .. function:: MPDClient.mount(path, uri) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/doc/topics/getting-started.rst new/python-mpd2-3.0.5/doc/topics/getting-started.rst --- old/python-mpd2-3.0.4/doc/topics/getting-started.rst 2018-02-20 08:34:15.000000000 +0100 +++ new/python-mpd2-3.0.5/doc/topics/getting-started.rst 2021-10-29 21:31:55.000000000 +0200 @@ -64,6 +64,6 @@ 'file: song3.mp3',] Second element can be omitted. MPD will assumes the biggest possible number then (don't forget the comma!):: -NOTE: mpd versions between 0.16.8 and 0.17.3 contains a bug, so ommiting doesn't work. +NOTE: mpd versions between 0.16.8 and 0.17.3 contains a bug, so omitting doesn't work. >>> client.delete((1,)) # delete all songs, but the first. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/mpd/asyncio.py new/python-mpd2-3.0.5/mpd/asyncio.py --- old/python-mpd2-3.0.4/mpd/asyncio.py 2021-01-16 16:39:10.000000000 +0100 +++ new/python-mpd2-3.0.5/mpd/asyncio.py 2021-10-29 21:32:26.000000000 +0200 @@ -18,6 +18,7 @@ This module requires Python 3.5.2 or later to run. """ +import warnings import asyncio from functools import partial from typing import Optional, List, Tuple, Iterable, Callable, Union @@ -147,10 +148,20 @@ #: Indicator of whether there is a pending idle command that was not terminated yet. # When in doubt; this is True, thus erring at the side of caution (because - # a "noidle" being sent while racing against an incmoing idle notification + # a "noidle" being sent while racing against an incoming idle notification # does no harm) __in_idle = False + #: Indicator that the last attempted idle failed. + # + # When set, IMMEDIATE_COMMAND_TIMEOUT is ignored in favor of waiting until + # *something* else happens, and only then retried. + # + # Note that the only known condition in which this happens is when between + # start of the connection and the presentation of credentials, more than + # IMMEDIATE_COMMAND_TIMEOUT passes. + __idle_failed = False + #: Seconds after a command's completion to send idle. Setting this too high # causes "blind spots" in the client's view of the server, setting it too # low sends needless idle/noidle after commands in quick succession. @@ -189,10 +200,12 @@ self.__rfile = self.__wfile = None async def connect(self, host, port=6600, loop=None): + if loop is not None: + warnings.warn("loop passed into MPDClient.connect is ignored, this will become an error", DeprecationWarning) if "/" in host: - r, w = await asyncio.open_unix_connection(host, loop=loop) + r, w = await asyncio.open_unix_connection(host) else: - r, w = await asyncio.open_connection(host, port, loop=loop) + r, w = await asyncio.open_connection(host, port) self.__rfile, self.__wfile = r, w self.__command_queue = asyncio.Queue(maxsize=self.COMMAND_QUEUE_LENGTH) @@ -208,6 +221,10 @@ self.__run_task = asyncio.Task(self.__run()) + @property + def connected(self): + return self.__run_task is not None + def disconnect(self): if ( self.__run_task is not None @@ -247,6 +264,7 @@ async def __run(self): # See CommandResult._feed_error documentation await asyncio.sleep(0) + result = None try: while True: @@ -260,6 +278,15 @@ # in this case is intended, and is just what asyncio.Queue # suggests for "get with timeout". + if self.__idle_failed: + # We could try for a more elaborate path where we now + # await the command queue indefinitely, but as we're + # already in an error case, this whole situation only + # persists until the error is processed somewhere else, + # so ticking once per idle timeout is OK to keep things + # simple. + continue + subsystems = self._get_idle_interests() if subsystems is None: # The presumably most quiet subsystem -- in this case, @@ -269,10 +296,15 @@ # Careful: There can't be any await points between the # except and here, or the sequence between the idle and the # command processor might be wrong. - result = CommandResult("idle", subsystems, lambda result: self.__distribute_idle_result(self._parse_list(result))) + result = CommandResult("idle", subsystems, self._parse_list) + result.add_done_callback(self.__idle_result) self.__in_idle = True self._write_command(result._command, result._args) + # A new command was issued, so there's a chance that whatever + # made idle fail is now fixed. + self.__idle_failed = False + try: await result._feed_from(self) except CommandError as e: @@ -288,25 +320,37 @@ self.disconnect() if result is not None: - if self.__in_idle: - # There isn't anything listening for this result, and - # setting the error would just trigger an error report - # about an uncollected exception. - result.cancel() - else: - # The last command has failed: Forward that result. - result._feed_error(e) + # The last command has failed: Forward that result. + # + # (In idle, that's fine too -- everyone watching see a + # nonspecific event). + result._feed_error(e) return else: raise # Typically this is a bug in mpd.asyncio. - def __distribute_idle_result(self, result): - # An exception flying out of here probably means a connection - # interruption during idle. This will just show like any other - # unhandled task exception and that's probably the best we can do. + def __idle_result(self, result): + try: + idle_changes = result.result() + except CommandError as e: + # Don't retry until something changed + self.__idle_failed = True + + # Not raising this any further: The callbacks are notified that + # "something is up" (which is all their API gives), and whichever + # command is issued to act on it will hopefully run into the same + # condition. + # + # This does swallow the exact error cause. + + idle_changes = set() + for subsystems, _ in self.__idle_consumers: + idle_changes = idle_changes.union(subsystems) + + # make generator accessible multiple times + idle_changes = list(idle_changes) - idle_changes = list(result) for subsystems, callback in self.__idle_consumers: if not subsystems or any(s in subsystems for s in idle_changes): callback(idle_changes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/mpd/base.py new/python-mpd2-3.0.5/mpd/base.py --- old/python-mpd2-3.0.4/mpd/base.py 2021-02-02 12:41:53.000000000 +0100 +++ new/python-mpd2-3.0.5/mpd/base.py 2022-01-17 18:36:19.000000000 +0100 @@ -26,7 +26,7 @@ from enum import Enum -VERSION = (3, 0, 4) +VERSION = (3, 0, 5) HELLO_PREFIX = "OK MPD " ERROR_PREFIX = "ACK " ERROR_PATTERN = re.compile(r"\[(?P<errno>\d+)@(?P<offset>\d+)\]\s+{(?P<command>\w+)}\s+(?P<msg>.*)") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/mpd/tests.py new/python-mpd2-3.0.5/mpd/tests.py --- old/python-mpd2-3.0.4/mpd/tests.py 2020-12-24 07:08:45.000000000 +0100 +++ new/python-mpd2-3.0.5/mpd/tests.py 2021-10-29 21:32:26.000000000 +0200 @@ -12,6 +12,7 @@ import warnings import unittest +from unittest import mock try: from twisted.python.failure import Failure @@ -26,11 +27,6 @@ import asyncio -try: - import mock -except ImportError: - print("Please install mock from PyPI to run tests!") - sys.exit(1) # show deprecation warnings warnings.simplefilter("default") @@ -55,7 +51,7 @@ # Create a new socket.socket() mock with default attributes, # each time we are calling it back (otherwise, it keeps set # attributes across calls). - # That's probablyy what we want, since reconnecting is like + # That's probably what we want, since reconnecting is like # reinitializing the entire connection, and so, the mock. mock.MagicMock(name="socket.socket") ) @@ -1266,12 +1262,19 @@ self.mockserver.expect_exchange([], hello_lines) self.client = mpd.asyncio.MPDClient() - self._await(self.client.connect(TEST_MPD_HOST, TEST_MPD_PORT, loop=self.loop)) + self._await(self.client.connect(TEST_MPD_HOST, TEST_MPD_PORT)) asyncio.open_connection.assert_called_with( - TEST_MPD_HOST, TEST_MPD_PORT, loop=self.loop + TEST_MPD_HOST, TEST_MPD_PORT ) + def __del__(self): + # Clean up after init_client. (This works for now; if it causes + # trouble, change all init_client to a `with init_client` or use + # fixtures). + if hasattr(self, "client"): + self.client.disconnect() + def _await(self, future): return self.loop.run_until_complete(future) @@ -1489,6 +1492,65 @@ self.mockserver.expect_exchange([b"expecting odd things\n"], [b""]) self.assertRaises(AssertionError, self._await, self.client.status()) + async def _test_idle(self): + self.mockserver.expect_exchange( + [b'idle "database"\n',], + [b"ACK [4@0] don't let you yet but you shouldn't care\n"], + ) + self.mockserver.expect_exchange( + # code could be smarter and set __in_idle = False and not set + # noidle, but it's not *wrong* either + [b'noidle\n', b'password "1234"\n',], + [b"OK\n"], + ) + self.mockserver.expect_exchange( + [b'idle "playlist"\n'], + [b'idle: playlist\n', b"OK\n"], + ) + self.mockserver.expect_exchange( + [b'noidle\n', b'currentsong\n'], + # it's a bit brief but it'll be accepted + [b"OK\n", ], + ) + self.mockserver.expect_exchange( + [b'idle "playlist"\n'], + [b"ACK [4@0] I don't let you observe for no other reason\n"], + ) + self.mockserver.expect_exchange( + [b'noidle\n', b'status\n'], + [b"ACK [4@0] whatever made the idle failed now fails too\n", ], + ) + + # clearly longer than IMMEDITE_COMMAND_TIMEOUT + await asyncio.sleep(0.5) + + await self.client.password("1234") + + async for changeset in self.client.idle(["playlist"]): + # the one regular event sent + self.assertEqual(changeset, ["playlist"]) + break + + await self.client.currentsong() + + async for changeset in self.client.idle(["playlist"]): + # watching for regular events but the error also gets shown as an event + self.assertEqual(changeset, ["playlist"]) + break + + try: + await self.client.status() + except mpd.CommandError: + pass + else: + raise AssertionError("The status should have flushed out the error that made the idle fail in the first place") + + self.client.disconnect() + + def test_idle(self): + self.init_client() + self._await(self._test_idle()) + if __name__ == "__main__": unittest.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/python_mpd2.egg-info/PKG-INFO new/python-mpd2-3.0.5/python_mpd2.egg-info/PKG-INFO --- old/python-mpd2-3.0.4/python_mpd2.egg-info/PKG-INFO 2021-02-02 12:55:17.000000000 +0100 +++ new/python-mpd2-3.0.5/python_mpd2.egg-info/PKG-INFO 2022-01-17 18:41:12.000000000 +0100 @@ -1,152 +1,11 @@ Metadata-Version: 2.1 Name: python-mpd2 -Version: 3.0.4 +Version: 3.0.5 Summary: A Python MPD client library Home-page: https://github.com/Mic92/python-mpd2 Author: Joerg Thalheim Author-email: jo...@thalheim.io License: GNU Lesser General Public License v3 (LGPLv3) -Description: python-mpd2 - =========== - - .. image:: https://travis-ci.org/Mic92/python-mpd2.png?branch=master - :target: http://travis-ci.org/Mic92/python-mpd2 - :alt: Build Status - - *python-mpd2* is a Python library which provides a client interface for - the `Music Player Daemon <http://musicpd.org>`__. - - - Difference with python-mpd - -------------------------- - - python-mpd2 is a fork of `python-mpd`_. While 0.4.x was backwards compatible - with python-mpd, starting with 0.5 provides enhanced features which are *NOT* - backward compatibles with the original `python-mpd`_ package (see `Porting - Guide <https://python-mpd2.readthedocs.io/en/latest/topics/porting.html>`__ - for more information). - - The following features were added: - - - Python 3 support (but you need at least Python 3.6) - - asyncio/twisted support - - support for the client-to-client protocol - - support for new commands from MPD (seekcur, prio, prioid, - config, searchadd, searchaddpl, listfiles, rangeid, addtagid, cleartagid, - mount, umount, listmounts, listneighbors) - - remove deprecated commands (volume) - - explicitly declared MPD commands (which is handy when using for - example `IPython <http://ipython.org>`__) - - a test suite - - API documentation to add new commands (see `Future Compatible <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#future-compatible>`__) - - support for Unicode strings in all commands (optionally in python2, - default in python3 - see `Unicode Handling <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#unicode-handling>`__) - - configureable timeouts - - support for `logging <https://python-mpd2.readthedocs.io/en/latest/topics/logging.html>`__ - - improved support for sticker - - improved support for ranges - - - Getting the latest source code - ------------------------------ - - If you would like to use the latest source code, you can grab a - copy of the development version from Git by running the command:: - - $ git clone https://github.com/Mic92/python-mpd2.git - - - Getting the latest release - -------------------------- - - The latest stable release of *python-mpd2* can be found on - `PyPI <http://pypi.python.org/pypi?:action=display&name=python-mpd2>`__ - - - PyPI: - ~~~~~ - - :: - - $ pip install python-mpd2 - - - Installation in Linux/BSD distributions - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Until Linux distributions adapt this package, here are some ready to use - packages to test your applications: - - See `INSTALL.rst <INSTALL.rst>`__ - - - Installing from source - ---------------------- - - To install *python-mpd2* from source, simply run the command:: - - $ python setup.py install - - You can use the *--help* switch to *setup.py* for a complete list of commands - and their options. See the `Installing Python Modules <http://docs.python.org/inst/inst.html>`__ document for more details. - - - Documentation - ------------- - - `Documentation <https://python-mpd2.readthedocs.io/en/latest/>`__ - - `Getting Started <https://python-mpd2.readthedocs.io/en/latest/topics/getting-started.html>`__ - - `Command Reference <https://python-mpd2.readthedocs.io/en/latest/topics/commands.html>`__ - - `Examples <examples>`__ - - - Testing - ------- - - Just run:: - - $ python setup.py test - - This will install `Tox <http://tox.testrun.org/>`__. Tox will take care of - testing against all the supported Python versions (at least available) on our - computer, with the required dependencies - - If you have nix, you can also use the provided `default.nix` to bring all supported - python versions in scope using `nix-shell`. In that case run `tox` directly instead - of using `setup.py`:: - - $ nix-shell --command 'tox' - - - Building Documentation - ---------------------- - - Install Sphinx:: - - $ easy_install -U Sphinx - - Change to the source directory and run:: - - $ python ./setup.py build_sphinx - - The command reference is generated from the official mpd protocol documentation. - In order to update it, install python-lxml and run the following command:: - - $ python ./doc/generate_command_reference.py > ./doc/topics/commands.rst - - - Contacting the author - --------------------- - - Just contact me (Mic92) on Github or via email (jo...@thalheim.io). - - .. |Build Status| image:: https://travis-ci.org/Mic92/python-mpd2.png - - .. _python-mpd: https://pypi.python.org/pypi/python-mpd/ - Keywords: mpd Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable @@ -159,3 +18,140 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.6 Provides-Extra: twisted +License-File: LICENSE.txt + +python-mpd2 +=========== + +.. image:: https://travis-ci.org/Mic92/python-mpd2.png?branch=master + :target: http://travis-ci.org/Mic92/python-mpd2 + :alt: Build Status + +*python-mpd2* is a Python library which provides a client interface for +the `Music Player Daemon <http://musicpd.org>`__. + + +Difference with python-mpd +-------------------------- + +python-mpd2 is a fork of `python-mpd`_. While 0.4.x was backwards compatible +with python-mpd, starting with 0.5 provides enhanced features which are *NOT* +backward compatibles with the original `python-mpd`_ package (see `Porting +Guide <https://python-mpd2.readthedocs.io/en/latest/topics/porting.html>`__ +for more information). + +The following features were added: + +- Python 3 support (but you need at least Python 3.6) +- asyncio/twisted support +- support for the client-to-client protocol +- support for new commands from MPD (seekcur, prio, prioid, + config, searchadd, searchaddpl, listfiles, rangeid, addtagid, cleartagid, + mount, umount, listmounts, listneighbors) +- remove deprecated commands (volume) +- explicitly declared MPD commands (which is handy when using for + example `IPython <http://ipython.org>`__) +- a test suite +- API documentation to add new commands (see `Future Compatible <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#future-compatible>`__) +- support for Unicode strings in all commands (optionally in python2, + default in python3 - see `Unicode Handling <https://python-mpd2.readthedocs.io/en/latest/topics/advanced.html#unicode-handling>`__) +- configurable timeouts +- support for `logging <https://python-mpd2.readthedocs.io/en/latest/topics/logging.html>`__ +- improved support for sticker +- improved support for ranges + + +Getting the latest source code +------------------------------ + +If you would like to use the latest source code, you can grab a +copy of the development version from Git by running the command:: + + $ git clone https://github.com/Mic92/python-mpd2.git + + +Getting the latest release +-------------------------- + +The latest stable release of *python-mpd2* can be found on +`PyPI <http://pypi.python.org/pypi?:action=display&name=python-mpd2>`__ + + +PyPI: +~~~~~ + +:: + + $ pip install python-mpd2 + + +Installation in Linux/BSD distributions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Until Linux distributions adapt this package, here are some ready to use +packages to test your applications: + +See `INSTALL.rst <INSTALL.rst>`__ + + +Installing from source +---------------------- + +To install *python-mpd2* from source, simply run the command:: + + $ python setup.py install + +You can use the *--help* switch to *setup.py* for a complete list of commands +and their options. See the `Installing Python Modules <http://docs.python.org/inst/inst.html>`__ document for more details. + + +Documentation +------------- + +`Documentation <https://python-mpd2.readthedocs.io/en/latest/>`__ + +`Getting Started <https://python-mpd2.readthedocs.io/en/latest/topics/getting-started.html>`__ + +`Command Reference <https://python-mpd2.readthedocs.io/en/latest/topics/commands.html>`__ + +`Examples <examples>`__ + + +Testing +------- + +Just run:: + + $ python setup.py test + +This will install `Tox <http://tox.testrun.org/>`__. Tox will take care of +testing against all the supported Python versions (at least available) on our +computer, with the required dependencies + +If you have nix, you can also use the provided `default.nix` to bring all supported +python versions in scope using `nix-shell`. In that case run `tox` directly instead +of using `setup.py`:: + + $ nix-shell --command 'tox' + + +Building Documentation +---------------------- + +Install Sphinx:: + + $ easy_install -U Sphinx + +Change to the source directory and run:: + + $ python ./setup.py build_sphinx + +The command reference is generated from the official mpd protocol documentation. +In order to update it, install python-lxml and run the following command:: + + $ python ./doc/generate_command_reference.py > ./doc/topics/commands.rst + + +.. _python-mpd: https://pypi.python.org/pypi/python-mpd/ + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-mpd2-3.0.4/setup.py new/python-mpd2-3.0.5/setup.py --- old/python-mpd2-3.0.4/setup.py 2020-11-20 15:50:34.000000000 +0100 +++ new/python-mpd2-3.0.5/setup.py 2021-10-29 21:31:55.000000000 +0200 @@ -80,7 +80,6 @@ test_suite="mpd.tests", tests_require=[ 'tox', - 'mock', 'Twisted' ], cmdclass={