Fix 720 (#726)
* update dev-dependencies * fix INP001 * rework docs (closes #720) * update .readthedocs.yml
This commit is contained in:
parent
e41e1a37d7
commit
af04fa4ac0
14 changed files with 83 additions and 25 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,6 +3,7 @@
|
|||
tests/*.json
|
||||
tests/setup/*.json
|
||||
docs/build
|
||||
docs/source/reference/api
|
||||
test.cfg
|
||||
**.mp3
|
||||
.coverage
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ build:
|
|||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.10"
|
||||
jobs:
|
||||
pre_build:
|
||||
- sphinx-apidoc -o docs/source/reference/api ytmusicapi
|
||||
|
||||
python:
|
||||
install:
|
||||
|
|
|
|||
|
|
@ -17,4 +17,5 @@ help:
|
|||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
sphinx-apidoc -o source/reference/api ../ytmusicapi
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ if errorlevel 9009 (
|
|||
exit /b 1
|
||||
)
|
||||
|
||||
sphinx-apidoc -o source/reference/api ../ytmusicapi
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
goto end
|
||||
|
||||
|
|
|
|||
19
docs/source/_static/css/custom.css
Normal file
19
docs/source/_static/css/custom.css
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
.wy-nav-content {
|
||||
max-width: 1080px !important;
|
||||
}
|
||||
/* Newlines (\a) and spaces (\20) before each parameter */
|
||||
.sig-param::before {
|
||||
content: "\a\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20";
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
/* Newline after the last parameter (so the closing bracket is on a new line) */
|
||||
dt em.sig-param:last-of-type::after {
|
||||
content: "\a";
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
/* To have blue background of width of the block (instead of width of content) */
|
||||
dl.class > dt:first-of-type {
|
||||
display: block !important;
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
.wy-nav-content {
|
||||
max-width: 1080px !important;
|
||||
}
|
||||
|
|
@ -36,7 +36,10 @@ release = __version__
|
|||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ["sphinx.ext.autodoc"]
|
||||
extensions = ["sphinx.ext.autodoc", "sphinx_autodoc_typehints"]
|
||||
|
||||
typehints_use_signature = True
|
||||
typehints_use_signature_return = True
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = ".rst"
|
||||
|
|
@ -51,6 +54,9 @@ templates_path = ["_templates"]
|
|||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ["_static"]
|
||||
html_css_files = [
|
||||
"css/custom.css",
|
||||
]
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
|
|
|
|||
|
|
@ -16,3 +16,4 @@ Reference for the YTMusic class.
|
|||
playlists
|
||||
podcasts
|
||||
uploads
|
||||
api/modules
|
||||
|
|
|
|||
|
|
@ -1,22 +1,23 @@
|
|||
Library
|
||||
-------
|
||||
|
||||
.. currentmodule:: ytmusicapi
|
||||
.. automethod:: YTMusic.get_library_playlists
|
||||
.. automethod:: YTMusic.get_library_songs
|
||||
.. automethod:: YTMusic.get_library_albums
|
||||
.. automethod:: YTMusic.get_library_artists
|
||||
.. automethod:: YTMusic.get_library_subscriptions
|
||||
.. automethod:: YTMusic.get_library_podcasts
|
||||
.. automethod:: YTMusic.get_library_channels
|
||||
.. automethod:: YTMusic.get_liked_songs
|
||||
.. automethod:: YTMusic.get_saved_episodes
|
||||
.. automethod:: YTMusic.get_history
|
||||
.. automethod:: YTMusic.add_history_item
|
||||
.. automethod:: YTMusic.remove_history_items
|
||||
.. automethod:: YTMusic.rate_song
|
||||
.. automethod:: YTMusic.edit_song_library_status
|
||||
.. automethod:: YTMusic.rate_playlist
|
||||
.. automethod:: YTMusic.subscribe_artists
|
||||
.. automethod:: YTMusic.unsubscribe_artists
|
||||
.. automethod:: YTMusic.get_account_info
|
||||
.. automodule:: ytmusicapi
|
||||
|
||||
.. automethod:: YTMusic.get_library_playlists
|
||||
.. automethod:: YTMusic.get_library_songs
|
||||
.. automethod:: YTMusic.get_library_albums
|
||||
.. automethod:: YTMusic.get_library_artists
|
||||
.. automethod:: YTMusic.get_library_subscriptions
|
||||
.. automethod:: YTMusic.get_library_podcasts
|
||||
.. automethod:: YTMusic.get_library_channels
|
||||
.. automethod:: YTMusic.get_liked_songs
|
||||
.. automethod:: YTMusic.get_saved_episodes
|
||||
.. automethod:: YTMusic.get_history
|
||||
.. automethod:: YTMusic.add_history_item
|
||||
.. automethod:: YTMusic.remove_history_items
|
||||
.. automethod:: YTMusic.rate_song
|
||||
.. automethod:: YTMusic.edit_song_library_status
|
||||
.. automethod:: YTMusic.rate_playlist
|
||||
.. automethod:: YTMusic.subscribe_artists
|
||||
.. automethod:: YTMusic.unsubscribe_artists
|
||||
.. automethod:: YTMusic.get_account_info
|
||||
|
|
|
|||
9
docs/source/reference/oauth.rst
Normal file
9
docs/source/reference/oauth.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
OAuth
|
||||
=====
|
||||
|
||||
.. automodule:: ytmusicapi.auth.oauth
|
||||
:ignore-module-all:
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
:imported-members:
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
sphinx<7
|
||||
sphinx-rtd-theme
|
||||
sphinx-rtd-theme
|
||||
sphinx-autodoc-typehints>=1.23.0
|
||||
|
|
|
|||
16
pdm.lock
generated
16
pdm.lock
generated
|
|
@ -5,7 +5,7 @@
|
|||
groups = ["default", "dev"]
|
||||
strategy = ["inherit_metadata"]
|
||||
lock_version = "4.5.0"
|
||||
content_hash = "sha256:29af69738c3d9d88ee292103b66607d5e026df97aa8d73009be3549df8faeffb"
|
||||
content_hash = "sha256:c789497f83027a6f145d2ddb8cd18747f395b42f89330109b847bec1a417449c"
|
||||
|
||||
[[metadata.targets]]
|
||||
requires_python = ">=3.9"
|
||||
|
|
@ -659,6 +659,20 @@ files = [
|
|||
{file = "sphinx-6.2.1-py3-none-any.whl", hash = "sha256:97787ff1fa3256a3eef9eda523a63dbf299f7b47e053cfcf684a1c2a8380c912"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sphinx-autodoc-typehints"
|
||||
version = "1.23.0"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Type hints (PEP 484) support for the Sphinx autodoc extension"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"sphinx>=5.3",
|
||||
]
|
||||
files = [
|
||||
{file = "sphinx_autodoc_typehints-1.23.0-py3-none-any.whl", hash = "sha256:ac099057e66b09e51b698058ba7dd76e57e1fe696cd91b54e121d3dad188f91d"},
|
||||
{file = "sphinx_autodoc_typehints-1.23.0.tar.gz", hash = "sha256:5d44e2996633cdada499b6d27a496ddf9dbc95dd1f0f09f7b37940249e61f6e9"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sphinx-rtd-theme"
|
||||
version = "3.0.2"
|
||||
|
|
|
|||
|
|
@ -82,4 +82,5 @@ dev = [
|
|||
"pytest-cov>=4.1.0",
|
||||
"types-requests>=2.31.0.20240218",
|
||||
"pytest-retry>=1.6.3",
|
||||
"sphinx-autodoc-typehints>=1.23.0",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ class OAuthCredentials(Credentials):
|
|||
Class for handling OAuth credential retrieval and refreshing.
|
||||
"""
|
||||
|
||||
client_id: str
|
||||
client_secret: str
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
client_id: str,
|
||||
|
|
|
|||
Loading…
Reference in a new issue