docs: update API page, add type annotations #4424
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the API page in the docs, which has been a total mess since years (or basically since forever).
Changes
Docs / Sphinx:
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
Streamlink:
Issues
Autodoc:
session
instead ofsession_
(HTTPStream / HLSStream). These method signatures need to be updated in the future because the underscore doesn't make any sense. Fixing that would be a breaking change, so I suggest waiting for the py37 removal (EOL June 2023) when positional-only and keyword-only parameters become available, so this can be done in one go.Streamlink:
streamlink.stream.Stream
which can't be imported instreamlink.plugin.plugin
, orstreamlink.session.Streamlink
(in various places). That unfortunately requires a redesign. AnnotatingPlugin.session
is also currently impossible because of thePlugin.bind
classmethod which I've commented on a few weeks ago.Next
requests.request()
, and my intention was to link to the classes/methods.Future improvements
https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html