Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit 8eb1194

Browse files
callumforrestercoretl
authored andcommitted
Stop checking switcher in docs build
1 parent e2e7d86 commit 8eb1194

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/conf.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@
130130
github_repo = project
131131
github_user = "DiamondLightSource"
132132
switcher_json = f"https://{github_user}.github.io/{github_repo}/switcher.json"
133-
# Don't check switcher if it doesn't exist, but warn in a non-failing way
134-
check_switcher = requests.get(switcher_json).ok
135-
if not check_switcher:
133+
switcher_exists = requests.get(switcher_json).ok
134+
if not switcher_exists:
136135
print(
137136
"*** Can't read version switcher, is GitHub pages enabled? \n"
138137
" Once Docs CI job has successfully run once, set the "
@@ -142,6 +141,14 @@
142141
)
143142

144143
# Theme options for pydata_sphinx_theme
144+
# We don't check switcher because there are 3 possible states for a repo:
145+
# 1. New project, docs are not published so there is no switcher
146+
# 2. Existing project with latest skeleton, switcher exists and works
147+
# 3. Existing project with old skeleton that makes broken switcher,
148+
# switcher exists but is broken
149+
# Point 3 makes checking switcher difficult, because the updated skeleton
150+
# will fix the switcher at the end of the docs workflow, but never gets a chance
151+
# to complete as the docs build warns and fails.
145152
html_theme_options = dict(
146153
logo=dict(
147154
text=project,
@@ -159,7 +166,7 @@
159166
json_url=switcher_json,
160167
version_match=version,
161168
),
162-
check_switcher=check_switcher,
169+
check_switcher=False,
163170
navbar_end=["theme-switcher", "icon-links", "version-switcher"],
164171
external_links=[
165172
dict(

0 commit comments

Comments
 (0)