diff --git a/.travis.yml b/.travis.yml index 648c3252..7c73868a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,12 @@ -sudo: required -dist: trusty +dist: xenial language: python python: - - "2.7_with_system_site_packages" + - "2.7" + +virtualenv: + system_site_packages: true env: - TOX_ENV=py27 diff --git a/MANIFEST.in b/MANIFEST.in index b2b7f37c..5eb0eaa3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,8 +8,11 @@ include LICENSE include MANIFEST.in include tox.ini +recursive-include .github * + recursive-include docs * prune docs/_build +prune docs/.doctrees recursive-include extra * diff --git a/docs/changelog.rst b/docs/changelog.rst index 49163755..fa2b3dcf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,11 +4,15 @@ Changelog This changelog is used to track all major changes to Mopidy. -v2.2.2 (UNRELEASED) + +v2.2.2 (2018-12-29) =================== Bug fix release. +- HTTP: Fix hang on exit due to change in Tornado v5.0 IOLoop. (Fixes: + :issue:`1715`, PR: :issue:`1716`) + - Files: Fix crash due to mix of text and bytes in paths that come from ``$XDG_CONFIG_HOME/user-dirs.dirs``. (Fixes: :issue:`1676`, :issue:`1725`) diff --git a/mopidy/__init__.py b/mopidy/__init__.py index 67658e48..cffc01b1 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -14,4 +14,4 @@ if not (2, 7) <= sys.version_info < (3,): warnings.filterwarnings('ignore', 'could not open display') -__version__ = '2.2.1' +__version__ = '2.2.2' diff --git a/mopidy/http/actor.py b/mopidy/http/actor.py index 8b4835da..1e0e594c 100644 --- a/mopidy/http/actor.py +++ b/mopidy/http/actor.py @@ -100,20 +100,21 @@ class HttpServer(threading.Thread): self.app = None self.server = None + self.io_loop = None def run(self): self.app = tornado.web.Application(self._get_request_handlers()) self.server = tornado.httpserver.HTTPServer(self.app) self.server.add_sockets(self.sockets) - tornado.ioloop.IOLoop.instance().start() + self.io_loop = tornado.ioloop.IOLoop.current() + self.io_loop.start() logger.debug('Stopped HTTP server') def stop(self): logger.debug('Stopping HTTP server') - tornado.ioloop.IOLoop.instance().add_callback( - tornado.ioloop.IOLoop.instance().stop) + self.io_loop.add_callback(self.io_loop.stop) def _get_request_handlers(self): request_handlers = [] diff --git a/mopidy/mpd/protocol/__init__.py b/mopidy/mpd/protocol/__init__.py index 99294f4d..aab8ed8d 100644 --- a/mopidy/mpd/protocol/__init__.py +++ b/mopidy/mpd/protocol/__init__.py @@ -38,7 +38,7 @@ def load_protocol_modules(): def INT(value): # noqa: N802 - """Converts a value that matches [+-]?\d+ into and integer.""" + r"""Converts a value that matches [+-]?\d+ into and integer.""" if value is None: raise ValueError('None is not a valid integer') # TODO: check for whitespace via value != value.strip()? @@ -46,7 +46,7 @@ def INT(value): # noqa: N802 def UINT(value): # noqa: N802 - """Converts a value that matches \d+ into an integer.""" + r"""Converts a value that matches \d+ into an integer.""" if value is None: raise ValueError('None is not a valid integer') if not value.isdigit(): diff --git a/setup.cfg b/setup.cfg index 95211279..1bc167c3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,8 @@ application-import-names = mopidy,tests exclude = .git,.tox,build,js,tmp # Ignored flake8 warnings: # - E402 module level import not at top of file -ignore = E402 +# - W504 line break after binary operator +ignore = E402, W504 [wheel] universal = 1 diff --git a/tasks.py b/tasks.py index db7143a5..cc4f71b2 100644 --- a/tasks.py +++ b/tasks.py @@ -42,7 +42,7 @@ def watcher(task, *args, **kwargs): task(*args, **kwargs) try: run( - 'inotifywait -q -e create -e modify -e delete ' - '--exclude ".*\.(pyc|sw.)" -r docs/ mopidy/ tests/') + r'inotifywait -q -e create -e modify -e delete ' + r'--exclude ".*\.(pyc|sw.)" -r docs/ mopidy/ tests/') except KeyboardInterrupt: sys.exit() diff --git a/tests/__init__.py b/tests/__init__.py index 99806e97..c121a947 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -23,7 +23,7 @@ class IsA(object): try: return isinstance(rhs, self.klass) except TypeError: - return type(rhs) == type(self.klass) # flake8: noqa + return type(rhs) == type(self.klass) # noqa def __ne__(self, rhs): return not self.__eq__(rhs) diff --git a/tests/mpd/protocol/test_regression.py b/tests/mpd/protocol/test_regression.py index 40a3f103..156db777 100644 --- a/tests/mpd/protocol/test_regression.py +++ b/tests/mpd/protocol/test_regression.py @@ -161,7 +161,7 @@ class IssueGH69RegressionTest(protocol.BaseTestCase): class IssueGH113RegressionTest(protocol.BaseTestCase): - """ + r""" The issue: https://github.com/mopidy/mopidy/issues/113 How to reproduce: @@ -174,11 +174,11 @@ class IssueGH113RegressionTest(protocol.BaseTestCase): def test(self): self.core.playlists.create( - u'all lart spotify:track:\w\{22\} pastes') + r'all lart spotify:track:\w\{22\} pastes') self.send_request('lsinfo "/"') self.assertInResponse( - u'playlist: all lart spotify:track:\w\{22\} pastes') + r'playlist: all lart spotify:track:\w\{22\} pastes') self.send_request( r'listplaylistinfo "all lart spotify:track:\\w\\{22\\} pastes"')