From aa98377b9ab37b01f95ebb94e0277a0d53b3741e Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 1 Jul 2024 16:28:19 +0100 Subject: [PATCH] fix doctest errors --- README.rst | 30 ++++++++++++++++++++---------- changelog.d/1143.doc.rst | 1 + docs/_static/.gitignore | 1 + docs/conf.py | 1 + docs/index.rst | 1 + docs/user/usage.rst | 4 ++-- subliminal/cli.py | 2 +- 7 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 changelog.d/1143.doc.rst create mode 100644 docs/_static/.gitignore diff --git a/README.rst b/README.rst index 0793b821..a5ed2d52 100644 --- a/README.rst +++ b/README.rst @@ -6,16 +6,12 @@ Subtitles, faster than your thoughts. :target: https://pypi.python.org/pypi/subliminal :alt: Latest Version -.. image:: https://travis-ci.org/Diaoul/subliminal.svg?branch=develop - :target: https://travis-ci.org/Diaoul/subliminal - :alt: Travis CI build status - .. image:: https://readthedocs.org/projects/subliminal/badge/?version=latest :target: https://subliminal.readthedocs.org/ :alt: Documentation Status -.. image:: https://coveralls.io/repos/Diaoul/subliminal/badge.svg?branch=develop&service=github - :target: https://coveralls.io/github/Diaoul/subliminal?branch=develop +.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Diaoul/subliminal/python-coverage-comment-action-data/endpoint.json + :target: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Diaoul/subliminal/python-coverage-comment-action-data/endpoint.json :alt: Code coverage .. image:: https://img.shields.io/github/license/Diaoul/subliminal.svg @@ -77,13 +73,27 @@ Run subliminal in a docker container:: Installation ------------ -Subliminal can be installed as a regular python module by running:: +For a better isolation with your system you should use a dedicated virtualenv. +The preferred installation method is to use `pipx `_ that does that for you:: + + $ pipx install subliminal + +Subliminal can be also be installed as a regular python module by running:: - $ [sudo] pip install subliminal + $ pip install --user subliminal + +If you want to modify the code, `fork `_ this repo, +clone your fork locally and install a development version:: + + $ git clone https://github.com//subliminal + $ cd subliminal + $ pip install --user -e '.[dev,test,docs]' -For a better isolation with your system you should use a dedicated virtualenv or install for your user only using -the ``--user`` flag. Nautilus/Nemo integration ------------------------- See the dedicated `project page `_ for more information. + +Dolphin integration +------------------- +See this `Gist `_. diff --git a/changelog.d/1143.doc.rst b/changelog.d/1143.doc.rst new file mode 100644 index 00000000..fab2935e --- /dev/null +++ b/changelog.d/1143.doc.rst @@ -0,0 +1 @@ +fix doctest errors diff --git a/docs/_static/.gitignore b/docs/_static/.gitignore new file mode 100644 index 00000000..f935021a --- /dev/null +++ b/docs/_static/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/docs/conf.py b/docs/conf.py index 41873ac5..4fd55708 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,6 +35,7 @@ # ones. extensions = [ 'sphinx.ext.autodoc', + 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinxcontrib.programoutput', diff --git a/docs/index.rst b/docs/index.rst index b9463fdf..8e021dc2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,6 +25,7 @@ API Documentation If you are looking for information on a specific function, class or method, this part of the documentation is for you. .. toctree:: + :caption: API :maxdepth: 1 api/core diff --git a/docs/user/usage.rst b/docs/user/usage.rst index 5ad01351..d5315980 100644 --- a/docs/user/usage.rst +++ b/docs/user/usage.rst @@ -160,5 +160,5 @@ We got ourselves a nice subtitle, now we can save it on the file system using :f >>> save_subtitles(video, [best_subtitle]) [] - >>> os.listdir() - ['The.Big.Bang.Theory.S05E18.HDTV.x264-LOL.hu.srt'] + >>> 'The.Big.Bang.Theory.S05E18.HDTV.x264-LOL.hu.srt' in os.listdir() + True diff --git a/subliminal/cli.py b/subliminal/cli.py index 0139c55c..e426dcd4 100644 --- a/subliminal/cli.py +++ b/subliminal/cli.py @@ -78,7 +78,7 @@ class LanguageParamType(click.ParamType): name = 'language' def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> Language: - """Convert ietf language to :class:`~babelfish.Language`.""" + """Convert ietf language to :class:`~babelfish.language.Language`.""" try: return Language.fromietf(value) except BabelfishError: