Skip to content

Commit 9c9eee6

Browse files
committed
Fix Read the Docs build (#1668)
1 parent d437a4d commit 9c9eee6

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

Diff for: .readthedocs.yaml

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.11"
7-
8-
sphinx:
9-
configuration: docs/conf.py
6+
python: "3"
107

118
python:
129
install:
1310
- method: pip
1411
path: .
1512
extra_requirements:
16-
- docs
17-
- method: pip
18-
path: sphinx-rtd-theme
13+
- develop
14+
15+
sphinx:
16+
fail_on_warning: true

Diff for: docs/conf.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
# serve to show the default.
2929

3030
import datetime
31-
import os
31+
32+
import sphinx_rtd_theme
3233

3334
import elasticsearch_dsl
3435

@@ -116,13 +117,8 @@
116117
# The theme to use for HTML and HTML Help pages. See the documentation for
117118
# a list of builtin themes.
118119

119-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
120-
121-
if not on_rtd: # only import and set the theme if we're building docs locally
122-
import sphinx_rtd_theme
123-
124-
html_theme = "sphinx_rtd_theme"
125-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
120+
html_theme = "sphinx_rtd_theme"
121+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
126122

127123
# Theme options are theme-specific and customize the look and feel of a theme
128124
# further. For a list of options available for each theme, see the

Diff for: noxfile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ def lint(session):
7373

7474
@nox.session()
7575
def docs(session):
76-
session.install(".[develop]", "sphinx-rtd-theme")
76+
session.install(".[develop]")
7777

78-
session.run("sphinx-build", "docs/", "docs/_build", "-b", "html")
78+
session.run("sphinx-build", "docs/", "docs/_build", "-b", "html", "-W")

Diff for: setup.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
"pytest-mock",
3939
"pytz",
4040
"coverage",
41-
"sphinx",
42-
"sphinx_rtd_theme",
41+
# Override Read the Docs default (sphinx<2 and sphinx-rtd-theme<0.5)
42+
"sphinx>2",
43+
"sphinx-rtd-theme>0.5",
4344
]
4445

4546
setup(

0 commit comments

Comments
 (0)