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