Skip to content

Commit

Permalink
Release v2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Oct 2, 2019
2 parents 458380d + 653bf68 commit 6841478
Show file tree
Hide file tree
Showing 41 changed files with 499 additions and 195 deletions.
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2.1

orbs:
codecov: codecov/codecov@1.0.5

workflows:
version: 2
test:
jobs:
- py27
#- py37
#- black
#- check-manifest
- docs
- flake8

jobs:
py37: &test-template
docker:
- image: mopidy/ci-python:3.7
steps:
- checkout
- restore_cache:
name: Restoring tox cache
keys:
- tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}
- tox-v1-{{ .Environment.CIRCLE_JOB }}
- run:
name: Run tests
command: |
tox -e $CIRCLE_JOB -- \
--junit-xml=test-results/pytest/results.xml \
--cov-report=xml
- save_cache:
name: Saving tox cache
key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}
paths:
- ./.tox
- ~/.cache/pip
- codecov/upload:
file: coverage.xml
- store_test_results:
path: test-results

py27: *test-template

black: *test-template

check-manifest: *test-template

docs: *test-template

flake8: *test-template
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ include *.py
include *.rst
include *.txt
include .mailmap
include .travis.yml
include AUTHORS
include LICENSE
include MANIFEST.in
include tox.ini

recursive-include .circleci *
recursive-include .github *

recursive-include docs *
Expand Down
14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ To get started with Mopidy, check out
:target: https://pypi.python.org/pypi/Mopidy/
:alt: Latest PyPI version

.. image:: https://img.shields.io/travis/mopidy/mopidy/develop.svg?style=flat
:target: https://travis-ci.org/mopidy/mopidy
:alt: Travis CI build status
.. image:: https://img.shields.io/circleci/project/github/mopidy/mopidy/develop.svg
:target: https://circleci.com/gh/mopidy/mopidy
:alt: CircleCI build status

.. image:: https://img.shields.io/coveralls/mopidy/mopidy/develop.svg?style=flat
:target: https://coveralls.io/r/mopidy/mopidy?branch=develop
.. image:: https://img.shields.io/readthedocs/mopidy.svg
:target: https://docs.mopidy.com/
:alt: Read the Docs build status

.. image:: https://img.shields.io/codecov/c/github/mopidy/mopidy/develop.svg
:target: https://codecov.io/gh/mopidy/mopidy
:alt: Test coverage
37 changes: 37 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,43 @@ This changelog is used to track all major changes to Mopidy.
For older releases, see :ref:`history`.


v2.3.0 (2019-10-02)
===================

Mopidy 2.3.0 is mostly a bug fix release. Because we're requiring a new major
version of Tornado, we're doing a minor version bump of Mopidy.

- Dependencies: Support and require Tornado >=, < 6, as that is the latest
version support Python 2.7 and currently the oldest version shipped by Debian
and Arch. (Fixes: :issue:`1798`, PR: :issue:`1796`)

- Fix ``PkgResourcesDeprecationWarning`` on startup when a recent release
of setuptools is installed. (Fixes: :issue:`1778`, PR: :issue:`1780`)

- Network: Close connection following an exception in the protocol handler.
(Fixes: :issue:`1762`, PR: :issue:`1765`)

- Network: Log client's connection details instead of server's. This fixed a
regression introduced as part of PR: :issue:`1629`. (Fixes: :issue:`1788`,
PR: :issue:`1792`)

- Core: Trigger :meth:`mopidy.core.CoreListener.stream_title_changed` event
on recieving a ``title`` audio tag that differs from the current track's
:attr:`mopidy.models.Track.name`. (Fixes: :issue:`1746`, PR: :issue:`1751`)

- Stream: Support playlists containing relative URIs. (Fixes: :issue:`1785`,
PR: :issue:`1802`)

- Stream: Fix crash when unwrapping stream without MIME type. (Fixes:
:issue:`1760`, PR: :issue:`1800`)

