Skip to content

Commit 96a3b88

Browse files
committed
Unconditionally use sphinx_rtd_theme when building docs
This is a speculative fix for the latest build failure on RTD, https://readthedocs.org/projects/circuitpython/builds/21689508/ which appears to be due to a change in RTD's "conf.py.tmpl" readthedocs/readthedocs.org@2066e34 ``` Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 358, in eval_config_file exec(code, namespace) # NoQA: S102 ^^^^^^^^^^^^^^^^^^^^^ File "/home/docs/checkouts/readthedocs.org/user_builds/circuitpython/checkouts/latest/conf.py", line 600, in <module> 'html_theme': html_theme, ^^^^^^^^^^ NameError: name 'html_theme' is not defined ```
1 parent acc4ee9 commit 96a3b88

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

conf.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,9 @@ def autoapi_prepare_jinja_env(jinja_env):
265265

266266
# -- Options for HTML output ----------------------------------------------
267267

268-
# on_rtd is whether we are on readthedocs.org
269-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
270-
271-
if not on_rtd: # only import and set the theme if we're building docs locally
272-
try:
273-
import sphinx_rtd_theme
274-
html_theme = 'sphinx_rtd_theme'
275-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
276-
except:
277-
html_theme = 'default'
278-
html_theme_path = ['.']
279-
else:
280-
html_theme_path = ['.']
268+
import sphinx_rtd_theme
269+
html_theme = 'sphinx_rtd_theme'
270+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
281271

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

0 commit comments

Comments
 (0)