diff --git a/.readthedocs.yml b/.readthedocs.yml index 7ad00c29f..1041df2a4 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,9 +1,11 @@ version: 2 -sphinx: - configuration: docs/sphinx/conf.py + +build: + os: ubuntu-22.04 + tools: + python: "3" python: - version: 3.7 install: - requirements: dev-requirements.txt - path: . diff --git a/dev-requirements.txt b/dev-requirements.txt index f8360eb54..6cc2d1c33 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,7 +5,6 @@ pytest pytest-cov pytest-asyncio coverage -sphinx jinja2 python-dateutil unasync @@ -22,3 +21,9 @@ pandas; python_version<"3.10" # Testing the 'search_mvt' API response mapbox-vector-tile; python_version<"3.10" + +# Docs +# Override Read the Docs default (sphinx<2 and sphinx-rtd-theme<0.5) +sphinx>2 +sphinx-rtd-theme>0.5 +sphinx-autodoc-typehints \ No newline at end of file diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index 4b26b55ff..e6fe394ec 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -17,7 +17,6 @@ # under the License. import datetime -import os import elasticsearch @@ -25,6 +24,8 @@ autoclass_content = "both" +autodoc_typehints = "description" + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -43,13 +44,7 @@ pygments_style = "sphinx" -on_rtd = os.environ.get("READTHEDOCS", None) == "True" - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = "sphinx_rtd_theme" intersphinx_mapping = { "python": ("https://docs.python.org/3", None), diff --git a/noxfile.py b/noxfile.py index c59b06c7b..6ba78e84e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -109,9 +109,7 @@ def lint(session): @nox.session() def docs(session): - session.install( - "-rdev-requirements.txt", "sphinx-rtd-theme", "sphinx-autodoc-typehints" - ) + session.install("-rdev-requirements.txt") session.install(".") session.run("python", "-m", "pip", "install", "sphinx-autodoc-typehints")