Fixing more CI issues
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
image: archlinux
|
||||
packages:
|
||||
- dbus
|
||||
- flatpak
|
||||
- flatpak-builder
|
||||
- gobject-introspection
|
||||
- gtk3
|
||||
- mpv
|
||||
- python-cairo
|
||||
- python-gobject
|
||||
- python-pip
|
||||
- python-poetry
|
||||
- xorg-server-xvfb
|
||||
sources:
|
||||
@@ -19,4 +22,4 @@ environment:
|
||||
tasks:
|
||||
- build-flatpak: |
|
||||
cd ${REPO_NAME}/flatpak
|
||||
REPO=repo ./flatpak_build.sh
|
||||
sudo REPO=repo ./flatpak_build.sh
|
||||
|
@@ -1,3 +1,10 @@
|
||||
v0.11.10
|
||||
========
|
||||
|
||||
**The wait is over!** Thanks to help from jlanda_, the Flatpak is back!
|
||||
|
||||
.. _jlanda: https://gitlab.com/jlanda
|
||||
|
||||
v0.11.9
|
||||
=======
|
||||
|
||||
|
@@ -47,7 +47,7 @@ def check_file(path: Path) -> bool:
|
||||
|
||||
|
||||
valid = True
|
||||
for path in Path("sublime").glob("**/*.py"):
|
||||
for path in Path("sublime_music").glob("**/*.py"):
|
||||
valid &= check_file(path)
|
||||
|
||||
for path in Path("tests").glob("**/*.py"):
|
||||
@@ -56,7 +56,7 @@ for path in Path("tests").glob("**/*.py"):
|
||||
"""
|
||||
Checks that the version in the CHANGELOG is the same as the version in ``__init__.py``.
|
||||
"""
|
||||
with open(Path("sublime/__init__.py")) as f:
|
||||
with open(Path("sublime_music/__init__.py")) as f:
|
||||
for line in f:
|
||||
if line.startswith("__version__"):
|
||||
version = eval(line.split()[-1])
|
||||
|
@@ -3,6 +3,7 @@ export PYENV_ROOT="${HOME}/.pyenv"
|
||||
export PATH="${PYENV_ROOT}/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
|
||||
apt-get install -y python3-venv
|
||||
pip3 install poetry
|
||||
|
||||
mkdir -p ~/.config/pypoetry/
|
||||
|
@@ -11,7 +11,7 @@ BUILDDIR = _build
|
||||
SPHINXDOCBUILD = sphinx-apidoc
|
||||
SPHINXDOCOPTS = -f -e -T
|
||||
DOCSSOURCE = ./api/
|
||||
PROJECTDIR = ../sublime/
|
||||
PROJECTDIR = ../sublime_music/
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
|
@@ -8,8 +8,8 @@ server, data on the local filesystem, or even an entirely different service.
|
||||
|
||||
This document is designed to help you understand the Adapter API so that you can
|
||||
create your own custom adapters. This document is best read in conjunction with
|
||||
the :class:`sublime.adapters.Adapter` documentation. This document is meant as a
|
||||
guide to tell you a general order in which to implement things.
|
||||
the :class:`sublime_music.adapters.Adapter` documentation. This document is
|
||||
meant as a guide to tell you a general order in which to implement things.
|
||||
|
||||
Terms
|
||||
=====
|
||||
@@ -35,8 +35,8 @@ Creating Your Adapter Class
|
||||
An adapter is composed of a single Python module. The adapter module can have
|
||||
arbitrary code, and as many files/classes/functions/etc. as necessary, however
|
||||
there must be one and only one class in the module which inherits from the
|
||||
:class:`sublime.adapters.Adapter` class. Normally, a single file with a single
|
||||
class should be enough to implement the entire adapter.
|
||||
:class:`sublime_music.adapters.Adapter` class. Normally, a single file with a
|
||||
single class should be enough to implement the entire adapter.
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -49,16 +49,16 @@ class should be enough to implement the entire adapter.
|
||||
After you've created the class, you will want to implement the following
|
||||
functions and properties first:
|
||||
|
||||
* ``get_ui_info``: Returns a :class:`sublime.adapters.UIInfo` with the info for
|
||||
the adapter.
|
||||
* ``get_ui_info``: Returns a :class:`sublime_music.adapters.UIInfo` with the
|
||||
info for the adapter.
|
||||
* ``__init__``: Used to initialize your adapter. See the
|
||||
:class:`sublime.adapters.Adapter.__init__` documentation for the function
|
||||
signature of the ``__init__`` function.
|
||||
:class:`sublime_music.adapters.Adapter.__init__` documentation for the
|
||||
function signature of the ``__init__`` function.
|
||||
* ``ping_status``: Assuming that your adapter requires connection to the
|
||||
internet, this property needs to be implemented. (If your adapter doesn't
|
||||
require connection to the internet, set
|
||||
:class:`sublime.adapters.Adapter.is_networked` to ``False`` and ignore the
|
||||
rest of this bullet point.)
|
||||
:class:`sublime_music.adapters.Adapter.is_networked` to ``False`` and ignore
|
||||
the rest of this bullet point.)
|
||||
|
||||
This property will tell the UI whether or not the underlying server can be
|
||||
pinged.
|
||||
@@ -80,12 +80,12 @@ functions and properties first:
|
||||
|
||||
If you don't want to implement all of the GTK logic yourself, and just want a
|
||||
simple form, then you can use the
|
||||
:class:`sublime.adapters.ConfigureServerForm` class to generate a form in a
|
||||
declarative manner.
|
||||
:class:`sublime_music.adapters.ConfigureServerForm` class to generate a form
|
||||
in a declarative manner.
|
||||
|
||||
.. note::
|
||||
|
||||
The :class:`sublime.adapters.Adapter` class is an `Abstract Base Class
|
||||
The :class:`sublime_music.adapters.Adapter` class is an `Abstract Base Class
|
||||
<abc_>`_ and all required functions are annotated with the
|
||||
``@abstractmethod`` decorator. This means that your adapter will fail to
|
||||
instantiate if the abstract methods are not implemented.
|
||||
@@ -102,21 +102,21 @@ must do the following:
|
||||
name must be unique within your adapter.
|
||||
|
||||
2. Add a new entry to the return value of your
|
||||
:class:`sublime.adapters.Adapter.get_config_parameters` function with the key
|
||||
being the name from (1), and the value being a
|
||||
:class:`sublime.adapters.ConfigParamDescriptor`. The order of the keys in the
|
||||
dictionary matters, since the UI uses that to determine the order in which
|
||||
the configuration parameters will be shown in the UI.
|
||||
:class:`sublime_music.adapters.Adapter.get_config_parameters` function with
|
||||
the key being the name from (1), and the value being a
|
||||
:class:`sublime_music.adapters.ConfigParamDescriptor`. The order of the keys
|
||||
in the dictionary matters, since the UI uses that to determine the order in
|
||||
which the configuration parameters will be shown in the UI.
|
||||
|
||||
3. Add any verifications that are necessary for your configuration parameter in
|
||||
your :class:`sublime.adapters.Adapter.verify_configuration` function. If you
|
||||
parameter descriptor has ``required = True``, then that parameter is
|
||||
your :class:`sublime_music.adapters.Adapter.verify_configuration` function.
|
||||
If you parameter descriptor has ``required = True``, then that parameter is
|
||||
guaranteed to appear in the configuration.
|
||||
|
||||
4. The configuration parameter will be passed into your
|
||||
:class:`sublime.adapters.Adapter.init` function. It is guaranteed that the
|
||||
``verify_configuration`` will have been called first, so there is no need to
|
||||
re-verify the config that is passed.
|
||||
:class:`sublime_music.adapters.Adapter.init` function. It is guaranteed that
|
||||
the ``verify_configuration`` will have been called first, so there is no need
|
||||
to re-verify the config that is passed.
|
||||
|
||||
Implementing Data Retrieval Methods
|
||||
-----------------------------------
|
||||
|
10
docs/conf.py
10
docs/conf.py
@@ -26,13 +26,13 @@ author = "Sumner Evans"
|
||||
gitlab_url = "https://gitlab.com/sublime-music/sublime-music/"
|
||||
|
||||
# Get the version from the package.
|
||||
module_name = "sublime"
|
||||
init_file = Path(__file__).parent.parent.joinpath("sublime/__init__.py").resolve()
|
||||
module_name = "sublime_music"
|
||||
init_file = Path(__file__).parent.parent.joinpath("sublime_music/__init__.py").resolve()
|
||||
spec = importlib.util.spec_from_file_location(module_name, str(init_file))
|
||||
sublime = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(sublime)
|
||||
sublime_music = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(sublime_music)
|
||||
|
||||
version = release = f"v{sublime.__version__}"
|
||||
version = release = f"v{sublime_music.__version__}"
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
|
@@ -4,7 +4,7 @@ exclude = .git,__pycache__,build,dist,flatpak,.venv
|
||||
max-line-length = 88
|
||||
suppress-none-returning = True
|
||||
suppress-dummy-args = True
|
||||
application-import-names = sublime
|
||||
application-import-names = sublime_music
|
||||
import-order-style = edited
|
||||
|
||||
[mypy-bottle]
|
||||
@@ -58,7 +58,7 @@ addopts =
|
||||
--doctest-modules
|
||||
--ignore-glob='flatpak'
|
||||
--ignore-glob='cicd'
|
||||
--cov=sublime
|
||||
--cov=sublime_music
|
||||
--cov-report html
|
||||
--cov-report term
|
||||
--no-cov-on-fail
|
||||
|
@@ -1 +1 @@
|
||||
__version__ = "0.11.9"
|
||||
__version__ = "0.11.10"
|
||||
|
@@ -569,8 +569,9 @@ class Adapter(abc.ABC):
|
||||
"""
|
||||
Get a list of all of the playlists known by the adapter.
|
||||
|
||||
:returns: A list of all of the :class:`sublime.adapter.api_objects.Playlist`
|
||||
objects known to the adapter.
|
||||
:returns: A list of all of the
|
||||
:class:`sublime_music.adapter.api_objects.Playlist` objects known to the
|
||||
adapter.
|
||||
"""
|
||||
raise self._check_can_error("get_playlists")
|
||||
|
||||
@@ -580,7 +581,7 @@ class Adapter(abc.ABC):
|
||||
exist, then this function should throw an exception.
|
||||
|
||||
:param playlist_id: The ID of the playlist to retrieve.
|
||||
:returns: A :class:`sublime.adapter.api_objects.Play` object for the given
|
||||
:returns: A :class:`sublime_music.adapter.api_objects.Play` object for the given
|
||||
playlist.
|
||||
"""
|
||||
raise self._check_can_error("get_playlist_details")
|
||||
@@ -593,9 +594,9 @@ class Adapter(abc.ABC):
|
||||
|
||||
:param name: The human-readable name of the playlist.
|
||||
:param songs: A list of songs that should be included in the playlist.
|
||||
:returns: A :class:`sublime.adapter.api_objects.Playlist` object for the created
|
||||
playlist. If getting this information will incurr network overhead, then
|
||||
just return ``None``.
|
||||
:returns: A :class:`sublime_music.adapter.api_objects.Playlist` object for the
|
||||
created playlist. If getting this information will incurr network overhead,
|
||||
then just return ``None``.
|
||||
"""
|
||||
raise self._check_can_error("create_playlist")
|
||||
|
||||
@@ -618,8 +619,8 @@ class Adapter(abc.ABC):
|
||||
shared/public vs. not shared/private playlists concept, setting this to
|
||||
``True`` will make the playlist shared/public.
|
||||
:param song_ids: A list of song IDs that should be included in the playlist.
|
||||
:returns: A :class:`sublime.adapter.api_objects.Playlist` object for the updated
|
||||
playlist.
|
||||
:returns: A :class:`sublime_music.adapter.api_objects.Playlist` object for the
|
||||
updated playlist.
|
||||
"""
|
||||
raise self._check_can_error("update_playlist")
|
||||
|
||||
@@ -671,7 +672,7 @@ class Adapter(abc.ABC):
|
||||
Get the details for a given song ID.
|
||||
|
||||
:param song_id: The ID of the song to get the details for.
|
||||
:returns: The :class:`sublime.adapters.api_objects.Song`.
|
||||
:returns: The :class:`sublime_music.adapters.api_objects.Song`.
|
||||
"""
|
||||
raise self._check_can_error("get_song_details")
|
||||
|
||||
@@ -679,7 +680,7 @@ class Adapter(abc.ABC):
|
||||
"""
|
||||
Scrobble the given song.
|
||||
|
||||
:params song: The :class:`sublime.adapters.api_objects.Song` to scrobble.
|
||||
:params song: The :class:`sublime_music.adapters.api_objects.Song` to scrobble.
|
||||
"""
|
||||
raise self._check_can_error("scrobble_song")
|
||||
|
||||
@@ -687,7 +688,7 @@ class Adapter(abc.ABC):
|
||||
"""
|
||||
Get a list of all of the artists known to the adapter.
|
||||
|
||||
:returns: A list of all of the :class:`sublime.adapter.api_objects.Artist`
|
||||
:returns: A list of all of the :class:`sublime_music.adapter.api_objects.Artist`
|
||||
objects known to the adapter.
|
||||
"""
|
||||
raise self._check_can_error("get_artists")
|
||||
@@ -697,7 +698,7 @@ class Adapter(abc.ABC):
|
||||
Get the details for the given artist ID.
|
||||
|
||||
:param artist_id: The ID of the artist to get the details for.
|
||||
:returns: The :classs`sublime.adapters.api_objects.Artist`
|
||||
:returns: The :classs`sublime_music.adapters.api_objects.Artist`
|
||||
"""
|
||||
raise self._check_can_error("get_artist")
|
||||
|
||||
@@ -723,7 +724,7 @@ class Adapter(abc.ABC):
|
||||
|
||||
:param query: An :class:`AlbumSearchQuery` object representing the types of
|
||||
albums to return.
|
||||
:returns: A list of all of the :class:`sublime.adapter.api_objects.Album`
|
||||
:returns: A list of all of the :class:`sublime_music.adapter.api_objects.Album`
|
||||
objects known to the adapter that match the query.
|
||||
"""
|
||||
raise self._check_can_error("get_albums")
|
||||
@@ -733,7 +734,7 @@ class Adapter(abc.ABC):
|
||||
Get the details for the given album ID.
|
||||
|
||||
:param album_id: The ID of the album to get the details for.
|
||||
:returns: The :classs`sublime.adapters.api_objects.Album`
|
||||
:returns: The :classs`sublime_music.adapters.api_objects.Album`
|
||||
"""
|
||||
raise self._check_can_error("get_album")
|
||||
|
||||
@@ -747,8 +748,9 @@ class Adapter(abc.ABC):
|
||||
:param directory_id: The directory to retrieve. If the special value ``"root"``
|
||||
is given, the adapter should list all of the directories at the root of the
|
||||
filesystem tree.
|
||||
:returns: A list of the :class:`sublime.adapter.api_objects.Directory` and
|
||||
:class:`sublime.adapter.api_objects.Song` objects in the given directory.
|
||||
:returns: A list of the :class:`sublime_music.adapter.api_objects.Directory` and
|
||||
:class:`sublime_music.adapter.api_objects.Song` objects in the given
|
||||
directory.
|
||||
"""
|
||||
raise self._check_can_error("get_directory")
|
||||
|
||||
@@ -756,7 +758,7 @@ class Adapter(abc.ABC):
|
||||
"""
|
||||
Get a list of the genres known to the adapter.
|
||||
|
||||
:returns: A list of all of the :classs`sublime.adapter.api_objects.Genre`
|
||||
:returns: A list of all of the :classs`sublime_music.adapter.api_objects.Genre`
|
||||
objects known to the adapter.
|
||||
"""
|
||||
raise self._check_can_error("get_genres")
|
||||
@@ -767,7 +769,7 @@ class Adapter(abc.ABC):
|
||||
the play queue from the cloud.
|
||||
|
||||
:returns: The cloud-saved play queue as a
|
||||
:class:`sublime.adapter.api_objects.PlayQueue` object.
|
||||
:class:`sublime_music.adapter.api_objects.PlayQueue` object.
|
||||
"""
|
||||
raise self._check_can_error("get_play_queue")
|
||||
|
||||
@@ -791,7 +793,7 @@ class Adapter(abc.ABC):
|
||||
Return search results fro the given query.
|
||||
|
||||
:param query: The query string.
|
||||
:returns: A :class:`sublime.adapters.api_objects.SearchResult` object
|
||||
:returns: A :class:`sublime_music.adapters.api_objects.SearchResult` object
|
||||
representing the results of the search.
|
||||
"""
|
||||
raise self._check_can_error("search")
|
||||
|
Reference in New Issue
Block a user