- MPD: Add support for seeking to time positions with float point precision.
(Fixes: :issue:`1756`, PR: :issue:`1801`)

- MPD: Handle URIs containing non-ASCII characters. (Fixes: :issue:`1759`,
PR: :issue:`1805`, :issue:`1808`)


v2.2.3 (2019-06-20)
===================

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Pull request guidelines
``docs/add-ext-mopidy-spotify-tunigo``.

#. Follow the :ref:`code style <codestyle>`, especially make sure the
``flake8`` linter does not complain about anything. Travis CI will check
``flake8`` linter does not complain about anything. CircleCI will check
that your pull request is "flake8 clean". See :ref:`code-linting`.

#. Include tests for any new feature or substantial bug fix. See
Expand Down
29 changes: 14 additions & 15 deletions docs/devenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ You need to know at least one command; the one that runs all the tests::

tox

This will run exactly the same tests as `Travis CI
<https://travis-ci.org/mopidy/mopidy>`_ runs for all our branches and pull
This will run exactly the same tests as `CircleCI
<https://circleci.com/gh/mopidy/mopidy>`_ runs for all our branches and pull
requests. If this command turns green, you can be quite confident that your
pull request will get the green flag from Travis as well, which is a
pull request will get the green flag from CircleCI as well, which is a
requirement for it to be merged.

As this is the ultimate test command, it's also the one taking the most time to
Expand Down Expand Up @@ -300,7 +300,7 @@ the given module, ``mopidy`` in this example, are covered by the test suite::
.. note::

Up to date test coverage statistics can also be viewed online at
`coveralls.io <https://coveralls.io/github/mopidy/mopidy>`_.
`Codecov <https://codecov.io/gh/mopidy/mopidy>`_.

If we want to speed up the test suite, we can even get a list of the ten
slowest tests::
Expand All @@ -314,16 +314,16 @@ development can be very useful.
Continuous integration
----------------------

Mopidy uses the free service `Travis CI <https://travis-ci.org/mopidy/mopidy>`_
Mopidy uses the free service `CircleCI`_
for automatically running the test suite when code is pushed to GitHub. This
works both for the main Mopidy repo, but also for any forks. This way, any
contributions to Mopidy through GitHub will automatically be tested by Travis
CI, and the build status will be visible in the GitHub pull request interface,
contributions to Mopidy through GitHub will automatically be tested by CircleCI,
and the build status will be visible in the GitHub pull request interface,
making it easier to evaluate the quality of pull requests.

For each successful build, Travis submits code coverage data to `coveralls.io
<https://coveralls.io/github/mopidy/mopidy>`_. If you're out of work, coveralls might
help you find areas in the code which could need better test coverage.
For each successful build, CircleCI submits code coverage data to `Codecov`_.
If you're out of work, Codecov might help you find areas in the code which
could need better test coverage.


.. _code-linting:
Expand All @@ -338,7 +338,7 @@ Luckily, you can get very far by using the `flake8
<http://flake8.readthedocs.io/>`_ linter to check your code for issues before
submitting a pull request. Mopidy passes all of flake8's checks, with only a
very few exceptions configured in :file:`setup.cfg`. You can either run the
``flake8`` tox environment, like Travis CI will do on your pull request::
``flake8`` tox environment, like CircleCI will do on your pull request::

tox -e flake8

Expand Down Expand Up @@ -559,11 +559,10 @@ https://github.com/mopidy/mopidy, and `create a pull request
Updating a pull request
-----------------------

When the pull request is created, `Travis CI
<https://travis-ci.org/mopidy/mopidy>`__ will run all tests on it. If something
When the pull request is created, `CircleCI`_ will run all tests on it. If something
fails, you'll get notified by email. You might as well just fix the issues
right away, as we won't merge a pull request without a green Travis build. See
:ref:`running-tests` on how to run the same tests locally as Travis CI runs on
right away, as we won't merge a pull request without a green CircleCI build. See
:ref:`running-tests` on how to run the same tests locally as CircleCI runs on
your pull request.

