Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from kingosticks/python3
Python3
- Loading branch information
Showing
38 changed files
with
2,128 additions
and
1,740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/codecov@1.0.5 | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- py38 | ||
- py37 | ||
- black | ||
- check-manifest | ||
- flake8 | ||
|
||
jobs: | ||
py38: &test-template | ||
docker: | ||
- image: mopidy/ci-python:3.8 | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: Restoring tox cache | ||
key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }} | ||
- 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.cfg" }} | ||
paths: | ||
- ./.tox | ||
- ~/.cache/pip | ||
- codecov/upload: | ||
file: coverage.xml | ||
- store_test_results: | ||
path: test-results | ||
|
||
py37: | ||
<<: *test-template | ||
docker: | ||
- image: mopidy/ci-python:3.7 | ||
|
||
black: *test-template | ||
|
||
check-manifest: *test-template | ||
|
||
flake8: *test-template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
*.egg-info | ||
*.pyc | ||
*.swp | ||
.cache/ | ||
.coverage | ||
.tox/ | ||
MANIFEST | ||
build/ | ||
dist/ | ||
xunit-*.xml | ||
/.coverage | ||
/.mypy_cache/ | ||
/.pytest_cache/ | ||
/.tox/ | ||
/*.egg-info | ||
/build/ | ||
/dist/ | ||
/MANIFEST |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
include *.py | ||
include *.rst | ||
include *.txt | ||
include .travis.yml | ||
include .mailmap | ||
include LICENSE | ||
include MANIFEST.in | ||
include mopidy_spotify/ext.conf | ||
include mopidy_spotify/spotify_appkey.key | ||
include pyproject.toml | ||
include tox.ini | ||
|
||
recursive-include .circleci * | ||
recursive-include .github * | ||
|
||
include mopidy_*/ext.conf | ||
include mopidy_spotify/spotify_appkey.key | ||
|
||
recursive-include tests *.py | ||
recursive-include tests/data * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,52 @@ | ||
from __future__ import unicode_literals | ||
import pathlib | ||
|
||
import os | ||
import pkg_resources | ||
|
||
from mopidy import config, ext | ||
|
||
|
||
__version__ = '3.1.0' | ||
__version__ = pkg_resources.get_distribution("Mopidy-Spotify").version | ||
|
||
|
||
class Extension(ext.Extension): | ||
|
||
dist_name = 'Mopidy-Spotify' | ||
ext_name = 'spotify' | ||
dist_name = "Mopidy-Spotify" | ||
ext_name = "spotify" | ||
version = __version__ | ||
|
||
def get_default_config(self): | ||
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') | ||
return config.read(conf_file) | ||
return config.read(pathlib.Path(__file__).parent / "ext.conf") | ||
|
||
def get_config_schema(self): | ||
schema = super(Extension, self).get_config_schema() | ||
schema = super().get_config_schema() | ||
|
||
schema['username'] = config.String() | ||
schema['password'] = config.Secret() | ||
schema["username"] = config.String() | ||
schema["password"] = config.Secret() | ||
|
||
schema['client_id'] = config.String() | ||
schema['client_secret'] = config.Secret() | ||
schema["client_id"] = config.String() | ||
schema["client_secret"] = config.Secret() | ||
|
||
schema['bitrate'] = config.Integer(choices=(96, 160, 320)) | ||
schema['volume_normalization'] = config.Boolean() | ||
schema['private_session'] = config.Boolean() | ||
schema["bitrate"] = config.Integer(choices=(96, 160, 320)) | ||
schema["volume_normalization"] = config.Boolean() | ||
schema["private_session"] = config.Boolean() | ||
|
||
schema['timeout'] = config.Integer(minimum=0) | ||
schema["timeout"] = config.Integer(minimum=0) | ||
|
||
schema['cache_dir'] = config.Deprecated() # since 2.0 | ||
schema['settings_dir'] = config.Deprecated() # since 2.0 | ||
schema["cache_dir"] = config.Deprecated() # since 2.0 | ||
schema["settings_dir"] = config.Deprecated() # since 2.0 | ||
|
||
schema['allow_cache'] = config.Boolean() | ||
schema['allow_network'] = config.Boolean() | ||
schema['allow_playlists'] = config.Boolean() | ||
schema["allow_cache"] = config.Boolean() | ||
schema["allow_network"] = config.Boolean() | ||
schema["allow_playlists"] = config.Boolean() | ||
|
||
schema['search_album_count'] = config.Integer(minimum=0, maximum=200) | ||
schema['search_artist_count'] = config.Integer(minimum=0, maximum=200) | ||
schema['search_track_count'] = config.Integer(minimum=0, maximum=200) | ||
schema["search_album_count"] = config.Integer(minimum=0, maximum=200) | ||
schema["search_artist_count"] = config.Integer(minimum=0, maximum=200) | ||
schema["search_track_count"] = config.Integer(minimum=0, maximum=200) | ||
|
||
schema['toplist_countries'] = config.List(optional=True) | ||
schema["toplist_countries"] = config.List(optional=True) | ||
|
||
return schema | ||
|
||
def setup(self, registry): | ||
from mopidy_spotify.backend import SpotifyBackend | ||
|
||
registry.add('backend', SpotifyBackend) | ||
registry.add("backend", SpotifyBackend) |
Oops, something went wrong.