Skip to content

Commit b94c5c2

Browse files
committed
Fix Read the Docs build
1 parent 56832d8 commit b94c5c2

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3"
7+
8+
python:
9+
install:
10+
- method: pip
11+
path: .
12+
extra_requirements:
13+
- develop
14+
15+
sphinx:
16+
fail_on_warning: true

docs/conf.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,10 @@
116116
# The theme to use for HTML and HTML Help pages. See the documentation for
117117
# a list of builtin themes.
118118

119-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
119+
import sphinx_rtd_theme
120120

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()]
121+
html_theme = "sphinx_rtd_theme"
122+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
126123

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

noxfile.py

Lines changed: 2 additions & 2 deletions
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")

setup.py

Lines changed: 3 additions & 2 deletions
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)