When you've fixed the issues, you can update the pull request simply by pushing
Expand Down
4 changes: 1 addition & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Sphinx >= 1.0, != 1.8.0
Sphinx >= 1.3, != 1.8.0
pygraphviz
Pykka >= 1.1
# Require newer requests than what Travis/Debian has to work around linkcheck crash
requests > 2.4.3
sphinx_rtd_theme
2 changes: 1 addition & 1 deletion mopidy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
warnings.filterwarnings('ignore', 'could not open display')


__version__ = '2.2.3'
__version__ = '2.3.0'
1 change: 1 addition & 0 deletions mopidy/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def fake_python3_urllib_module():
urllib.parse.quote = py2_urllib.quote
urllib.parse.unquote = py2_urllib.unquote

urllib.parse.urljoin = py2_urlparse.urljoin
urllib.parse.urlparse = py2_urlparse.urlparse
urllib.parse.urlsplit = py2_urlparse.urlsplit
urllib.parse.urlunsplit = py2_urlparse.urlunsplit
Expand Down
14 changes: 8 additions & 6 deletions mopidy/core/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ def tags_changed(self, tags):
if not tags:
return

# TODO: this limits us to only streams that set organization, this is
# a hack to make sure we don't emit stream title changes for plain
# tracks. We need a better way to decide if something is a stream.
if 'title' in tags and tags['title'] and 'organization' in tags:
# TODO: this is a hack to make sure we don't emit stream title changes
# for plain tracks. We need a better way to decide if something is a
# stream.
if 'title' in tags and tags['title']:
title = tags['title'][0]
self.playback._stream_title = title
CoreListener.send('stream_title_changed', title=title)
current_track = self.playback.get_current_track()
if current_track is not None and current_track.name != title:
self.playback._stream_title = title
CoreListener.send('stream_title_changed', title=title)

def setup(self):
"""Do not call this function. It is for internal use at startup."""
Expand Down
2 changes: 1 addition & 1 deletion mopidy/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def load_extensions():
for entry_point in pkg_resources.iter_entry_points('mopidy.ext'):
logger.debug('Loading entry point: %s', entry_point)
try:
extension_class = entry_point.load(require=False)
extension_class = entry_point.resolve()
except Exception as e:
logger.exception("Failed to load extension %s: %s" % (
entry_point.name, e))
Expand Down
6 changes: 3 additions & 3 deletions mopidy/http/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def on_stop(self):
self.server.stop()

def on_event(self, name, **data):
on_event(name, **data)
on_event(name, self.server.io_loop, **data)


def on_event(name, **data):
def on_event(name, io_loop, **data):
event = data
event['event'] = name
message = json.dumps(event, cls=models.ModelJSONEncoder)
handlers.WebSocketHandler.broadcast(message)
handlers.WebSocketHandler.broadcast(message, io_loop)


class HttpServer(threading.Thread):
Expand Down
7 changes: 3 additions & 4 deletions mopidy/http/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@ class WebSocketHandler(tornado.websocket.WebSocketHandler):
clients = set()

@classmethod
def broadcast(cls, msg):
loop = tornado.ioloop.IOLoop.current()

def broadcast(cls, msg, io_loop):
# This can be called from outside the Tornado ioloop, so we need to
# safely cross the thread boundary by adding a callback to the loop.
for client in cls.clients:
# One callback per client to keep time we hold up the loop short
loop.add_callback(functools.partial(_send_broadcast, client, msg))
io_loop.add_callback(
functools.partial(_send_broadcast, client, msg))

def initialize(self, core, allowed_origins, csrf_protection):
self.jsonrpc = make_jsonrpc_wrapper(core)
Expand Down

0 comments on commit 6841478

Please sign in to comment.