Skip to content

Commit 8317976

Browse files
authored
[8.10] Fix Read the Docs theme (#2317)
1 parent 9025479 commit 8317976

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

.readthedocs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
version: 2
2-
sphinx:
3-
configuration: docs/sphinx/conf.py
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3"
47

58
python:
6-
version: 3.7
79
install:
810
- requirements: dev-requirements.txt
911
- path: .

dev-requirements.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pytest
55
pytest-cov
66
pytest-asyncio
77
coverage
8-
sphinx
98
jinja2
109
python-dateutil
1110
unasync
@@ -22,3 +21,9 @@ pandas; python_version<"3.10"
2221

2322
# Testing the 'search_mvt' API response
2423
mapbox-vector-tile; python_version<"3.10"
24+
25+
# Docs
26+
# Override Read the Docs default (sphinx<2 and sphinx-rtd-theme<0.5)
27+
sphinx>2
28+
sphinx-rtd-theme>0.5
29+
sphinx-autodoc-typehints

docs/sphinx/conf.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
# under the License.
1818

1919
import datetime
20-
import os
2120

2221
import elasticsearch
2322

2423
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.intersphinx"]
2524

2625
autoclass_content = "both"
2726

27+
autodoc_typehints = "description"
28+
2829
# Add any paths that contain templates here, relative to this directory.
2930
templates_path = ["_templates"]
3031

@@ -43,13 +44,7 @@
4344

4445
pygments_style = "sphinx"
4546

46-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
47-
48-
if not on_rtd: # only import and set the theme if we're building docs locally
49-
import sphinx_rtd_theme
50-
51-
html_theme = "sphinx_rtd_theme"
52-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
47+
html_theme = "sphinx_rtd_theme"
5348

5449
intersphinx_mapping = {
5550
"python": ("https://docs.python.org/3", None),

noxfile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ def lint(session):
109109

110110
@nox.session()
111111
def docs(session):
112-
session.install(
113-
"-rdev-requirements.txt", "sphinx-rtd-theme", "sphinx-autodoc-typehints"
114-
)
112+
session.install("-rdev-requirements.txt")
115113
session.install(".")
116114
session.run("python", "-m", "pip", "install", "sphinx-autodoc-typehints")
117115

0 commit comments

Comments
 (0)